OSDN Git Service

[API review] Add ShortcutInfo.DISABLED_REASON_UNKNOWN
authorMakoto Onuki <omakoto@google.com>
Tue, 9 Jan 2018 18:31:08 +0000 (10:31 -0800)
committerMakoto Onuki <omakoto@google.com>
Tue, 9 Jan 2018 18:39:03 +0000 (10:39 -0800)
Change-Id: I28a80faa223c0ce36e8b77ddbcea51c0b255c903
Fixes: 71555187
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

api/current.txt
core/java/android/content/pm/ShortcutInfo.java
core/res/res/values/strings.xml
core/res/res/values/symbols.xml

index b2121a8..73343c3 100644 (file)
@@ -11352,6 +11352,7 @@ package android.content.pm {
     field public static final int DISABLED_REASON_NOT_DISABLED = 0; // 0x0
     field public static final int DISABLED_REASON_OTHER_RESTORE_ISSUE = 103; // 0x67
     field public static final int DISABLED_REASON_SIGNATURE_MISMATCH = 102; // 0x66
+    field public static final int DISABLED_REASON_UNKNOWN = 3; // 0x3
     field public static final int DISABLED_REASON_VERSION_LOWER = 100; // 0x64
     field public static final java.lang.String SHORTCUT_CATEGORY_CONVERSATION = "android.shortcut.conversation";
   }
index 8839cf9..ea476b0 100644 (file)
@@ -181,6 +181,11 @@ public final class ShortcutInfo implements Parcelable {
     public static final int DISABLED_REASON_APP_CHANGED = 2;
 
     /**
+     * Shortcut is disabled for an unknown reason.
+     */
+    public static final int DISABLED_REASON_UNKNOWN = 3;
+
+    /**
      * A disabled reason that's equal to or bigger than this is due to backup and restore issue.
      * A shortcut with such a reason wil be visible to the launcher, but not to the publisher.
      * ({@link #isVisibleToPublisher()} will be false.)
@@ -214,6 +219,7 @@ public final class ShortcutInfo implements Parcelable {
             DISABLED_REASON_NOT_DISABLED,
             DISABLED_REASON_BY_APP,
             DISABLED_REASON_APP_CHANGED,
+            DISABLED_REASON_UNKNOWN,
             DISABLED_REASON_VERSION_LOWER,
             DISABLED_REASON_BACKUP_NOT_SUPPORTED,
             DISABLED_REASON_SIGNATURE_MISMATCH,
@@ -272,6 +278,9 @@ public final class ShortcutInfo implements Parcelable {
             case DISABLED_REASON_OTHER_RESTORE_ISSUE:
                 return res.getString(
                         com.android.internal.R.string.shortcut_restore_unknown_issue);
+            case DISABLED_REASON_UNKNOWN:
+                return res.getString(
+                        com.android.internal.R.string.shortcut_disabled_reason_unknown);
         }
         return null;
     }
index c54f799..0618a82 100644 (file)
     -->
     <string name="shortcut_restore_unknown_issue">Couldn\u2019t restore shortcut</string>
 
+    <!--
+    A toast message shown when an app shortcut is disabled for an unknown rason.
+    -->
+    <string name="shortcut_disabled_reason_unknown">Shortcut is disabled</string>
+
     <!--Battery saver warning. STOPSHIP: Remove it eventually. -->
     <string name="battery_saver_warning" translatable="false">\"Extreme\" battery saver activated.\n\nSee the details at: go/extreme-battery-saver\n\nEBS aggressively throttles background apps and changes screen-off behavior.\n</string>
 
index 4343ba0..57edc21 100644 (file)
   <java-symbol type="array" name="config_autoBrightnessDisplayValuesNits" />
   <java-symbol type="array" name="config_screenBrightnessBacklight" />
   <java-symbol type="array" name="config_screenBrightnessNits" />
+
+  <java-symbol type="string" name="shortcut_disabled_reason_unknown" />
 </resources>