From e755d469d40b95e763a9dcb67d0e4f511d1948dd Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Tue, 22 Jul 2014 13:48:29 -0700 Subject: Implementing a package install progress listener for L issue: 15835307 Change-Id: I71aaea087963f2e0e1206447190cbe23c174057d --- src/com/android/launcher3/ShortcutInfo.java | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'src/com/android/launcher3/ShortcutInfo.java') diff --git a/src/com/android/launcher3/ShortcutInfo.java b/src/com/android/launcher3/ShortcutInfo.java index dc019b272..612b0a5aa 100644 --- a/src/com/android/launcher3/ShortcutInfo.java +++ b/src/com/android/launcher3/ShortcutInfo.java @@ -42,13 +42,7 @@ public class ShortcutInfo extends ItemInfo { public static final int PACKAGE_STATE_DEFAULT = 0; /** {@link #mState} meaning some external entity has promised to install this package. */ - public static final int PACKAGE_STATE_ENQUEUED = 1; - - /** {@link #mState} meaning but some external entity is downloading this package. */ - public static final int PACKAGE_STATE_DOWNLOADING = 2; - - /** {@link #mState} meaning some external entity is installing this package. */ - public static final int PACKAGE_STATE_INSTALLING = 3; + public static final int PACKAGE_STATE_INSTALLING = 1; /** * The intent used to start the application. @@ -89,6 +83,11 @@ public class ShortcutInfo extends ItemInfo { */ protected int mState; + /** + * The installation progress [0-100] of the package that this shortcut represents. + */ + protected int mProgress; + long firstInstallTime; int flags = 0; @@ -237,16 +236,24 @@ public class ShortcutInfo extends ItemInfo { public boolean isAbandoned() { return isPromise() - && (mState == ShortcutInfo.PACKAGE_STATE_ERROR - || mState == ShortcutInfo.PACKAGE_STATE_UNKNOWN); + && (mState == PACKAGE_STATE_ERROR + || mState == PACKAGE_STATE_UNKNOWN); } - public int getState() { - return mState; + public int getProgress() { + return mProgress; + } + + public void setProgress(int progress) { + mProgress = progress; } public void setState(int state) { mState = state; } + + public int getState() { + return mState; + } } -- cgit v1.2.3