diff options
author | Siva Velusamy <vsiva@google.com> | 2011-08-02 16:18:41 -0700 |
---|---|---|
committer | Siva Velusamy <vsiva@google.com> | 2011-08-04 09:35:26 -0700 |
commit | 81e6255a2998b05465952004b6f4b4c2331270b4 (patch) | |
tree | 1dd6ccf0cbf7fcbf43b00f4e5fd4e62bee4f678d /ddms/app | |
parent | a09b6681b5850f4adca595aea25152e349fb1ef6 (diff) | |
download | sdk-81e6255a2998b05465952004b6f4b4c2331270b4.zip sdk-81e6255a2998b05465952004b6f4b4c2331270b4.tar.gz sdk-81e6255a2998b05465952004b6f4b4c2331270b4.tar.bz2 |
Conditionally create old logcat view.
As a first step towards replacing the logcat view, wrap the code that creates
and manages the current logcat view to first check which implementation to use.
The old implementation is used unless a JVM property
"com.android.ddms.useNewLogCatView" is set.
Change-Id: Idbdfcc55f0f5f28f7004b010875b89de8a4cea12
Diffstat (limited to 'ddms/app')
-rw-r--r-- | ddms/app/src/com/android/ddms/UIThread.java | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/ddms/app/src/com/android/ddms/UIThread.java b/ddms/app/src/com/android/ddms/UIThread.java index cb6786a..9931a93 100644 --- a/ddms/app/src/com/android/ddms/UIThread.java +++ b/ddms/app/src/com/android/ddms/UIThread.java @@ -221,7 +221,17 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { } - private LogPanel mLogPanel; + /** + * Flag to indicate whether to use the old or the new logcat view. This is a + * temporary workaround that will be removed once the new view is complete. + */ + private static final String USE_NEW_LOGCAT_VIEW = + System.getenv("ANDROID_USE_NEW_LOGCAT_VIEW"); + private boolean useOldLogCatView() { + return USE_NEW_LOGCAT_VIEW == null; + } + + private LogPanel mLogPanel; /* only valid when useOldLogCatView() == true */ private ToolItemAction mCreateFilterAction; private ToolItemAction mDeleteFilterAction; @@ -497,7 +507,9 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { if (!mDisplay.readAndDispatch()) mDisplay.sleep(); } - mLogPanel.stopLogCat(true); + if (useOldLogCatView()) { + mLogPanel.stopLogCat(true); + } mDevicePanel.dispose(); for (TablePanel panel : mPanels) { @@ -944,7 +956,10 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { panelArea.setLayout(new FormLayout()); createTopPanel(topPanel, darkGray); - createBottomPanel(bottomPanel); + + if (useOldLogCatView()) { + createBottomPanel(bottomPanel); + } // form layout data FormData data = new FormData(); @@ -993,7 +1008,9 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { mTableListener = new TableFocusListener(); // now set up the listener in the various panels - mLogPanel.setTableFocusListener(mTableListener); + if (useOldLogCatView()) { + mLogPanel.setTableFocusListener(mTableListener); + } mEventLogPanel.setTableFocusListener(mTableListener); for (TablePanel p : mPanels) { if (p != null) { @@ -1682,7 +1699,9 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { } mEmulatorPanel.deviceSelected(mCurrentDevice); - mLogPanel.deviceSelected(mCurrentDevice); + if (useOldLogCatView()) { + mLogPanel.deviceSelected(mCurrentDevice); + } if (mEventLogPanel != null) { mEventLogPanel.deviceSelected(mCurrentDevice); } |