mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-18 18:28:20 +00:00
Add debug logs for testPromiseIcon_addedFromEligibleSession
Bug: 202985412 Test: PromiseIconUiTest Change-Id: I160b9229bebe07015575f8184ac2d53bcbf2bad0
This commit is contained in:
@@ -22,6 +22,7 @@ import android.content.pm.LauncherActivityInfo;
|
||||
import android.content.pm.LauncherApps;
|
||||
import android.content.pm.PackageInstaller.SessionInfo;
|
||||
import android.os.UserHandle;
|
||||
import android.util.Log;
|
||||
import android.util.LongSparseArray;
|
||||
import android.util.Pair;
|
||||
|
||||
@@ -39,6 +40,7 @@ import com.android.launcher3.model.data.LauncherAppWidgetInfo;
|
||||
import com.android.launcher3.model.data.WorkspaceItemInfo;
|
||||
import com.android.launcher3.pm.InstallSessionHelper;
|
||||
import com.android.launcher3.pm.PackageInstallInfo;
|
||||
import com.android.launcher3.testing.TestProtocol;
|
||||
import com.android.launcher3.util.GridOccupancy;
|
||||
import com.android.launcher3.util.IntArray;
|
||||
import com.android.launcher3.util.IntSet;
|
||||
@@ -82,11 +84,19 @@ public class AddWorkspaceItemsTask extends BaseModelUpdateTask {
|
||||
item.itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) {
|
||||
// Short-circuit this logic if the icon exists somewhere on the workspace
|
||||
if (shortcutExists(dataModel, item.getIntent(), item.user)) {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.MISSING_PROMISE_ICON,
|
||||
LOG + " Item already on workspace.");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// b/139663018 Short-circuit this logic if the icon is a system app
|
||||
if (PackageManagerHelper.isSystemApp(app.getContext(), item.getIntent())) {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.MISSING_PROMISE_ICON,
|
||||
LOG + " Item is a system app.");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -126,6 +136,9 @@ public class AddWorkspaceItemsTask extends BaseModelUpdateTask {
|
||||
String packageName = item.getTargetComponent() != null
|
||||
? item.getTargetComponent().getPackageName() : null;
|
||||
if (packageName == null) {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + " Null packageName.");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
SessionInfo sessionInfo = packageInstaller.getActiveSessionInfo(item.user,
|
||||
@@ -134,6 +147,9 @@ public class AddWorkspaceItemsTask extends BaseModelUpdateTask {
|
||||
if (!packageInstaller.verifySessionInfo(sessionInfo)) {
|
||||
FileLog.d(LOG, "Item info failed session info verification. "
|
||||
+ "Skipping : " + workspaceInfo);
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + "Failed verification.");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -144,6 +160,9 @@ public class AddWorkspaceItemsTask extends BaseModelUpdateTask {
|
||||
if (sessionInfo == null) {
|
||||
if (!hasActivity) {
|
||||
// Session was cancelled, do not add.
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + "Session cancelled");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
@@ -163,6 +182,9 @@ public class AddWorkspaceItemsTask extends BaseModelUpdateTask {
|
||||
// workspace items as promise icons. At this point we now have the
|
||||
// correct intent to compare against existing workspace icons.
|
||||
// Icon already exists on the workspace and should not be auto-added.
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + "shortcutExists");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user