summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3
diff options
context:
space:
mode:
authorvadimt <vadimt@google.com>2019-05-22 12:58:35 -0700
committervadimt <vadimt@google.com>2019-05-22 12:58:35 -0700
commit3ab80bb734e8c5d942db834ec44b33e872fcb44d (patch)
treec7835236ed1af3c8ce05640f3900af12707dc906 /src/com/android/launcher3
parent9e26fccacc59202912406fe237bd9f11207fd34b (diff)
downloadandroid_packages_apps_Trebuchet-3ab80bb734e8c5d942db834ec44b33e872fcb44d.tar.gz
android_packages_apps_Trebuchet-3ab80bb734e8c5d942db834ec44b33e872fcb44d.tar.bz2
android_packages_apps_Trebuchet-3ab80bb734e8c5d942db834ec44b33e872fcb44d.zip
Enable debug tracing for a lab-only non-starting app from all apps
Bug: 132900132 Change-Id: I9c5bb51e49f865ea1e1d3d2209a8dfb149f66e87
Diffstat (limited to 'src/com/android/launcher3')
-rw-r--r--src/com/android/launcher3/BaseDraggingActivity.java8
-rw-r--r--src/com/android/launcher3/Launcher.java4
-rw-r--r--src/com/android/launcher3/TestProtocol.java5
-rw-r--r--src/com/android/launcher3/touch/ItemClickHandler.java20
4 files changed, 35 insertions, 2 deletions
diff --git a/src/com/android/launcher3/BaseDraggingActivity.java b/src/com/android/launcher3/BaseDraggingActivity.java
index ccd9e2529..bd6ac90f3 100644
--- a/src/com/android/launcher3/BaseDraggingActivity.java
+++ b/src/com/android/launcher3/BaseDraggingActivity.java
@@ -134,6 +134,10 @@ public abstract class BaseDraggingActivity extends BaseActivity
public boolean startActivitySafely(View v, Intent intent, @Nullable ItemInfo item,
@Nullable String sourceContainer) {
+ if (com.android.launcher3.TestProtocol.sDebugTracing) {
+ android.util.Log.d(com.android.launcher3.TestProtocol.NO_START_TAG,
+ "startActivitySafely 1");
+ }
if (mIsSafeModeEnabled && !Utilities.isSystemApp(this, intent)) {
Toast.makeText(this, R.string.safemode_shortcut_error, Toast.LENGTH_SHORT).show();
return false;
@@ -157,6 +161,10 @@ public abstract class BaseDraggingActivity extends BaseActivity
startShortcutIntentSafely(intent, optsBundle, item, sourceContainer);
} else if (user == null || user.equals(Process.myUserHandle())) {
// Could be launching some bookkeeping activity
+ if (com.android.launcher3.TestProtocol.sDebugTracing) {
+ android.util.Log.d(com.android.launcher3.TestProtocol.NO_START_TAG,
+ "startActivitySafely 2");
+ }
startActivity(intent, optsBundle);
AppLaunchTracker.INSTANCE.get(this).onStartApp(intent.getComponent(),
Process.myUserHandle(), sourceContainer);
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 40eb912df..a59189bea 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1782,6 +1782,10 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
public boolean startActivitySafely(View v, Intent intent, ItemInfo item,
@Nullable String sourceContainer) {
+ if (com.android.launcher3.TestProtocol.sDebugTracing) {
+ android.util.Log.d(com.android.launcher3.TestProtocol.NO_START_TAG,
+ "startActivitySafely outer");
+ }
boolean success = super.startActivitySafely(v, intent, item, sourceContainer);
if (success && v instanceof BubbleTextView) {
// This is set to the view that launched the activity that navigated the user away
diff --git a/src/com/android/launcher3/TestProtocol.java b/src/com/android/launcher3/TestProtocol.java
index 081150db0..a0440e877 100644
--- a/src/com/android/launcher3/TestProtocol.java
+++ b/src/com/android/launcher3/TestProtocol.java
@@ -65,7 +65,8 @@ public final class TestProtocol {
public static final String REQUEST_HOME_TO_ALL_APPS_SWIPE_HEIGHT =
"home-to-all-apps-swipe-height";
public static boolean sDebugTracing = false;
- public static final String REQUEST_ENABLE_DRAG_LOGGING = "enable-drag-logging";
- public static final String REQUEST_DISABLE_DRAG_LOGGING = "disable-drag-logging";
+ public static final String REQUEST_ENABLE_DEBUG_TRACING = "enable-debug-tracing";
+ public static final String REQUEST_DISABLE_DEBUG_TRACING = "disable-debug-tracing";
public static final String NO_DRAG_TAG = "b/133009122";
+ public static final String NO_START_TAG = "b/132900132";
}
diff --git a/src/com/android/launcher3/touch/ItemClickHandler.java b/src/com/android/launcher3/touch/ItemClickHandler.java
index 06500018d..99b9f25b1 100644
--- a/src/com/android/launcher3/touch/ItemClickHandler.java
+++ b/src/com/android/launcher3/touch/ItemClickHandler.java
@@ -66,14 +66,26 @@ public class ItemClickHandler {
}
private static void onClick(View v, String sourceContainer) {
+ if (com.android.launcher3.TestProtocol.sDebugTracing) {
+ android.util.Log.d(com.android.launcher3.TestProtocol.NO_START_TAG,
+ "onClick 1");
+ }
// Make sure that rogue clicks don't get through while allapps is launching, or after the
// view has detached (it's possible for this to happen if the view is removed mid touch).
if (v.getWindowToken() == null) {
+ if (com.android.launcher3.TestProtocol.sDebugTracing) {
+ android.util.Log.d(com.android.launcher3.TestProtocol.NO_START_TAG,
+ "onClick 2");
+ }
return;
}
Launcher launcher = Launcher.getLauncher(v.getContext());
if (!launcher.getWorkspace().isFinishedSwitchingState()) {
+ if (com.android.launcher3.TestProtocol.sDebugTracing) {
+ android.util.Log.d(com.android.launcher3.TestProtocol.NO_START_TAG,
+ "onClick 3");
+ }
return;
}
@@ -85,6 +97,10 @@ public class ItemClickHandler {
onClickFolderIcon(v);
}
} else if (tag instanceof AppInfo) {
+ if (com.android.launcher3.TestProtocol.sDebugTracing) {
+ android.util.Log.d(com.android.launcher3.TestProtocol.NO_START_TAG,
+ "onClick 4");
+ }
startAppShortcutOrInfoActivity(v, (AppInfo) tag, launcher,
sourceContainer == null ? CONTAINER_ALL_APPS: sourceContainer);
} else if (tag instanceof LauncherAppWidgetInfo) {
@@ -216,6 +232,10 @@ public class ItemClickHandler {
private static void startAppShortcutOrInfoActivity(View v, ItemInfo item, Launcher launcher,
@Nullable String sourceContainer) {
+ if (com.android.launcher3.TestProtocol.sDebugTracing) {
+ android.util.Log.d(com.android.launcher3.TestProtocol.NO_START_TAG,
+ "startAppShortcutOrInfoActivity");
+ }
Intent intent;
if (item instanceof PromiseAppInfo) {
PromiseAppInfo promiseAppInfo = (PromiseAppInfo) item;