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.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user