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

Commit 9c345022 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Ignore events when there is no focused stack." into pi-dev

parents 2dacab98 0e875d36
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;