diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2017-01-30 15:11:27 -0800 |
---|---|---|
committer | Hyunyoung Song <hyunyoungs@google.com> | 2017-02-01 15:11:08 -0800 |
commit | 3c7d9cbb209107a8c8d41211beff7bf5af6fe285 (patch) | |
tree | 9f8252ae24c185d5f266894e793d900a77d77285 /src/com/android/launcher3/Launcher.java | |
parent | 1fafd719cb4c960448010e5fbdd8cc2634bd347d (diff) | |
download | android_packages_apps_Trebuchet-3c7d9cbb209107a8c8d41211beff7bf5af6fe285.tar.gz android_packages_apps_Trebuchet-3c7d9cbb209107a8c8d41211beff7bf5af6fe285.tar.bz2 android_packages_apps_Trebuchet-3c7d9cbb209107a8c8d41211beff7bf5af6fe285.zip |
Clean up around 1) Log.VERBOSE and 2) dump
b/31772480
Note: in the follow up CL, I will add the dump result of the bgDataModel
to a proto
Change-Id: I5261cff0fb29cedd1dd772b8b15f67095ad5b967
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 81 |
1 files changed, 29 insertions, 52 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 11db9a0eb..d963f4379 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -117,6 +117,7 @@ import com.android.launcher3.userevent.nano.LauncherLogProto.ControlType; import com.android.launcher3.util.ActivityResultInfo; import com.android.launcher3.util.ComponentKey; import com.android.launcher3.util.ItemInfoMatcher; +import com.android.launcher3.util.LogConfig; import com.android.launcher3.util.MultiHashMap; import com.android.launcher3.util.PackageManagerHelper; import com.android.launcher3.util.PackageUserKey; @@ -172,10 +173,6 @@ public class Launcher extends BaseActivity */ protected static final int REQUEST_LAST = 100; - // To turn on these properties, type - // adb shell setprop logTap.tag.PROPERTY_NAME [VERBOSE | SUPPRESS] - static final String DUMP_STATE_PROPERTY = "launcher_dump_state"; - // The Intent extra that defines whether to ignore the launch animation static final String INTENT_EXTRA_IGNORE_LAUNCH_ANIMATION = "com.android.launcher3.intent.extra.shortcut.INGORE_LAUNCH_ANIMATION"; @@ -2201,25 +2198,7 @@ public class Launcher extends BaseActivity @Override public boolean dispatchKeyEvent(KeyEvent event) { - if (event.getAction() == KeyEvent.ACTION_DOWN) { - switch (event.getKeyCode()) { - case KeyEvent.KEYCODE_HOME: - return true; - case KeyEvent.KEYCODE_VOLUME_DOWN: - if (Utilities.isPropertyEnabled(DUMP_STATE_PROPERTY)) { - dumpState(); - return true; - } - break; - } - } else if (event.getAction() == KeyEvent.ACTION_UP) { - switch (event.getKeyCode()) { - case KeyEvent.KEYCODE_HOME: - return true; - } - } - - return super.dispatchKeyEvent(event); + return (event.getKeyCode() == KeyEvent.KEYCODE_HOME) || super.dispatchKeyEvent(event); } @Override @@ -3968,50 +3947,48 @@ public class Launcher extends BaseActivity } /** - * Prints out out state for debugging. + * $ adb shell dumpsys activity com.android.launcher3.Launcher [--all] */ - public void dumpState() { - Log.d(TAG, "BEGIN launcher3 dump state for launcher " + this); - Log.d(TAG, "mWorkspaceLoading=" + mWorkspaceLoading); - Log.d(TAG, "mPendingRequestArgs=" + mPendingRequestArgs); - Log.d(TAG, "mPendingActivityResult=" + mPendingActivityResult); - mModel.dumpState(); - // TODO(hyunyoungs): add mWidgetsView.dumpState(); or mWidgetsModel.dumpState(); - - Log.d(TAG, "END launcher3 dump state"); - } - @Override public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) { super.dump(prefix, fd, writer, args); - // Dump workspace - writer.println(prefix + "Workspace Items"); - for (int i = mWorkspace.numCustomPages(); i < mWorkspace.getPageCount(); i++) { - writer.println(prefix + " Homescreen " + i); - ViewGroup layout = ((CellLayout) mWorkspace.getPageAt(i)).getShortcutsAndWidgets(); + if (args.length > 0 && TextUtils.equals(args[0], "--all")) { + writer.println(prefix + "Workspace Items"); + for (int i = mWorkspace.numCustomPages(); i < mWorkspace.getPageCount(); i++) { + writer.println(prefix + " Homescreen " + i); + + ViewGroup layout = ((CellLayout) mWorkspace.getPageAt(i)).getShortcutsAndWidgets(); + for (int j = 0; j < layout.getChildCount(); j++) { + Object tag = layout.getChildAt(j).getTag(); + if (tag != null) { + writer.println(prefix + " " + tag.toString()); + } + } + } + + writer.println(prefix + " Hotseat"); + ViewGroup layout = mHotseat.getLayout().getShortcutsAndWidgets(); for (int j = 0; j < layout.getChildCount(); j++) { Object tag = layout.getChildAt(j).getTag(); if (tag != null) { writer.println(prefix + " " + tag.toString()); } } - } - writer.println(prefix + " Hotseat"); - ViewGroup layout = mHotseat.getLayout().getShortcutsAndWidgets(); - for (int j = 0; j < layout.getChildCount(); j++) { - Object tag = layout.getChildAt(j).getTag(); - if (tag != null) { - writer.println(prefix + " " + tag.toString()); + try { + FileLog.flushAll(writer); + } catch (Exception e) { + // Ignore } } - try { - FileLog.flushAll(writer); - } catch (Exception e) { - // Ignore - } + writer.println(prefix + "Misc:"); + writer.print(prefix + "\tmWorkspaceLoading=" + mWorkspaceLoading); + writer.print(" mPendingRequestArgs=" + mPendingRequestArgs); + writer.println(" mPendingActivityResult=" + mPendingActivityResult); + + mModel.dumpState(prefix, fd, writer, args); if (mLauncherCallbacks != null) { mLauncherCallbacks.dump(prefix, fd, writer, args); |