Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc6caa65 authored by Nicolò Mazzucato's avatar Nicolò Mazzucato
Browse files

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
parent 091025ed
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ import android.telephony.TelephonyManager;
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 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene

    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 {