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:
Tobias Haamel
2010-02-25 11:05:12 +01:00
parent 74f39d4c17
commit a712dcec1c

View File

@@ -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();