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

Commit a712dcec authored by Tobias Haamel's avatar Tobias Haamel
Browse files

Init car mode when phone is booted in a dock.

When the device is booted in a car dock the car mode needs to be set
as well, so that the status bar notification shows up and the system
is initialized the same way as if the phone is placed into a car dock
when it's booted already.
parent 74f39d4c
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -305,6 +305,14 @@ class DockObserver extends UEventObserver {
                    (KeyguardManager)mContext.getSystemService(Context.KEYGUARD_SERVICE);
            mKeyguardLock = keyguardManager.newKeyguardLock(TAG);

            final boolean enableCarMode = mDockState == Intent.EXTRA_DOCK_STATE_CAR;
            if (enableCarMode) {
                try {
                    setCarMode(enableCarMode);
                } catch (RemoteException e) {
                    Log.w(TAG, "Unable to change car mode.", e);
                }
            }
            // don't bother broadcasting undocked here
            if (mDockState != Intent.EXTRA_DOCK_STATE_UNDOCKED) {
                update();