Add logging to help debug invalid icon state and UI.

PackageInstallStateChangedTask had some redundant state handling that could lead to invalid states. Removed state handling (potential fix to b/198924992) along with logging to help debug b/198924992.

Test: Started and canceled an app download
Bug: 198924992
Change-Id: I8b8202ceb62a3265186d8d46a0e1be6afc83c080
(cherry picked from commit fbf4178ab7)
This commit is contained in:
Schneider Victor-tulias
2021-09-14 16:12:38 -07:00
parent b56f3e2d21
commit 2c8966bbc8
3 changed files with 32 additions and 8 deletions

View File

@@ -24,6 +24,7 @@ import androidx.annotation.Nullable;
import com.android.launcher3.icons.BitmapInfo;
import com.android.launcher3.icons.FastBitmapDrawable;
import com.android.launcher3.logging.FileLog;
import com.android.launcher3.pm.PackageInstallInfo;
import com.android.launcher3.util.PackageManagerHelper;
@@ -179,6 +180,12 @@ public abstract class ItemInfoWithIcon extends ItemInfo {
*/
public void setProgressLevel(PackageInstallInfo installInfo) {
setProgressLevel(installInfo.progress, installInfo.state);
if (installInfo.state == PackageInstallInfo.STATUS_FAILED) {
FileLog.d(TAG,
"Icon info: " + this + " marked broken with install info: " + installInfo,
new Exception());
}
}
/**