Fixed bug: Not everyone has home controls yet, or pets.
Fixes: 156301524
Test: # to enable controls component
adb shell am start -n com.android.egg.test/com.android.egg.neko.NekoActivationActivity
# manual step: activate controls from GlobalActions
# to visit the cat list
adb shell am start -n com.android.egg.test/com.android.egg.neko.NekoLand
# to check on the status of the food bowl job (once
# the food bowl control has been tapped)
adb shell cmd jobscheduler get-job-state com.android.egg.test 42
# to trigger the food immediately
adb shell cmd jobscheduler run com.android.egg.test 42
Change-Id: I985a930bb5dd56d99eb57a340e4affe08c09724b
diff --git a/packages/EasterEgg/AndroidManifest.xml b/packages/EasterEgg/AndroidManifest.xml
index 7f76a45..57c459b 100644
--- a/packages/EasterEgg/AndroidManifest.xml
+++ b/packages/EasterEgg/AndroidManifest.xml
@@ -6,19 +6,24 @@
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
+ <!-- used for cat notifications -->
+ <uses-permission android:name="android.permission.SUBSTITUTE_NOTIFICATION_APP_NAME" />
+ <!-- used to save cat images -->
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+ <!-- controls -->
+ <uses-permission android:name="android.permission.BIND_CONTROLS" />
+
<application
- android:icon="@drawable/q_icon"
+ android:icon="@drawable/icon"
android:label="@string/app_name">
+
<activity android:name=".quares.QuaresActivity"
android:icon="@drawable/q_icon"
android:label="@string/q_egg_name"
+ android:exported="true"
android:theme="@style/QuaresTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.DEFAULT" />
- <!-- <category android:name="android.intent.category.LAUNCHER" /> -->
- <category android:name="com.android.internal.category.PLATLOGO" />
</intent-filter>
</activity>
<activity
@@ -26,15 +31,86 @@
android:configChanges="orientation|keyboardHidden|screenSize|uiMode"
android:icon="@drawable/p_icon"
android:label="@string/p_egg_name"
+ android:exported="true"
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
-
- <!-- <category android:name="android.intent.category.DEFAULT" /> -->
- <!-- <category android:name="android.intent.category.LAUNCHER" /> -->
- <!-- <category android:name="com.android.internal.category.PLATLOGO" /> -->
</intent-filter>
</activity>
+
+ <!-- Android N easter egg bits -->
+ <activity android:name=".neko.NekoLand"
+ android:theme="@android:style/Theme.Material.NoActionBar"
+ android:exported="true"
+ android:label="@string/app_name">
+ <intent-filter>
+ <action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES" />
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ </activity>
+
+ <!-- This is where the magic happens -->
+ <service
+ android:name=".neko.NekoService"
+ android:enabled="true"
+ android:permission="android.permission.BIND_JOB_SERVICE"
+ android:exported="true" >
+ </service>
+
+ <!-- Used to show over lock screen -->
+ <activity android:name=".neko.NekoLockedActivity"
+ android:excludeFromRecents="true"
+ android:exported="true"
+ android:theme="@android:style/Theme.Material.Light.Dialog.NoActionBar"
+ android:showOnLockScreen="true" />
+
+ <!-- Used to enable easter egg -->
+ <activity android:name=".neko.NekoActivationActivity"
+ android:excludeFromRecents="true"
+ android:exported="true"
+ android:theme="@android:style/Theme.NoDisplay"
+ >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="com.android.internal.category.PLATLOGO" />
+ </intent-filter>
+ </activity>
+
+ <!-- The quick settings tile, disabled by default -->
+ <service
+ android:name=".neko.NekoTile"
+ android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"
+ android:icon="@drawable/stat_icon"
+ android:enabled="false"
+ android:label="@string/default_tile_name">
+ <intent-filter>
+ <action android:name="android.service.quicksettings.action.QS_TILE" />
+ </intent-filter>
+ </service>
+
+ <service android:name=".neko.NekoControlsService"
+ android:permission="android.permission.BIND_CONTROLS"
+ android:label="@string/r_egg_name"
+ android:icon="@drawable/ic_fullcat_icon"
+ android:enabled="false"
+ android:exported="true">
+ <intent-filter>
+ <action android:name="android.service.controls.ControlsProviderService" />
+ </intent-filter>
+ </service>
+
+ <!-- FileProvider for sending pictures -->
+ <provider
+ android:name="androidx.core.content.FileProvider"
+ android:authorities="com.android.egg.fileprovider"
+ android:grantUriPermissions="true"
+ android:exported="false">
+ <meta-data
+ android:name="android.support.FILE_PROVIDER_PATHS"
+ android:resource="@xml/filepaths" />
+ </provider>
</application>
</manifest>