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

Commit 7337afdd authored by Will Leshner's avatar Will Leshner
Browse files

Fix a SecurityExcption when trying to start low-light dream.

A SecurityException can occur when attempting to start a dream with a
power button press when in low-light conditions. This can happen because
both a "regular" dream and the low-light dream are started at the same
time.

Test: manually by docking, covering the light sensor, and pushing the
power button to start dreaming. Low-light should start without any
crashes.

Bug: 269947573
Change-Id: Ie1fbb9fce9f34be6b86bc4738f64c871bed99e2e
parent 191007fa
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1362,6 +1362,11 @@ public class DreamService extends Service implements Window.Callback {
                if (!ActivityTaskManager.getService().startDreamActivity(i)) {
                    detach();
                }
            } catch (SecurityException e) {
                Log.w(mTag,
                        "Received SecurityException trying to start DreamActivity. "
                        + "Aborting dream start.");
                detach();
            } catch (RemoteException e) {
                Log.w(mTag, "Could not connect to activity task manager to start dream activity");
                e.rethrowFromSystemServer();