From d03328350878e48a3b6769f7bb6d6de5951eb5ff Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Wed, 1 Feb 2017 13:59:43 -0800 Subject: No warning/info log for expected/normal situations This CL hides warning and info log messages from InputMethodManagerService (IMMS) and InputMethodService (IMS) behind DEBUG flag like other logs unless the state is certainly unusual. Of course the definition of "unusual" is still an open question, but basically that we should not see any suspicious message from IMMS/IMS just by turning on a new phone, launching some applications, typing something, and turning off the device. IMMS and IMS should expect all events that can (easily) occur in that scenario, and no log is necessary for such things. Note that warnings suppressed with TODO comments will be tracked under Bug 34851776 (and Bug 34886274). Test: adb logcat -s InputMethodManagerService:* InputMethodService:* to monitor log in the following scenario: 1. Boot the device. 2. Complete the setup wizard. 3. Launch Dialer and type something on it. 4. Launch Contacts app and type something on it. 5. Try some special modes: - Turn on/off display - Recents screen - Split-window mode - Guest user - Multi user - Direct-boot (setup a device password and reboot) except for logs about actual IPC calls from a background user. Bug: 34838583 Bug: 34851776 Bug: 34886274 Change-Id: I3fcdeb919bb2f2940da9ff45e17ac00baa1253f4 --- core/java/android/inputmethodservice/InputMethodService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core/java/android/inputmethodservice/InputMethodService.java') diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index beed6e91f166..5996fe2b14a3 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -1084,8 +1084,10 @@ public class InputMethodService extends AbstractInputMethodService { final int currentHeight = mWindow.getWindow().getAttributes().height; final int newHeight = isFullscreen ? MATCH_PARENT : WRAP_CONTENT; if (mIsInputViewShown && currentHeight != newHeight) { - Log.w(TAG, "Window size has been changed. This may cause jankiness of resizing window: " - + currentHeight + " -> " + newHeight); + if (DEBUG) { + Log.w(TAG,"Window size has been changed. This may cause jankiness of resizing " + + "window: " + currentHeight + " -> " + newHeight); + } } mWindow.getWindow().setLayout(MATCH_PARENT, newHeight); } -- cgit v1.2.3