OSDN Git Service

Add more slices to settings
authorJason Monk <jmonk@google.com>
Tue, 3 Apr 2018 18:43:25 +0000 (14:43 -0400)
committerJason Monk <jmonk@google.com>
Wed, 11 Apr 2018 18:06:21 +0000 (14:06 -0400)
Test: open settings
Bug: 74555610
Change-Id: I061685342f61a6a43670b7f3378d2a6918bcf495

AndroidManifest.xml
src/com/android/settings/search/DeviceIndexFeatureProvider.java

index 14fe92b..8767198 100644 (file)
                 android:value="com.android.settings.category.ia.homepage"/>
             <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
                 android:value="true" />
+            <meta-data android:name="android.metadata.SLICE_URI"
+                android:value="content://android.settings.slices/action/toggle_bluetooth_switch" />
         </activity>
 
         <activity android:name="AirplaneModeVoiceActivity"
                 android:value="com.android.settings.category.ia.homepage" />
             <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                 android:value="com.android.settings.fuelgauge.PowerUsageSummary" />
+            <meta-data android:name="android.metadata.SLICE_URI"
+                android:value="content://android.settings.slices/action/auto_brightness" />
         </activity>
 
         <activity
                 android:value="com.android.settings.fuelgauge.batterysaver.BatterySaverSettings" />
             <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
                 android:value="true" />
+            <meta-data android:name="android.metadata.SLICE_URI"
+                android:value="content://android.settings.slices/action/battery_saver_summary" />
         </activity>
 
         <activity android:name=".fuelgauge.BatterySaverModeVoiceActivity"
                 android:value="true" />
             <meta-data android:name="com.android.settings.summary"
                 android:resource="@string/sound_dashboard_summary"/>
+            <meta-data android:name="android.metadata.SLICE_URI"
+                android:value="content://android.settings.slices/action/alarm_volume" />
         </activity>
 
         <!-- Show apps for which application-level notification settings are applicable -->
index 690943e..2273ffd 100644 (file)
@@ -33,6 +33,10 @@ public interface DeviceIndexFeatureProvider {
     // TODO: Remove this and index all action and intent slices through search index.
     String[] ACTIONS_TO_INDEX = new String[]{
             Settings.ACTION_WIFI_SETTINGS,
+            Settings.ACTION_BATTERY_SAVER_SETTINGS,
+            Settings.ACTION_BLUETOOTH_SETTINGS,
+            "android.intent.action.POWER_USAGE_SUMMARY",
+            Settings.ACTION_SOUND_SETTINGS,
     };
 
     String TAG = "DeviceIndex";
@@ -40,7 +44,7 @@ public interface DeviceIndexFeatureProvider {
     String INDEX_VERSION = "settings:index_version";
 
     // Increment when new items are added to ensure they get pushed to the device index.
-    int VERSION = 1;
+    int VERSION = 2;
 
     boolean isIndexingEnabled();