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

Commit 7ebce228 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

Change-Id: I281142563c53e0b40b2784272dffedfc65a0dfb0
parents 168a7723 9c345022
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;