Don't log error message when default display is requested.
The `GlobalActionDialog` requests the context for the default display
many times, so it's not needed to log an error when that happens. Now,
only when a non-default display is requested and flag is off, then log
the error.
bug: None
Test: None - small bugfix
Flag: NONE - small log fix
Change-Id: I92f554ff21dec59341fd667ae360f95f9754278c
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java
index 43e7695..b90596aa 100644
--- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java
+++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java
@@ -74,6 +74,7 @@
import android.util.ArraySet;
import android.util.Log;
import android.view.ContextThemeWrapper;
+import android.view.Display;
import android.view.GestureDetector;
import android.view.IWindowManager;
import android.view.LayoutInflater;
@@ -782,9 +783,14 @@
private Context getContextForDisplay(int displayId) {
if (!ShadeWindowGoesAround.isEnabled()) {
- Log.e(TAG, "Asked for the displayId=" + displayId
- + " context but returning default display one as ShadeWindowGoesAround flag "
- + "is disabled.");
+ if (displayId != Display.DEFAULT_DISPLAY) {
+ Log.e(
+ TAG,
+ "Asked for the displayId="
+ + displayId
+ + " context but returning default display one as"
+ + " ShadeWindowGoesAround flag is disabled.");
+ }
return mContext;
}
try {