diff options
Diffstat (limited to 'services/java/com/android/server/SystemServer.java')
| -rw-r--r-- | services/java/com/android/server/SystemServer.java | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index a2d8355..9decd62 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -160,6 +160,7 @@ class ServerThread extends Thread { WindowManagerService wm = null; BluetoothManagerService bluetooth = null; DockObserver dock = null; + RotationSwitchObserver rotateSwitch = null; UsbService usb = null; SerialService serial = null; TwilightService twilight = null; @@ -360,6 +361,9 @@ class ServerThread extends Thread { Slog.e("System", "************ Failure starting core service", e); } + boolean hasRotationLock = context.getResources().getBoolean(com.android + .internal.R.bool.config_hasRotationLockSwitch); + DevicePolicyManagerService devicePolicy = null; StatusBarManagerService statusBar = null; InputMethodManagerService imm = null; @@ -659,7 +663,17 @@ class ServerThread extends Thread { } try { - Slog.i(TAG, "Wired Accessory Manager"); + if (hasRotationLock) { + Slog.i(TAG, "Rotation Switch Observer"); + // Listen for switch changes + rotateSwitch = new RotationSwitchObserver(context); + } + } catch (Throwable e) { + reportWtf("starting RotationSwitchObserver", e); + } + + try { + Slog.i(TAG, "Wired Accessory Observer"); // Listen for wired headset changes inputManager.setWiredAccessoryCallbacks( new WiredAccessoryManager(context, inputManager)); @@ -892,6 +906,7 @@ class ServerThread extends Thread { final NetworkPolicyManagerService networkPolicyF = networkPolicy; final ConnectivityService connectivityF = connectivity; final DockObserver dockF = dock; + final RotationSwitchObserver rotateSwitchF = rotateSwitch; final UsbService usbF = usb; final ThrottleService throttleF = throttle; final TwilightService twilightF = twilight; @@ -956,6 +971,11 @@ class ServerThread extends Thread { reportWtf("making Dock Service ready", e); } try { + if (rotateSwitchF != null) rotateSwitchF.systemReady(); + } catch (Throwable e) { + reportWtf("making Rotation Switch Service ready", e); + } + try { if (usbF != null) usbF.systemReady(); } catch (Throwable e) { reportWtf("making USB Service ready", e); |
