Fix permission exception thrown on exit car mode.
Changing the status bar behavior requires special permission.
Since disableCarMode is called out of a context that might not have this
permission, the calling identity is cleared before changing the status
bar behavior.
diff --git a/services/java/com/android/server/DockObserver.java b/services/java/com/android/server/DockObserver.java
index f0bab81..b566fb7e 100644
--- a/services/java/com/android/server/DockObserver.java
+++ b/services/java/com/android/server/DockObserver.java
@@ -486,9 +486,11 @@
// the status bar should be totally disabled, the calls below will
// have no effect until the device is unlocked.
if (mStatusBarManager != null) {
- mStatusBarManager.disable(enabled
+ long ident = Binder.clearCallingIdentity();
+ mStatusBarManager.disable(enabled
? StatusBarManager.DISABLE_NOTIFICATION_TICKER
: StatusBarManager.DISABLE_NONE);
+ Binder.restoreCallingIdentity(ident);
}
}