ShortcutManager: API rename

The words "title" and "text" implies that "text" is a secondary label
that's shown with the title, but it turned out the launcher would show
only one of those depending on how much space it has.

So now we change them to "shortLabel" and "longLabel"

Note we're only changing the API surface -- in order to mimimize
the impact to the code, internally we'll keep using the old names.

- Also remove "shortcutRank" while I'm here -- it should be implied
from the order of the XML elements.

Bug 29057378

Change-Id: I3203f63b0318c7462c1c61fef43cf9755fa8c008
diff --git a/api/current.txt b/api/current.txt
index 01aa843..cc46480 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -1107,15 +1107,14 @@
     field public static final int shareInterpolator = 16843195; // 0x10101bb
     field public static final int sharedUserId = 16842763; // 0x101000b
     field public static final int sharedUserLabel = 16843361; // 0x1010261
-    field public static final int shortcutCategories = 16844081; // 0x1010531
-    field public static final int shortcutDisabledMessage = 16844080; // 0x1010530
-    field public static final int shortcutIcon = 16844077; // 0x101052d
+    field public static final int shortcutCategories = 16844080; // 0x1010530
+    field public static final int shortcutDisabledMessage = 16844079; // 0x101052f
+    field public static final int shortcutIcon = 16844076; // 0x101052c
     field public static final int shortcutId = 16844075; // 0x101052b
-    field public static final int shortcutIntentAction = 16844082; // 0x1010532
-    field public static final int shortcutIntentData = 16844083; // 0x1010533
-    field public static final int shortcutRank = 16844076; // 0x101052c
-    field public static final int shortcutText = 16844079; // 0x101052f
-    field public static final int shortcutTitle = 16844078; // 0x101052e
+    field public static final int shortcutIntentAction = 16844081; // 0x1010531
+    field public static final int shortcutIntentData = 16844082; // 0x1010532
+    field public static final int shortcutLongLabel = 16844078; // 0x101052e
+    field public static final int shortcutShortLabel = 16844077; // 0x101052d
     field public static final int shouldDisableView = 16843246; // 0x10101ee
     field public static final int showAsAction = 16843481; // 0x10102d9
     field public static final int showDefault = 16843258; // 0x10101fa
@@ -10058,18 +10057,18 @@
     method public android.content.ComponentName getActivity();
     method public java.util.Set<java.lang.String> getCategories();
     method public java.lang.CharSequence getDisabledMessage();
-    method public int getDisabledMessageResId();
+    method public int getDisabledMessageResourceId();
     method public android.os.PersistableBundle getExtras();
     method public int getIconResourceId();
     method public java.lang.String getId();
     method public android.content.Intent getIntent();
     method public long getLastChangedTimestamp();
+    method public java.lang.CharSequence getLongLabel();
+    method public int getLongLabelResourceId();
     method public java.lang.String getPackage();
     method public int getRank();
-    method public java.lang.CharSequence getText();
-    method public int getTextResId();
-    method public java.lang.CharSequence getTitle();
-    method public int getTitleResId();
+    method public java.lang.CharSequence getShortLabel();
+    method public int getShortLabelResourceId();
     method public android.os.UserHandle getUserHandle();
     method public boolean hasIconFile();
     method public boolean hasIconResource();
@@ -10107,9 +10106,9 @@
     method public android.content.pm.ShortcutInfo.Builder setIcon(android.graphics.drawable.Icon);
     method public android.content.pm.ShortcutInfo.Builder setId(java.lang.String);
     method public android.content.pm.ShortcutInfo.Builder setIntent(android.content.Intent);
+    method public android.content.pm.ShortcutInfo.Builder setLongLabel(java.lang.String);
     method public android.content.pm.ShortcutInfo.Builder setRank(int);
