Loading api/current.txt +14 −15 Original line number Diff line number Diff line Loading @@ -1107,15 +1107,14 @@ package android { 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 Loading Loading @@ -10058,18 +10057,18 @@ package android.content.pm { 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(); Loading Loading @@ -10107,9 +10106,9 @@ package android.content.pm { 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 { api/system-current.txt +14 −15 Original line number Diff line number Diff line Loading @@ -1217,15 +1217,14 @@ package android { 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 Loading Loading @@ -10481,18 +10480,18 @@ package android.content.pm { 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(); Loading Loading @@ -10530,9 +10529,9 @@ package android.content.pm { 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 { api/test-current.txt +14 −15 Original line number Diff line number Diff line Loading @@ -1107,15 +1107,14 @@ package android { 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 Loading Loading @@ -10071,18 +10070,18 @@ package android.content.pm { 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(); Loading Loading @@ -10120,9 +10119,9 @@ package android.content.pm { 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 { core/java/android/content/pm/ShortcutInfo.java +81 −29 Original line number Diff line number Diff line Loading @@ -350,7 +350,7 @@ public final class ShortcutInfo implements Parcelable { mTitleResId = 0; } else if (source.mTitleResId != 0) { mTitle = null; mTitleResId = source.getTitleResId(); mTitleResId = source.mTitleResId; } if (source.mText != null) { mText = source.mText; Loading Loading @@ -490,47 +490,77 @@ public final class ShortcutInfo implements Parcelable { 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; Loading Loading @@ -641,19 +671,41 @@ public final class ShortcutInfo implements Parcelable { return mIcon; } /** @hide -- old signature, the internal code still uses it. */ @Nullable public CharSequence getTitle() { return mTitle; } /** @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 shortcut title. * 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 getTitle() { public CharSequence getShortLabel() { return mTitle; } /** TODO Javadoc */ public int getTitleResId() { public int getShortLabelResourceId() { return mTitleResId; } Loading @@ -661,12 +713,12 @@ public final class ShortcutInfo implements Parcelable { * Return the shortcut text. */ @Nullable public CharSequence getText() { public CharSequence getLongLabel() { return mText; } /** TODO Javadoc */ public int getTextResId() { public int getLongLabelResourceId() { return mTextResId; } Loading @@ -679,7 +731,7 @@ public final class ShortcutInfo implements Parcelable { } /** TODO Javadoc */ public int getDisabledMessageResId() { public int getDisabledMessageResourceId() { return mDisabledMessageResId; } Loading Loading @@ -1104,19 +1156,19 @@ public final class ShortcutInfo implements Parcelable { 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="); Loading core/res/res/values/attrs.xml +2 −3 Original line number Diff line number Diff line Loading @@ -8248,10 +8248,9 @@ i <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" /> Loading Loading
api/current.txt +14 −15 Original line number Diff line number Diff line Loading @@ -1107,15 +1107,14 @@ package android { 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 Loading Loading @@ -10058,18 +10057,18 @@ package android.content.pm { 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(); Loading Loading @@ -10107,9 +10106,9 @@ package android.content.pm { 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 {
api/system-current.txt +14 −15 Original line number Diff line number Diff line Loading @@ -1217,15 +1217,14 @@ package android { 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 Loading Loading @@ -10481,18 +10480,18 @@ package android.content.pm { 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(); Loading Loading @@ -10530,9 +10529,9 @@ package android.content.pm { 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 {
api/test-current.txt +14 −15 Original line number Diff line number Diff line Loading @@ -1107,15 +1107,14 @@ package android { 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 Loading Loading @@ -10071,18 +10070,18 @@ package android.content.pm { 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(); Loading Loading @@ -10120,9 +10119,9 @@ package android.content.pm { 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 {
core/java/android/content/pm/ShortcutInfo.java +81 −29 Original line number Diff line number Diff line Loading @@ -350,7 +350,7 @@ public final class ShortcutInfo implements Parcelable { mTitleResId = 0; } else if (source.mTitleResId != 0) { mTitle = null; mTitleResId = source.getTitleResId(); mTitleResId = source.mTitleResId; } if (source.mText != null) { mText = source.mText; Loading Loading @@ -490,47 +490,77 @@ public final class ShortcutInfo implements Parcelable { 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; Loading Loading @@ -641,19 +671,41 @@ public final class ShortcutInfo implements Parcelable { return mIcon; } /** @hide -- old signature, the internal code still uses it. */ @Nullable public CharSequence getTitle() { return mTitle; } /** @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 shortcut title. * 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 getTitle() { public CharSequence getShortLabel() { return mTitle; } /** TODO Javadoc */ public int getTitleResId() { public int getShortLabelResourceId() { return mTitleResId; } Loading @@ -661,12 +713,12 @@ public final class ShortcutInfo implements Parcelable { * Return the shortcut text. */ @Nullable public CharSequence getText() { public CharSequence getLongLabel() { return mText; } /** TODO Javadoc */ public int getTextResId() { public int getLongLabelResourceId() { return mTextResId; } Loading @@ -679,7 +731,7 @@ public final class ShortcutInfo implements Parcelable { } /** TODO Javadoc */ public int getDisabledMessageResId() { public int getDisabledMessageResourceId() { return mDisabledMessageResId; } Loading Loading @@ -1104,19 +1156,19 @@ public final class ShortcutInfo implements Parcelable { 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="); Loading
core/res/res/values/attrs.xml +2 −3 Original line number Diff line number Diff line Loading @@ -8248,10 +8248,9 @@ i <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" /> Loading