Loading proguard.flags +7 −0 Original line number Diff line number Diff line Loading @@ -70,3 +70,10 @@ public float getBackgroundAlpha(); public void setBackgroundAlpha(float); } # Proguard will strip new callbacks in LauncherApps.Callback from # WrappedCallback if compiled against an older SDK. Don't let this happen. -keep class com.android.launcher3.compat.** { *; } src/com/android/launcher3/AllAppsList.java +19 −0 Original line number Diff line number Diff line Loading @@ -118,6 +118,25 @@ class AllAppsList { } } /** * Suspend the apps for the given apk identified by packageName. */ public void suspendPackage(String packageName, UserHandleCompat user, boolean suspend) { final List<AppInfo> data = this.data; for (int i = data.size() - 1; i >= 0; i--) { AppInfo info = data.get(i); final ComponentName component = info.intent.getComponent(); if (info.user.equals(user) && packageName.equals(component.getPackageName())) { if (suspend) { info.isDisabled |= ShortcutInfo.FLAG_DISABLED_SUSPENDED; } else { info.isDisabled &= ~ShortcutInfo.FLAG_DISABLED_SUSPENDED; } modified.add(info); } } } public void updateIconsAndLabels(HashSet<String> packages, UserHandleCompat user, ArrayList<AppInfo> outUpdates) { for (AppInfo info : data) { Loading src/com/android/launcher3/AppInfo.java +14 −1 Original line number Diff line number Diff line Loading @@ -56,6 +56,11 @@ public class AppInfo extends ItemInfo { int flags = 0; /** * {@see ShortcutInfo#isDisabled} */ int isDisabled = ShortcutInfo.DEFAULT; AppInfo() { itemType = LauncherSettings.BaseLauncherColumns.ITEM_TYPE_SHORTCUT; } Loading @@ -75,8 +80,10 @@ public class AppInfo extends ItemInfo { IconCache iconCache) { this.componentName = info.getComponentName(); this.container = ItemInfo.NO_ID; flags = initFlags(info); if ((info.getApplicationInfo().flags & LauncherActivityInfoCompat.FLAG_SUSPENDED) != 0) { isDisabled |= ShortcutInfo.FLAG_DISABLED_SUSPENDED; } iconCache.getTitleAndIcon(this, info, true /* useLowResIcon */); intent = makeLaunchIntent(context, info, user); this.user = user; Loading @@ -101,6 +108,7 @@ public class AppInfo extends ItemInfo { title = Utilities.trim(info.title); intent = new Intent(info.intent); flags = info.flags; isDisabled = info.isDisabled; iconBitmap = info.iconBitmap; } Loading Loading @@ -140,4 +148,9 @@ public class AppInfo extends ItemInfo { .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) .putExtra(EXTRA_PROFILE, serialNumber); } @Override public boolean isDisabled() { return isDisabled != 0; } } src/com/android/launcher3/BubbleTextView.java +10 −6 Original line number Diff line number Diff line Loading @@ -150,7 +150,7 @@ public class BubbleTextView extends TextView Bitmap b = info.getIcon(iconCache); FastBitmapDrawable iconDrawable = mLauncher.createIconDrawable(b); if (info.isDisabled != 0) { if (info.isDisabled()) { iconDrawable.setState(FastBitmapDrawable.State.DISABLED); } setIcon(iconDrawable, mIconSize); Loading @@ -166,7 +166,11 @@ public class BubbleTextView extends TextView } public void applyFromApplicationInfo(AppInfo info) { setIcon(mLauncher.createIconDrawable(info.iconBitmap), mIconSize); FastBitmapDrawable iconDrawable = mLauncher.createIconDrawable(info.iconBitmap); if (info.isDisabled()) { iconDrawable.setState(FastBitmapDrawable.State.DISABLED); } setIcon(iconDrawable, mIconSize); setText(info.title); if (info.contentDescription != null) { setContentDescription(info.contentDescription); Loading Loading @@ -250,11 +254,11 @@ public class BubbleTextView extends TextView private void updateIconState() { if (mIcon instanceof FastBitmapDrawable) { FastBitmapDrawable d = (FastBitmapDrawable) mIcon; if (isPressed() || mStayPressed) { d.animateState(FastBitmapDrawable.State.PRESSED); } else if (getTag() instanceof ShortcutInfo && ((ShortcutInfo) getTag()).isDisabled != 0) { if (getTag() instanceof ItemInfo && ((ItemInfo) getTag()).isDisabled()) { d.animateState(FastBitmapDrawable.State.DISABLED); } else if (isPressed() || mStayPressed) { d.animateState(FastBitmapDrawable.State.PRESSED); } else { d.animateState(FastBitmapDrawable.State.NORMAL); } Loading src/com/android/launcher3/ItemInfo.java +7 −0 Original line number Diff line number Diff line Loading @@ -198,4 +198,11 @@ public class ItemInfo { + " screen=" + screenId + " cellX=" + cellX + " cellY=" + cellY + " spanX=" + spanX + " spanY=" + spanY + " user=" + user + ")"; } /** * Whether this item is disabled. */ public boolean isDisabled() { return false; } } Loading
proguard.flags +7 −0 Original line number Diff line number Diff line Loading @@ -70,3 +70,10 @@ public float getBackgroundAlpha(); public void setBackgroundAlpha(float); } # Proguard will strip new callbacks in LauncherApps.Callback from # WrappedCallback if compiled against an older SDK. Don't let this happen. -keep class com.android.launcher3.compat.** { *; }
src/com/android/launcher3/AllAppsList.java +19 −0 Original line number Diff line number Diff line Loading @@ -118,6 +118,25 @@ class AllAppsList { } } /** * Suspend the apps for the given apk identified by packageName. */ public void suspendPackage(String packageName, UserHandleCompat user, boolean suspend) { final List<AppInfo> data = this.data; for (int i = data.size() - 1; i >= 0; i--) { AppInfo info = data.get(i); final ComponentName component = info.intent.getComponent(); if (info.user.equals(user) && packageName.equals(component.getPackageName())) { if (suspend) { info.isDisabled |= ShortcutInfo.FLAG_DISABLED_SUSPENDED; } else { info.isDisabled &= ~ShortcutInfo.FLAG_DISABLED_SUSPENDED; } modified.add(info); } } } public void updateIconsAndLabels(HashSet<String> packages, UserHandleCompat user, ArrayList<AppInfo> outUpdates) { for (AppInfo info : data) { Loading
src/com/android/launcher3/AppInfo.java +14 −1 Original line number Diff line number Diff line Loading @@ -56,6 +56,11 @@ public class AppInfo extends ItemInfo { int flags = 0; /** * {@see ShortcutInfo#isDisabled} */ int isDisabled = ShortcutInfo.DEFAULT; AppInfo() { itemType = LauncherSettings.BaseLauncherColumns.ITEM_TYPE_SHORTCUT; } Loading @@ -75,8 +80,10 @@ public class AppInfo extends ItemInfo { IconCache iconCache) { this.componentName = info.getComponentName(); this.container = ItemInfo.NO_ID; flags = initFlags(info); if ((info.getApplicationInfo().flags & LauncherActivityInfoCompat.FLAG_SUSPENDED) != 0) { isDisabled |= ShortcutInfo.FLAG_DISABLED_SUSPENDED; } iconCache.getTitleAndIcon(this, info, true /* useLowResIcon */); intent = makeLaunchIntent(context, info, user); this.user = user; Loading @@ -101,6 +108,7 @@ public class AppInfo extends ItemInfo { title = Utilities.trim(info.title); intent = new Intent(info.intent); flags = info.flags; isDisabled = info.isDisabled; iconBitmap = info.iconBitmap; } Loading Loading @@ -140,4 +148,9 @@ public class AppInfo extends ItemInfo { .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) .putExtra(EXTRA_PROFILE, serialNumber); } @Override public boolean isDisabled() { return isDisabled != 0; } }
src/com/android/launcher3/BubbleTextView.java +10 −6 Original line number Diff line number Diff line Loading @@ -150,7 +150,7 @@ public class BubbleTextView extends TextView Bitmap b = info.getIcon(iconCache); FastBitmapDrawable iconDrawable = mLauncher.createIconDrawable(b); if (info.isDisabled != 0) { if (info.isDisabled()) { iconDrawable.setState(FastBitmapDrawable.State.DISABLED); } setIcon(iconDrawable, mIconSize); Loading @@ -166,7 +166,11 @@ public class BubbleTextView extends TextView } public void applyFromApplicationInfo(AppInfo info) { setIcon(mLauncher.createIconDrawable(info.iconBitmap), mIconSize); FastBitmapDrawable iconDrawable = mLauncher.createIconDrawable(info.iconBitmap); if (info.isDisabled()) { iconDrawable.setState(FastBitmapDrawable.State.DISABLED); } setIcon(iconDrawable, mIconSize); setText(info.title); if (info.contentDescription != null) { setContentDescription(info.contentDescription); Loading Loading @@ -250,11 +254,11 @@ public class BubbleTextView extends TextView private void updateIconState() { if (mIcon instanceof FastBitmapDrawable) { FastBitmapDrawable d = (FastBitmapDrawable) mIcon; if (isPressed() || mStayPressed) { d.animateState(FastBitmapDrawable.State.PRESSED); } else if (getTag() instanceof ShortcutInfo && ((ShortcutInfo) getTag()).isDisabled != 0) { if (getTag() instanceof ItemInfo && ((ItemInfo) getTag()).isDisabled()) { d.animateState(FastBitmapDrawable.State.DISABLED); } else if (isPressed() || mStayPressed) { d.animateState(FastBitmapDrawable.State.PRESSED); } else { d.animateState(FastBitmapDrawable.State.NORMAL); } Loading
src/com/android/launcher3/ItemInfo.java +7 −0 Original line number Diff line number Diff line Loading @@ -198,4 +198,11 @@ public class ItemInfo { + " screen=" + screenId + " cellX=" + cellX + " cellY=" + cellY + " spanX=" + spanX + " spanY=" + spanY + " user=" + user + ")"; } /** * Whether this item is disabled. */ public boolean isDisabled() { return false; } }