-    method public android.content.pm.ShortcutInfo.Builder setText(java.lang.String);
-    method public android.content.pm.ShortcutInfo.Builder setTitle(java.lang.String);
+    method public android.content.pm.ShortcutInfo.Builder setShortLabel(java.lang.String);
   }
 
   public class ShortcutManager {
diff --git a/api/system-current.txt b/api/system-current.txt
index c18b916..f76b173 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -1217,15 +1217,14 @@
     field public static final int shareInterpolator = 16843195; // 0x10101bb
     field public static final int sharedUserId = 16842763; // 0x101000b
     field public static final int sharedUserLabel = 16843361; // 0x1010261
-    field public static final int shortcutCategories = 16844081; // 0x1010531
-    field public static final int shortcutDisabledMessage = 16844080; // 0x1010530
-    field public static final int shortcutIcon = 16844077; // 0x101052d
+    field public static final int shortcutCategories = 16844080; // 0x1010530
+    field public static final int shortcutDisabledMessage = 16844079; // 0x101052f
+    field public static final int shortcutIcon = 16844076; // 0x101052c
     field public static final int shortcutId = 16844075; // 0x101052b
-    field public static final int shortcutIntentAction = 16844082; // 0x1010532
-    field public static final int shortcutIntentData = 16844083; // 0x1010533
-    field public static final int shortcutRank = 16844076; // 0x101052c
-    field public static final int shortcutText = 16844079; // 0x101052f
-    field public static final int shortcutTitle = 16844078; // 0x101052e
+    field public static final int shortcutIntentAction = 16844081; // 0x1010531
+    field public static final int shortcutIntentData = 16844082; // 0x1010532
+    field public static final int shortcutLongLabel = 16844078; // 0x101052e
+    field public static final int shortcutShortLabel = 16844077; // 0x101052d
     field public static final int shouldDisableView = 16843246; // 0x10101ee
     field public static final int showAsAction = 16843481; // 0x10102d9
     field public static final int showDefault = 16843258; // 0x10101fa
@@ -10481,18 +10480,18 @@
     method public android.content.ComponentName getActivity();
     method public java.util.Set<java.lang.String> getCategories();
     method public java.lang.CharSequence getDisabledMessage();
-    method public int getDisabledMessageResId();
+    method public int getDisabledMessageResourceId();
     method public android.os.PersistableBundle getExtras();
     method public int getIconResourceId();
     method public java.lang.String getId();
     method public android.content.Intent getIntent();
     method public long getLastChangedTimestamp();
+    method public java.lang.CharSequence getLongLabel();
+    method public int getLongLabelResourceId();
     method public java.lang.String getPackage();
     method public int getRank();
-    method public java.lang.CharSequence getText();
-    method public int getTextResId();
-    method public java.lang.CharSequence getTitle();
-    method public int getTitleResId();
+    method public java.lang.CharSequence getShortLabel();
+    method public int getShortLabelResourceId();
     method public android.os.UserHandle getUserHandle();
     method public boolean hasIconFile();
     method public boolean hasIconResource();
@@ -10530,9 +10529,9 @@
     method public android.content.pm.ShortcutInfo.Builder setIcon(android.graphics.drawable.Icon);
     method public android.content.pm.ShortcutInfo.Builder setId(java.lang.String);
     method public android.content.pm.ShortcutInfo.Builder setIntent(android.content.Intent);
+    method public android.content.pm.ShortcutInfo.Builder setLongLabel(java.lang.String);
     method public android.content.pm.ShortcutInfo.Builder setRank(int);
-    method public android.content.pm.ShortcutInfo.Builder setText(java.lang.String);
-    method public android.content.pm.ShortcutInfo.Builder setTitle(java.lang.String);
+    method public android.content.pm.ShortcutInfo.Builder setShortLabel(java.lang.String);
   }
 
   public class ShortcutManager {
diff --git a/api/test-current.txt b/api/test-current.txt
index 7de82b3..e0ec247 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -1107,15 +1107,14 @@
     field public static final int shareInterpolator = 16843195; // 0x10101bb
     field public static final int sharedUserId = 16842763; // 0x101000b
     field public static final int sharedUserLabel = 16843361; // 0x1010261
-    field public static final int shortcutCategories = 16844081; // 0x1010531
-    field public static final int shortcutDisabledMessage = 16844080; // 0x1010530
-    field public static final int shortcutIcon = 16844077; // 0x101052d
+    field public static final int shortcutCategories = 16844080; // 0x1010530
+    field public static final int shortcutDisabledMessage = 16844079; // 0x101052f
+    field public static final int shortcutIcon = 16844076; // 0x101052c
     field public static final int shortcutId = 16844075; // 0x101052b
-    field public static final int shortcutIntentAction = 16844082; // 0x1010532
-    field public static final int shortcutIntentData = 16844083; // 0x1010533
-    field public static final int shortcutRank = 16844076; // 0x101052c
-    field public static final int shortcutText = 16844079; // 0x101052f
-    field public static final int shortcutTitle = 16844078; // 0x101052e
+    field public static final int shortcutIntentAction = 16844081; // 0x1010531
+    field public static final int shortcutIntentData = 16844082; // 0x1010532
+    field public static final int shortcutLongLabel = 16844078; // 0x101052e
+    field public static final int shortcutShortLabel = 16844077; // 0x101052d
     field public static final int shouldDisableView = 16843246; // 0x10101ee
     field public static final int showAsAction = 16843481; // 0x10102d9
     field public static final int showDefault = 16843258; // 0x10101fa
@@ -10071,18 +10070,18 @@
     method public android.content.ComponentName getActivity();
     method public java.util.Set<java.lang.String> getCategories();
     method public java.lang.CharSequence getDisabledMessage();
-    method public int getDisabledMessageResId();
+    method public int getDisabledMessageResourceId();
     method public android.os.PersistableBundle getExtras();
     method public int getIconResourceId();
     method public java.lang.String getId();
     method public android.content.Intent getIntent();
     method public long getLastChangedTimestamp();
+    method public java.lang.CharSequence getLongLabel();
+    method public int getLongLabelResourceId();
     method public java.lang.String getPackage();
     method public int getRank();
-    method public java.lang.CharSequence getText();
-    method public int getTextResId();
-    method public java.lang.CharSequence getTitle();
-    method public int getTitleResId();
+    method public java.lang.CharSequence getShortLabel();
+    method public int getShortLabelResourceId();
     method public android.os.UserHandle getUserHandle();
     method public boolean hasIconFile();
     method public boolean hasIconResource();
@@ -10120,9 +10119,9 @@
     method public android.content.pm.ShortcutInfo.Builder setIcon(android.graphics.drawable.Icon);
     method public android.content.pm.ShortcutInfo.Builder setId(java.lang.String);
     method public android.content.pm.ShortcutInfo.Builder setIntent(android.content.Intent);
+    method public android.content.pm.ShortcutInfo.Builder setLongLabel(java.lang.String);
     method public android.content.pm.ShortcutInfo.Builder setRank(int);
-    method public android.content.pm.ShortcutInfo.Builder setText(java.lang.String);
-    method public android.content.pm.ShortcutInfo.Builder setTitle(java.lang.String);
+    method public android.content.pm.ShortcutInfo.Builder setShortLabel(java.lang.String);
   }
 
   public class ShortcutManager {
diff --git a/core/java/android/content/pm/ShortcutInfo.java b/core/java/android/content/pm/ShortcutInfo.java
index c83aa22..28e7887 100644
--- a/core/java/android/content/pm/ShortcutInfo.java
+++ b/core/java/android/content/pm/ShortcutInfo.java
@@ -350,7 +350,7 @@
             mTitleResId = 0;
         } else if (source.mTitleResId != 0) {
             mTitle = null;
-            mTitleResId = source.getTitleResId();
+            mTitleResId = source.mTitleResId;
         }
         if (source.mText != null) {
             mText = source.mText;
@@ -490,47 +490,77 @@
             return this;
         }
 
