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

Commit ece5b3de authored by Kenny Guy's avatar Kenny Guy Committed by android-build-merger
Browse files

Merge "Ignore events when there is no focused stack." into pi-dev am: 9c345022

am: 7ebce228

Change-Id: I833ed13cb757be3c8727c4b72b142d8fdddbdc97
parents c7a86b14 7ebce228
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -333,8 +333,16 @@ public class BrightnessTracker {

        try {
            final ActivityManager.StackInfo focusedStack = mInjector.getFocusedStack();
            if (focusedStack != null && focusedStack.topActivity != null) {
                builder.setUserId(focusedStack.userId);
                builder.setPackageName(focusedStack.topActivity.getPackageName());
            } else {
                // Ignore the event because we can't determine user / package.
                if (DEBUG) {
                    Slog.d(TAG, "Ignoring event due to null focusedStack.");
                }
                return;
            }
        } catch (RemoteException e) {
            // Really shouldn't be possible.
            return;