Adding more diags for WellbeingModel
Test: presubmit
Bug: 189139513
Change-Id: Ic52ef42d2cd0a3f19f55aee048911526dd8c732f
diff --git a/quickstep/src/com/android/launcher3/model/WellbeingModel.java b/quickstep/src/com/android/launcher3/model/WellbeingModel.java
index 995c4b0..154b78b 100644
--- a/quickstep/src/com/android/launcher3/model/WellbeingModel.java
+++ b/quickstep/src/com/android/launcher3/model/WellbeingModel.java
@@ -319,12 +319,17 @@
@WorkerThread
private void updateActionsWithRetry(int retryCount, @Nullable String packageName) {
+ if (DEBUG || mIsInTest) {
+ Log.i(TAG,
+ "updateActionsWithRetry(); retryCount: " + retryCount + ", package: "
+ + packageName);
+ }
String[] packageNames = TextUtils.isEmpty(packageName)
- ? mContext.getSystemService(LauncherApps.class)
+ ? mContext.getSystemService(LauncherApps.class)
.getActivityList(null, Process.myUserHandle()).stream()
.map(li -> li.getApplicationInfo().packageName).distinct()
.toArray(String[]::new)
- : new String[] { packageName };
+ : new String[]{packageName};
mWorkerHandler.removeCallbacksAndMessages(packageName);
if (updateActions(packageNames)) {
@@ -335,12 +340,16 @@
return;
}
mWorkerHandler.postDelayed(
- () -> updateActionsWithRetry(retryCount + 1, packageName),
+ () -> {
+ if (DEBUG || mIsInTest) Log.i(TAG, "Retrying; attempt " + (retryCount + 1));
+ updateActionsWithRetry(retryCount + 1, packageName);
+ },
packageName, RETRY_TIMES_MS[retryCount]);
}
@WorkerThread
private void updateAllPackages() {
+ if (DEBUG || mIsInTest) Log.i(TAG, "updateAllPackages");
updateActionsWithRetry(0, null);
}