-        /** @hide */
-        public Builder setTitleResId(int titleResId) {
-            Preconditions.checkState(mTitle == null, "title already set");
-            mTitleResId = titleResId;
+        /**
+         * @hide We don't support resource strings for dynamic shortcuts for now.  (But unit tests
+         * use it.)
+         */
+        public Builder setShortLabelResId(int shortLabelResId) {
+            Preconditions.checkState(mTitle == null, "shortLabel already set");
+            mTitleResId = shortLabelResId;
             return this;
         }
 
         /**
-         * Sets the title of a shortcut.  This is a mandatory field.
+         * Sets the short title of a shortcut.  This is a mandatory field.
          *
          * <p>This field is intended for a concise description of a shortcut displayed under
          * an icon.  The recommend max length is 10 characters.
          */
         @NonNull
-        public Builder setTitle(@NonNull String title) {
-            Preconditions.checkState(mTitleResId == 0, "titleResId already set");
-            mTitle = Preconditions.checkStringNotEmpty(title, "title");
+        public Builder setShortLabel(@NonNull String shortLabel) {
+            Preconditions.checkState(mTitleResId == 0, "shortLabelResId already set");
+            mTitle = Preconditions.checkStringNotEmpty(shortLabel, "shortLabel");
             return this;
         }
 
-        /** @hide */
-        public Builder setTextResId(int textResId) {
-            Preconditions.checkState(mText == null, "text already set");
-            mTextResId = textResId;
+        /**
+         * @hide We don't support resource strings for dynamic shortcuts for now.  (But unit tests
+         * use it.)
+         */
+        public Builder setLongLabelResId(int longLabelResId) {
+            Preconditions.checkState(mText == null, "longLabel already set");
+            mTextResId = longLabelResId;
             return this;
         }
 
         /**
          * Sets the text of a shortcut.  This is an optional field.
          *
-         * <p>This field is intended to be more descriptive than the shortcut title.
+         * <p>This field is intended to be more descriptive than the shortcut title.  The launcher
+         * shows this instead of the short title, when it has enough space.
          * The recommend max length is 25 characters.
          */
         @NonNull
-        public Builder setText(@NonNull String text) {
-            Preconditions.checkState(mTextResId == 0, "textResId already set");
-            mText = Preconditions.checkStringNotEmpty(text, "text");
+        public Builder setLongLabel(@NonNull String longLabel) {
+            Preconditions.checkState(mTextResId == 0, "longLabelResId already set");
+            mText = Preconditions.checkStringNotEmpty(longLabel, "longLabel");
             return this;
         }
 
-        /** @hide */
+        /** @hide -- old signature, the internal code still uses it. */
+        public Builder setTitle(@NonNull String value) {
+            return setShortLabel(value);
+        }
+
+        /** @hide -- old signature, the internal code still uses it. */
+        public Builder setTitleResId(int value) {
+            return setShortLabelResId(value);
+        }
+
+        /** @hide -- old signature, the internal code still uses it. */
+        public Builder setText(@NonNull String value) {
+            return setLongLabel(value);
+        }
+
+        /** @hide -- old signature, the internal code still uses it. */
+        public Builder setTextResId(int value) {
+            return setLongLabelResId(value);
+        }
+
+        /**
+         * @hide We don't support resource strings for dynamic shortcuts for now.  (But unit tests
+         * use it.)
+         */
         public Builder setDisabledMessageResId(int disabledMessageResId) {
             Preconditions.checkState(mDisabledMessage == null, "disabledMessage already set");
             mDisabledMessageResId = disabledMessageResId;
@@ -641,32 +671,54 @@
         return mIcon;
     }
 
-    /**
-     * Return the shortcut title.
-     *
-     * <p>All shortcuts must have a non-empty title, but this method will return null when
-     * {@link #hasKeyFieldsOnly()} is true.
-     */
+    /** @hide -- old signature, the internal code still uses it. */
     @Nullable
     public CharSequence getTitle() {
         return mTitle;
     }
 
-    /** TODO Javadoc */
+    /** @hide -- old signature, the internal code still uses it. */
     public int getTitleResId() {
         return mTitleResId;
     }
 
+    /** @hide -- old signature, the internal code still uses it. */
+    @Nullable
+    public CharSequence getText() {
+        return mText;
+    }
+
+    /** @hide -- old signature, the internal code still uses it. */
+    public int getTextResId() {
+        return mTextResId;
+    }
+
+    /**
+     * Return the shorter version of the shortcut title.
+     *
+     * <p>All shortcuts must have a non-empty title, but this method will return null when
+     * {@link #hasKeyFieldsOnly()} is true.
+     */
+    @Nullable
+    public CharSequence getShortLabel() {
+        return mTitle;
+    }
+
+    /** TODO Javadoc */
+    public int getShortLabelResourceId() {
+        return mTitleResId;
+    }
+
     /**
      * Return the shortcut text.
      */
     @Nullable
-    public CharSequence getText() {
+    public CharSequence getLongLabel() {
         return mText;
     }
 
     /** TODO Javadoc */
-    public int getTextResId() {
+    public int getLongLabelResourceId() {
         return mTextResId;
     }
 
@@ -679,7 +731,7 @@
     }
 
     /** TODO Javadoc */
-    public int getDisabledMessageResId() {
+    public int getDisabledMessageResourceId() {
         return mDisabledMessageResId;
     }
 
@@ -1104,19 +1156,19 @@
         sb.append(", activity=");
         sb.append(mActivity);
 
-        sb.append(", title=");
+        sb.append(", shortLabel=");
         sb.append(secure ? "***" : mTitle);
-        sb.append(", titleResId=");
+        sb.append(", resId=");
         sb.append(mTitleResId);
 
-        sb.append(", text=");
+        sb.append(", longLabel=");
         sb.append(secure ? "***" : mText);
-        sb.append(", textResId=");
+        sb.append(", resId=");
         sb.append(mTextResId);
 
         sb.append(", disabledMessage=");
         sb.append(secure ? "***" : mDisabledMessage);
-        sb.append(", disabledMessageResId=");
+        sb.append(", resId=");
         sb.append(mDisabledMessageResId);
 
         sb.append(", categories=");
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 88c5629..60b0ef2 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -8248,10 +8248,9 @@
     <declare-styleable name="Shortcut">
         <attr name="shortcutId" format="string" />
         <attr name="enabled" />
-        <attr name="shortcutRank" format="integer" />
         <attr name="shortcutIcon" format="reference" />
-        <attr name="shortcutTitle" format="reference" />
-        <attr name="shortcutText" format="reference" />
+        <attr name="shortcutShortLabel" format="reference" />
+        <attr name="shortcutLongLabel" format="reference" />
         <attr name="shortcutDisabledMessage" format="reference" />
         <attr name="shortcutCategories" format="string" />
         <attr name="shortcutIntentAction" format="string" />
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 421bc2a..6f2c6b8 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -2739,10 +2739,9 @@
        =============================================================== -->
     <eat-comment />
     <public type="attr" name="shortcutId" />
-    <public type="attr" name="shortcutRank" />
     <public type="attr" name="shortcutIcon" />
-    <public type="attr" name="shortcutTitle" />
-    <public type="attr" name="shortcutText" />
+    <public type="attr" name="shortcutShortLabel" />
+    <public type="attr" name="shortcutLongLabel" />
     <public type="attr" name="shortcutDisabledMessage" />
     <public type="attr" name="shortcutCategories" />
     <public type="attr" name="shortcutIntentAction" />
diff --git a/services/core/java/com/android/server/pm/ShortcutPackage.java b/services/core/java/com/android/server/pm/ShortcutPackage.java
index bca3777..b9b2d3d 100644
--- a/services/core/java/com/android/server/pm/ShortcutPackage.java
+++ b/services/core/java/com/android/server/pm/ShortcutPackage.java
@@ -829,7 +829,8 @@
         ShortcutService.writeAttr(out, ATTR_TEXT, si.getText());
         ShortcutService.writeAttr(out, ATTR_TEXT_RES_ID, si.getTextResId());
         ShortcutService.writeAttr(out, ATTR_DISABLED_MESSAGE, si.getDisabledMessage());
-        ShortcutService.writeAttr(out, ATTR_DISABLED_MESSAGE_RES_ID, si.getDisabledMessageResId());
+        ShortcutService.writeAttr(out, ATTR_DISABLED_MESSAGE_RES_ID,
+                si.getDisabledMessageResourceId());
         ShortcutService.writeAttr(out, ATTR_INTENT, si.getIntentNoExtras());
         ShortcutService.writeAttr(out, ATTR_RANK, si.getRank());
         ShortcutService.writeAttr(out, ATTR_TIMESTAMP,
diff --git a/services/core/java/com/android/server/pm/ShortcutParser.java b/services/core/java/com/android/server/pm/ShortcutParser.java
index 44d0a9f..1e396b3 100644
--- a/services/core/java/com/android/server/pm/ShortcutParser.java
+++ b/services/core/java/com/android/server/pm/ShortcutParser.java
@@ -85,6 +85,8 @@
 
             int type;
 
+            int rank = 0;
+
             outer:
             while ((type = parser.next()) != XmlPullParser.END_DOCUMENT
                     && (type != XmlPullParser.END_TAG || parser.getDepth() > 0)) {
@@ -99,7 +101,7 @@
                 }
                 if (depth == 2 && TAG_SHORTCUT.equals(tag)) {
                     final ShortcutInfo si = parseShortcutAttributes(
-                            service, attrs, packageName, activity, userId);
+                            service, attrs, packageName, activity, userId, rank++);
                     if (ShortcutService.DEBUG) {
                         Slog.d(TAG, "Shortcut=" + si);
                     }
@@ -132,16 +134,15 @@
 
     private static ShortcutInfo parseShortcutAttributes(ShortcutService service,
             AttributeSet attrs, String packageName, ComponentName activity,
-            @UserIdInt int userId) {
+            @UserIdInt int userId, int rank) {
         final TypedArray sa = service.mContext.getResources().obtainAttributes(attrs,
                 R.styleable.Shortcut);
         try {
             final String id = sa.getString(R.styleable.Shortcut_shortcutId);
             final boolean enabled = sa.getBoolean(R.styleable.Shortcut_enabled, true);
-            final int rank = sa.getInt(R.styleable.Shortcut_shortcutRank, 0);
             final int iconResId = sa.getResourceId(R.styleable.Shortcut_shortcutIcon, 0);
-            final int titleResId = sa.getResourceId(R.styleable.Shortcut_shortcutTitle, 0);
-            final int textResId = sa.getResourceId(R.styleable.Shortcut_shortcutText, 0);
+            final int titleResId = sa.getResourceId(R.styleable.Shortcut_shortcutShortLabel, 0);
+            final int textResId = sa.getResourceId(R.styleable.Shortcut_shortcutLongLabel, 0);
             final int disabledMessageResId = sa.getResourceId(
                     R.styleable.Shortcut_shortcutDisabledMessage, 0);
             final String categories = sa.getString(R.styleable.Shortcut_shortcutCategories);
diff --git a/services/tests/servicestests/res/xml/shortcut_1.xml b/services/tests/servicestests/res/xml/shortcut_1.xml
index c370e74..f6d54fc 100644
--- a/services/tests/servicestests/res/xml/shortcut_1.xml
+++ b/services/tests/servicestests/res/xml/shortcut_1.xml
@@ -2,10 +2,9 @@
     <shortcut
         android:shortcutId="ms1"
         android:enabled="true"
-        android:shortcutRank="1"
         android:shortcutIcon="@drawable/icon1"
-        android:shortcutTitle="@string/shortcut_title1"
-        android:shortcutText="@string/shortcut_text1"
+        android:shortcutShortLabel="@string/shortcut_title1"
+        android:shortcutLongLabel="@string/shortcut_text1"
         android:shortcutDisabledMessage="@string/shortcut_disabled_message1"
         android:shortcutCategories="android.shortcut.conversation:android.shortcut.media"
         android:shortcutIntentAction="action1"
diff --git a/services/tests/servicestests/res/xml/shortcut_1_disable.xml b/services/tests/servicestests/res/xml/shortcut_1_disable.xml
index 08ecac3..6bc3939 100644
--- a/services/tests/servicestests/res/xml/shortcut_1_disable.xml
+++ b/services/tests/servicestests/res/xml/shortcut_1_disable.xml
@@ -2,10 +2,9 @@
     <shortcut
         android:shortcutId="ms1"
         android:enabled="false"
-        android:shortcutRank="1"
         android:shortcutIcon="@drawable/icon2"
-        android:shortcutTitle="@string/shortcut_title2"
-        android:shortcutText="@string/shortcut_text2"
+        android:shortcutShortLabel="@string/shortcut_title2"
+        android:shortcutLongLabel="@string/shortcut_text2"
         android:shortcutDisabledMessage="@string/shortcut_disabled_message2"
     />
 </shortcuts>
diff --git a/services/tests/servicestests/res/xml/shortcut_2.xml b/services/tests/servicestests/res/xml/shortcut_2.xml
index 9e923f3..8c525b0 100644
--- a/services/tests/servicestests/res/xml/shortcut_2.xml
+++ b/services/tests/servicestests/res/xml/shortcut_2.xml
@@ -2,10 +2,9 @@
     <shortcut
         android:shortcutId="ms1"
         android:enabled="true"
-        android:shortcutRank="1"
         android:shortcutIcon="@drawable/icon1"
-        android:shortcutTitle="@string/shortcut_title1"
-        android:shortcutText="@string/shortcut_text1"
+        android:shortcutShortLabel="@string/shortcut_title1"
+        android:shortcutLongLabel="@string/shortcut_text1"
         android:shortcutDisabledMessage="@string/shortcut_disabled_message1"
         android:shortcutCategories="android.shortcut.conversation:android.shortcut.media"
         android:shortcutIntentAction="action1"
@@ -14,10 +13,9 @@
     <shortcut
         android:shortcutId="ms2"
         android:enabled="true"
-        android:shortcutRank="2"
         android:shortcutIcon="@drawable/icon2"
-        android:shortcutTitle="@string/shortcut_title2"
-        android:shortcutText="@string/shortcut_text2"
+        android:shortcutShortLabel="@string/shortcut_title2"
+        android:shortcutLongLabel="@string/shortcut_text2"
         android:shortcutDisabledMessage="@string/shortcut_disabled_message2"
         android:shortcutCategories="android.shortcut.conversation"
         android:shortcutIntentAction="action2"
diff --git a/services/tests/servicestests/res/xml/shortcut_2_duplicate.xml b/services/tests/servicestests/res/xml/shortcut_2_duplicate.xml
index d90c18d..7f4a940 100644
--- a/services/tests/servicestests/res/xml/shortcut_2_duplicate.xml
+++ b/services/tests/servicestests/res/xml/shortcut_2_duplicate.xml
@@ -1,12 +1,12 @@
 <shortcuts xmlns:android="http://schemas.android.com/apk/res/android" >
     <shortcut
         android:shortcutId="ms1"
-        android:shortcutTitle="@string/shortcut_title1"
+        android:shortcutShortLabel="@string/shortcut_title1"
         android:shortcutIntentAction="action1"
     />
     <shortcut
         android:shortcutId="ms1"
-        android:shortcutTitle="@string/shortcut_title2"
+        android:shortcutShortLabel="@string/shortcut_title2"
         android:shortcutIntentAction="action2"
     />
 </shortcuts>
diff --git a/services/tests/servicestests/res/xml/shortcut_5.xml b/services/tests/servicestests/res/xml/shortcut_5.xml
index f3f71d2..bfeff03 100644
--- a/services/tests/servicestests/res/xml/shortcut_5.xml
+++ b/services/tests/servicestests/res/xml/shortcut_5.xml
@@ -2,10 +2,9 @@
     <shortcut
         android:shortcutId="ms1"
         android:enabled="true"
-        android:shortcutRank="1"
         android:shortcutIcon="@drawable/icon1"
-        android:shortcutTitle="@string/shortcut_title1"
-        android:shortcutText="@string/shortcut_text1"
+        android:shortcutShortLabel="@string/shortcut_title1"
+        android:shortcutLongLabel="@string/shortcut_text1"
         android:shortcutDisabledMessage="@string/shortcut_disabled_message1"
         android:shortcutCategories="android.shortcut.conversation:android.shortcut.media"
         android:shortcutIntentAction="action1"
@@ -14,27 +13,26 @@
     <shortcut
         android:shortcutId="ms2"
         android:enabled="true"
-        android:shortcutRank="2"
         android:shortcutIcon="@drawable/icon2"
-        android:shortcutTitle="@string/shortcut_title2"
-        android:shortcutText="@string/shortcut_text2"
+        android:shortcutShortLabel="@string/shortcut_title2"
+        android:shortcutLongLabel="@string/shortcut_text2"
         android:shortcutDisabledMessage="@string/shortcut_disabled_message2"
         android:shortcutCategories="android.shortcut.conversation"
         android:shortcutIntentAction="action2"
     />
     <shortcut
         android:shortcutId="ms3"
-        android:shortcutTitle="@string/shortcut_title1"
+        android:shortcutShortLabel="@string/shortcut_title1"
         android:shortcutIntentAction="android.intent.action.VIEW"
     />
     <shortcut
         android:shortcutId="ms4"
-        android:shortcutTitle="@string/shortcut_title1"
+        android:shortcutShortLabel="@string/shortcut_title1"
         android:shortcutIntentAction="android.intent.action.VIEW"
     />
     <shortcut
         android:shortcutId="ms5"
-        android:shortcutTitle="@string/shortcut_title1"
+        android:shortcutShortLabel="@string/shortcut_title1"
         android:shortcutIntentAction="android.intent.action.VIEW"
     />
 </shortcuts>
diff --git a/services/tests/servicestests/res/xml/shortcut_error_1.xml b/services/tests/servicestests/res/xml/shortcut_error_1.xml
index 2c51420..e45d93c 100644
--- a/services/tests/servicestests/res/xml/shortcut_error_1.xml
+++ b/services/tests/servicestests/res/xml/shortcut_error_1.xml
@@ -1,11 +1,11 @@
 <shortcuts xmlns:android="http://schemas.android.com/apk/res/android" >
     <shortcut
-        android:shortcutTitle="@string/shortcut_title1"
+        android:shortcutShortLabel="@string/shortcut_title1"
         android:shortcutIntentAction="android.intent.action.VIEW"
     />
     <shortcut
         android:shortcutId="x1"
-        android:shortcutTitle="@string/shortcut_title1"
+        android:shortcutShortLabel="@string/shortcut_title1"
         android:shortcutIntentAction="android.intent.action.VIEW"
     />
 </shortcuts>
diff --git a/services/tests/servicestests/res/xml/shortcut_error_2.xml b/services/tests/servicestests/res/xml/shortcut_error_2.xml
index d075e7d..6dbcfe1 100644
--- a/services/tests/servicestests/res/xml/shortcut_error_2.xml
+++ b/services/tests/servicestests/res/xml/shortcut_error_2.xml
@@ -5,7 +5,7 @@
     />
     <shortcut
         android:shortcutId="x2"
-        android:shortcutTitle="@string/shortcut_title1"
+        android:shortcutShortLabel="@string/shortcut_title1"
         android:shortcutIntentAction="android.intent.action.VIEW"
     />
 </shortcuts>
diff --git a/services/tests/servicestests/res/xml/shortcut_error_3.xml b/services/tests/servicestests/res/xml/shortcut_error_3.xml
index 30bf56e..942d494 100644
--- a/services/tests/servicestests/res/xml/shortcut_error_3.xml
+++ b/services/tests/servicestests/res/xml/shortcut_error_3.xml
@@ -1,11 +1,11 @@
 <shortcuts xmlns:android="http://schemas.android.com/apk/res/android" >
     <shortcut
         android:shortcutId="manifest-shortcut-3"
-        android:shortcutTitle="@string/shortcut_title1"
+        android:shortcutShortLabel="@string/shortcut_title1"
     />
     <shortcut
         android:shortcutId="x3"
-        android:shortcutTitle="@string/shortcut_title1"
+        android:shortcutShortLabel="@string/shortcut_title1"
         android:shortcutIntentAction="android.intent.action.VIEW"
     />
 </shortcuts>
diff --git a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest.java b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest.java
index 1a0a003..f073d8c 100644
--- a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest.java
@@ -6359,7 +6359,7 @@
         assertEquals(123, si.getIcon().getResId());
         assertEquals(10, si.getTitleResId());
         assertEquals(11, si.getTextResId());
-        assertEquals(12, si.getDisabledMessageResId());
+        assertEquals(12, si.getDisabledMessageResourceId());
         assertEquals(set(ShortcutInfo.SHORTCUT_CATEGORY_CONVERSATION, "xyz"), si.getCategories());
         assertEquals("action", si.getIntent().getAction());
         assertEquals("val", si.getIntent().getStringExtra("key"));
@@ -6503,7 +6503,7 @@
         assertEquals(123, si.getIcon().getResId());
         assertEquals(10, si.getTitleResId());
         assertEquals(11, si.getTextResId());
-        assertEquals(12, si.getDisabledMessageResId());
+        assertEquals(12, si.getDisabledMessageResourceId());
         assertEquals(set(ShortcutInfo.SHORTCUT_CATEGORY_CONVERSATION, "xyz"), si.getCategories());
         assertEquals("action", si.getIntent().getAction());
         assertEquals("val", si.getIntent().getStringExtra("key"));
@@ -6522,7 +6522,7 @@
         assertEquals(null, si.getIcon());
         assertEquals(10, si.getTitleResId());
         assertEquals(11, si.getTextResId());
-        assertEquals(12, si.getDisabledMessageResId());
+        assertEquals(12, si.getDisabledMessageResourceId());
         assertEquals(set(ShortcutInfo.SHORTCUT_CATEGORY_CONVERSATION, "xyz"), si.getCategories());
         assertEquals("action", si.getIntent().getAction());
         assertEquals("val", si.getIntent().getStringExtra("key"));
@@ -6542,7 +6542,7 @@
         assertEquals(null, si.getIcon());
         assertEquals(10, si.getTitleResId());
         assertEquals(11, si.getTextResId());
-        assertEquals(12, si.getDisabledMessageResId());
+        assertEquals(12, si.getDisabledMessageResourceId());
         assertEquals(set(ShortcutInfo.SHORTCUT_CATEGORY_CONVERSATION, "xyz"), si.getCategories());
         assertEquals(null, si.getIntent());
         assertEquals(123, si.getRank());
@@ -6561,7 +6561,7 @@
         assertEquals(null, si.getIcon());
         assertEquals(0, si.getTitleResId());
         assertEquals(0, si.getTextResId());
-        assertEquals(0, si.getDisabledMessageResId());
+        assertEquals(0, si.getDisabledMessageResourceId());
         assertEquals(null, si.getCategories());
         assertEquals(null, si.getIntent());
         assertEquals(0, si.getRank());
@@ -6680,14 +6680,14 @@
                 .setDisabledMessage("xxx").build());
         assertEquals(123, si.getRank());
         assertEquals("xxx", si.getDisabledMessage());
-        assertEquals(0, si.getDisabledMessageResId());
+        assertEquals(0, si.getDisabledMessageResourceId());
 
         si = sorig.clone(/* flags=*/ 0);
         si.copyNonNullFieldsFrom(new ShortcutInfo.Builder(getTestContext()).setId("id")
                 .setDisabledMessageResId(11111).build());
         assertEquals(123, si.getRank());
         assertEquals(null, si.getDisabledMessage());
-        assertEquals(11111, si.getDisabledMessageResId());
+        assertEquals(11111, si.getDisabledMessageResourceId());
 
         si = sorig.clone(/* flags=*/ 0);
         si.copyNonNullFieldsFrom(new ShortcutInfo.Builder(getTestContext()).setId("id")
@@ -6808,14 +6808,14 @@
                 .setDisabledMessage("xxx").build());
         assertEquals(123, si.getRank());
         assertEquals("xxx", si.getDisabledMessage());
-        assertEquals(0, si.getDisabledMessageResId());
+        assertEquals(0, si.getDisabledMessageResourceId());
 
         si = sorig.clone(/* flags=*/ 0);
         si.copyNonNullFieldsFrom(new ShortcutInfo.Builder(getTestContext()).setId("id")
                 .setDisabledMessageResId(11111).build());
         assertEquals(123, si.getRank());
         assertEquals(null, si.getDisabledMessage());
-        assertEquals(11111, si.getDisabledMessageResId());
+        assertEquals(11111, si.getDisabledMessageResourceId());
 
         si = sorig.clone(/* flags=*/ 0);
         si.copyNonNullFieldsFrom(new ShortcutInfo.Builder(getTestContext()).setId("id")
@@ -6967,7 +6967,7 @@
         assertEquals(null, si.getIcon());
         assertEquals(10, si.getTitleResId());
         assertEquals(11, si.getTextResId());
-        assertEquals(12, si.getDisabledMessageResId());
+        assertEquals(12, si.getDisabledMessageResourceId());
         assertEquals(set(ShortcutInfo.SHORTCUT_CATEGORY_CONVERSATION, "xyz"), si.getCategories());
         assertEquals("action", si.getIntent().getAction());
         assertEquals("val", si.getIntent().getStringExtra("key"));
@@ -7074,7 +7074,7 @@
         assertEquals(null, si.getIcon());
         assertEquals(10, si.getTitleResId());
         assertEquals(11, si.getTextResId());
-        assertEquals(12, si.getDisabledMessageResId());
+        assertEquals(12, si.getDisabledMessageResourceId());
         assertEquals(set(ShortcutInfo.SHORTCUT_CATEGORY_CONVERSATION, "xyz"), si.getCategories());
         assertEquals("action", si.getIntent().getAction());
         assertEquals("val", si.getIntent().getStringExtra("key"));
@@ -7547,11 +7547,12 @@
                     si.getActivity());
             assertEquals(R.string.shortcut_title1, si.getTitleResId());
             assertEquals(R.string.shortcut_text1, si.getTextResId());
-            assertEquals(R.string.shortcut_disabled_message1, si.getDisabledMessageResId());
+            assertEquals(R.string.shortcut_disabled_message1, si.getDisabledMessageResourceId());
             assertEquals(set("android.shortcut.conversation", "android.shortcut.media"),
                     si.getCategories());
             assertEquals("action1", si.getIntent().getAction());
             assertEquals(Uri.parse("http://a.b.c/1"), si.getIntent().getData());
+            assertEquals(0, si.getRank());
 
             // check another
             si = getCallerShortcut("ms2");
@@ -7560,10 +7561,11 @@
             assertEquals(R.drawable.icon2, si.getIconResourceId());
             assertEquals(R.string.shortcut_title2, si.getTitleResId());
             assertEquals(R.string.shortcut_text2, si.getTextResId());
-            assertEquals(R.string.shortcut_disabled_message2, si.getDisabledMessageResId());
+            assertEquals(R.string.shortcut_disabled_message2, si.getDisabledMessageResourceId());
             assertEquals(set("android.shortcut.conversation"), si.getCategories());
             assertEquals("action2", si.getIntent().getAction());
             assertEquals(null, si.getIntent().getData());
+            assertEquals(1, si.getRank());
 
             // check another
             si = getCallerShortcut("ms3");
@@ -7572,10 +7574,11 @@
             assertEquals(0, si.getIconResourceId());
             assertEquals(R.string.shortcut_title1, si.getTitleResId());
             assertEquals(0, si.getTextResId());
-            assertEquals(0, si.getDisabledMessageResId());
+            assertEquals(0, si.getDisabledMessageResourceId());
             assertEquals(null, si.getCategories());
             assertEquals("android.intent.action.VIEW", si.getIntent().getAction());
             assertEquals(null, si.getIntent().getData());
+            assertEquals(2, si.getRank());
         });
     }
 
@@ -7667,7 +7670,7 @@
             assertEquals(R.drawable.icon2, si.getIconResourceId());
             assertEquals(R.string.shortcut_title2, si.getTitleResId());
             assertEquals(R.string.shortcut_text2, si.getTextResId());
-            assertEquals(R.string.shortcut_disabled_message2, si.getDisabledMessageResId());
+            assertEquals(R.string.shortcut_disabled_message2, si.getDisabledMessageResourceId());
             assertEquals(Intent.ACTION_VIEW, si.getIntent().getAction());
 
             // Make sure there's no other dangling shortcuts.
diff --git a/services/tests/shortcutmanagerutils/src/com/android/server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java b/services/tests/shortcutmanagerutils/src/com/android/server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java
index 7fa8a800..e02e98f 100644
--- a/services/tests/shortcutmanagerutils/src/com/android/server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java
+++ b/services/tests/shortcutmanagerutils/src/com/android/server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java
@@ -317,7 +317,7 @@
     public static List<ShortcutInfo> assertAllHaveTitle(
             List<ShortcutInfo> actualShortcuts) {
         for (ShortcutInfo s : actualShortcuts) {
-            assertNotNull("ID " + s.getId(), s.getTitle());
+            assertNotNull("ID " + s.getId(), s.getShortLabel());
         }
         return actualShortcuts;
     }
@@ -325,7 +325,7 @@
     public static List<ShortcutInfo> assertAllNotHaveTitle(
             List<ShortcutInfo> actualShortcuts) {
         for (ShortcutInfo s : actualShortcuts) {
-            assertNull("ID " + s.getId(), s.getTitle());
+            assertNull("ID " + s.getId(), s.getShortLabel());
         }
         return actualShortcuts;
     }