Deleting invalid icons when an app is restored

When a app is restored, it may not be in exactly the same state as it was when backed up.
Some components might be missing, and some shortcuts may be disabled or unavailable

Bug: 63525806
Change-Id: I09e6c0e9a9d2c1e8ccd73430f94bd065bdf2718e
This commit is contained in:
Sunny Goyal committed 2018-05-30 15:23:09 -07:00
1 parent 813ab5c83e
commit e48fe1095d
3 files changed
+37 -14

No files matched your search

@@ -77,7 +77,7 @@ public class PreloadIconDrawable extends FastBitmapDrawable {
private final Matrix mTmpMatrix = new Matrix();
private final PathMeasure mPathMeasure = new PathMeasure();
private final Context mContext;
private final ItemInfoWithIcon mItem;
// Path in [0, 100] bounds.
private final Path mProgressPath;
@@ -106,7 +106,7 @@ public class PreloadIconDrawable extends FastBitmapDrawable {
*/
public PreloadIconDrawable(ItemInfoWithIcon info, Path progressPath, Context context) {
super(info);
mContext = context;
mItem = info;
mProgressPath = progressPath;
mScaledTrackPath = new Path();
mScaledProgressPath = new Path();
@@ -274,7 +274,7 @@ public class PreloadIconDrawable extends FastBitmapDrawable {
mTrackAlpha = MAX_PAINT_ALPHA;
setIsDisabled(true);
} else if (progress >= 1) {
setIsDisabled(false);
setIsDisabled(mItem.isDisabled());
mScaledTrackPath.set(mScaledProgressPath);
float fraction = (progress - 1) / COMPLETE_ANIM_FRACTION;