PageRenderTime 114ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 1ms

/frameworks/base/services/java/com/android/server/UiModeManagerService.java

https://gitlab.com/brian0218/rk3066_r-box_android4.2.2_sdk
Java | 608 lines | 482 code | 72 blank | 54 comment | 114 complexity | fb96507ec4a3bedf5bf0756371c5d45b MD5 | raw file
  1. /*
  2. * Copyright (C) 2008 The Android Open Source Project
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.android.server;
  17. import android.app.Activity;
  18. import android.app.ActivityManager;
  19. import android.app.ActivityManagerNative;
  20. import android.app.IUiModeManager;
  21. import android.app.Notification;
  22. import android.app.NotificationManager;
  23. import android.app.PendingIntent;
  24. import android.app.StatusBarManager;
  25. import android.app.UiModeManager;
  26. import android.content.BroadcastReceiver;
  27. import android.content.Context;
  28. import android.content.Intent;
  29. import android.content.IntentFilter;
  30. import android.content.pm.PackageManager;
  31. import android.content.res.Configuration;
  32. import android.os.BatteryManager;
  33. import android.os.Binder;
  34. import android.os.Handler;
  35. import android.os.PowerManager;
  36. import android.os.RemoteException;
  37. import android.os.ServiceManager;
  38. import android.os.UserHandle;
  39. import android.provider.Settings;
  40. import android.service.dreams.Sandman;
  41. import android.util.Slog;
  42. import java.io.FileDescriptor;
  43. import java.io.PrintWriter;
  44. import com.android.internal.R;
  45. import com.android.internal.app.DisableCarModeActivity;
  46. import com.android.server.TwilightService.TwilightState;
  47. final class UiModeManagerService extends IUiModeManager.Stub {
  48. private static final String TAG = UiModeManager.class.getSimpleName();
  49. private static final boolean LOG = false;
  50. // Enable launching of applications when entering the dock.
  51. private static final boolean ENABLE_LAUNCH_CAR_DOCK_APP = true;
  52. private static final boolean ENABLE_LAUNCH_DESK_DOCK_APP = true;
  53. private final Context mContext;
  54. private final TwilightService mTwilightService;
  55. private final Handler mHandler = new Handler();
  56. final Object mLock = new Object();
  57. private int mDockState = Intent.EXTRA_DOCK_STATE_UNDOCKED;
  58. private int mLastBroadcastState = Intent.EXTRA_DOCK_STATE_UNDOCKED;
  59. private int mNightMode = UiModeManager.MODE_NIGHT_NO;
  60. private boolean mCarModeEnabled = false;
  61. private boolean mCharging = false;
  62. private final int mDefaultUiModeType;
  63. private final boolean mCarModeKeepsScreenOn;
  64. private final boolean mDeskModeKeepsScreenOn;
  65. private final boolean mTelevision;
  66. private boolean mComputedNightMode;
  67. private int mCurUiMode = 0;
  68. private int mSetUiMode = 0;
  69. private boolean mHoldingConfiguration = false;
  70. private Configuration mConfiguration = new Configuration();
  71. private boolean mSystemReady;
  72. private NotificationManager mNotificationManager;
  73. private StatusBarManager mStatusBarManager;
  74. private final PowerManager mPowerManager;
  75. private final PowerManager.WakeLock mWakeLock;
  76. static Intent buildHomeIntent(String category) {
  77. Intent intent = new Intent(Intent.ACTION_MAIN);
  78. intent.addCategory(category);
  79. intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
  80. | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
  81. return intent;
  82. }
  83. // The broadcast receiver which receives the result of the ordered broadcast sent when
  84. // the dock state changes. The original ordered broadcast is sent with an initial result
  85. // code of RESULT_OK. If any of the registered broadcast receivers changes this value, e.g.,
  86. // to RESULT_CANCELED, then the intent to start a dock app will not be sent.
  87. private final BroadcastReceiver mResultReceiver = new BroadcastReceiver() {
  88. @Override
  89. public void onReceive(Context context, Intent intent) {
  90. if (getResultCode() != Activity.RESULT_OK) {
  91. if (LOG) {
  92. Slog.v(TAG, "Handling broadcast result for action " + intent.getAction()
  93. + ": canceled: " + getResultCode());
  94. }
  95. return;
  96. }
  97. final int enableFlags = intent.getIntExtra("enableFlags", 0);
  98. final int disableFlags = intent.getIntExtra("disableFlags", 0);
  99. synchronized (mLock) {
  100. updateAfterBroadcastLocked(intent.getAction(), enableFlags, disableFlags);
  101. }
  102. }
  103. };
  104. private final BroadcastReceiver mDockModeReceiver = new BroadcastReceiver() {
  105. @Override
  106. public void onReceive(Context context, Intent intent) {
  107. int state = intent.getIntExtra(Intent.EXTRA_DOCK_STATE,
  108. Intent.EXTRA_DOCK_STATE_UNDOCKED);
  109. updateDockState(state);
  110. }
  111. };
  112. private final BroadcastReceiver mBatteryReceiver = new BroadcastReceiver() {
  113. @Override
  114. public void onReceive(Context context, Intent intent) {
  115. mCharging = (intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0) != 0);
  116. synchronized (mLock) {
  117. if (mSystemReady) {
  118. updateLocked(0, 0);
  119. }
  120. }
  121. }
  122. };
  123. private final TwilightService.TwilightListener mTwilightListener =
  124. new TwilightService.TwilightListener() {
  125. @Override
  126. public void onTwilightStateChanged() {
  127. updateTwilight();
  128. }
  129. };
  130. public UiModeManagerService(Context context, TwilightService twilight) {
  131. mContext = context;
  132. mTwilightService = twilight;
  133. ServiceManager.addService(Context.UI_MODE_SERVICE, this);
  134. mContext.registerReceiver(mDockModeReceiver,
  135. new IntentFilter(Intent.ACTION_DOCK_EVENT));
  136. mContext.registerReceiver(mBatteryReceiver,
  137. new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
  138. mPowerManager = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
  139. mWakeLock = mPowerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK, TAG);
  140. mConfiguration.setToDefaults();
  141. mDefaultUiModeType = context.getResources().getInteger(
  142. com.android.internal.R.integer.config_defaultUiModeType);
  143. mCarModeKeepsScreenOn = (context.getResources().getInteger(
  144. com.android.internal.R.integer.config_carDockKeepsScreenOn) == 1);
  145. mDeskModeKeepsScreenOn = (context.getResources().getInteger(
  146. com.android.internal.R.integer.config_deskDockKeepsScreenOn) == 1);
  147. mTelevision = context.getPackageManager().hasSystemFeature(
  148. PackageManager.FEATURE_TELEVISION);
  149. mNightMode = Settings.Secure.getInt(mContext.getContentResolver(),
  150. Settings.Secure.UI_NIGHT_MODE, UiModeManager.MODE_NIGHT_AUTO);
  151. mTwilightService.registerListener(mTwilightListener, mHandler);
  152. }
  153. @Override // Binder call
  154. public void disableCarMode(int flags) {
  155. final long ident = Binder.clearCallingIdentity();
  156. try {
  157. synchronized (mLock) {
  158. setCarModeLocked(false);
  159. if (mSystemReady) {
  160. updateLocked(0, flags);
  161. }
  162. }
  163. } finally {
  164. Binder.restoreCallingIdentity(ident);
  165. }
  166. }
  167. @Override // Binder call
  168. public void enableCarMode(int flags) {
  169. final long ident = Binder.clearCallingIdentity();
  170. try {
  171. synchronized (mLock) {
  172. setCarModeLocked(true);
  173. if (mSystemReady) {
  174. updateLocked(flags, 0);
  175. }
  176. }
  177. } finally {
  178. Binder.restoreCallingIdentity(ident);
  179. }
  180. }
  181. @Override // Binder call
  182. public int getCurrentModeType() {
  183. final long ident = Binder.clearCallingIdentity();
  184. try {
  185. synchronized (mLock) {
  186. return mCurUiMode & Configuration.UI_MODE_TYPE_MASK;
  187. }
  188. } finally {
  189. Binder.restoreCallingIdentity(ident);
  190. }
  191. }
  192. @Override // Binder call
  193. public void setNightMode(int mode) {
  194. switch (mode) {
  195. case UiModeManager.MODE_NIGHT_NO:
  196. case UiModeManager.MODE_NIGHT_YES:
  197. case UiModeManager.MODE_NIGHT_AUTO:
  198. break;
  199. default:
  200. throw new IllegalArgumentException("Unknown mode: " + mode);
  201. }
  202. final long ident = Binder.clearCallingIdentity();
  203. try {
  204. synchronized (mLock) {
  205. if (isDoingNightModeLocked() && mNightMode != mode) {
  206. Settings.Secure.putInt(mContext.getContentResolver(),
  207. Settings.Secure.UI_NIGHT_MODE, mode);
  208. mNightMode = mode;
  209. updateLocked(0, 0);
  210. }
  211. }
  212. } finally {
  213. Binder.restoreCallingIdentity(ident);
  214. }
  215. }
  216. @Override // Binder call
  217. public int getNightMode() {
  218. synchronized (mLock) {
  219. return mNightMode;
  220. }
  221. }
  222. void systemReady() {
  223. synchronized (mLock) {
  224. mSystemReady = true;
  225. mCarModeEnabled = mDockState == Intent.EXTRA_DOCK_STATE_CAR;
  226. updateComputedNightModeLocked();
  227. updateLocked(0, 0);
  228. }
  229. }
  230. private boolean isDoingNightModeLocked() {
  231. return mCarModeEnabled || mDockState != Intent.EXTRA_DOCK_STATE_UNDOCKED;
  232. }
  233. private void setCarModeLocked(boolean enabled) {
  234. if (mCarModeEnabled != enabled) {
  235. mCarModeEnabled = enabled;
  236. }
  237. }
  238. private void updateDockState(int newState) {
  239. synchronized (mLock) {
  240. if (newState != mDockState) {
  241. mDockState = newState;
  242. setCarModeLocked(mDockState == Intent.EXTRA_DOCK_STATE_CAR);
  243. if (mSystemReady) {
  244. updateLocked(UiModeManager.ENABLE_CAR_MODE_GO_CAR_HOME, 0);
  245. }
  246. }
  247. }
  248. }
  249. private static boolean isDeskDockState(int state) {
  250. switch (state) {
  251. case Intent.EXTRA_DOCK_STATE_DESK:
  252. case Intent.EXTRA_DOCK_STATE_LE_DESK:
  253. case Intent.EXTRA_DOCK_STATE_HE_DESK:
  254. return true;
  255. default:
  256. return false;
  257. }
  258. }
  259. private void updateConfigurationLocked() {
  260. int uiMode = mTelevision ? Configuration.UI_MODE_TYPE_TELEVISION : mDefaultUiModeType;
  261. if (mCarModeEnabled) {
  262. uiMode = Configuration.UI_MODE_TYPE_CAR;
  263. } else if (isDeskDockState(mDockState)) {
  264. uiMode = Configuration.UI_MODE_TYPE_DESK;
  265. }
  266. if (mCarModeEnabled) {
  267. if (mNightMode == UiModeManager.MODE_NIGHT_AUTO) {
  268. updateComputedNightModeLocked();
  269. uiMode |= mComputedNightMode ? Configuration.UI_MODE_NIGHT_YES
  270. : Configuration.UI_MODE_NIGHT_NO;
  271. } else {
  272. uiMode |= mNightMode << 4;
  273. }
  274. } else {
  275. // Disabling the car mode clears the night mode.
  276. uiMode = (uiMode & ~Configuration.UI_MODE_NIGHT_MASK) | Configuration.UI_MODE_NIGHT_NO;
  277. }
  278. if (LOG) {
  279. Slog.d(TAG,
  280. "updateConfigurationLocked: mDockState=" + mDockState
  281. + "; mCarMode=" + mCarModeEnabled
  282. + "; mNightMode=" + mNightMode
  283. + "; uiMode=" + uiMode);
  284. }
  285. mCurUiMode = uiMode;
  286. if (!mHoldingConfiguration) {
  287. mConfiguration.uiMode = uiMode;
  288. }
  289. }
  290. private void sendConfigurationLocked() {
  291. if (mSetUiMode != mConfiguration.uiMode) {
  292. mSetUiMode = mConfiguration.uiMode;
  293. try {
  294. ActivityManagerNative.getDefault().updateConfiguration(mConfiguration);
  295. } catch (RemoteException e) {
  296. Slog.w(TAG, "Failure communicating with activity manager", e);
  297. }
  298. }
  299. }
  300. private void updateLocked(int enableFlags, int disableFlags) {
  301. String action = null;
  302. String oldAction = null;
  303. if (mLastBroadcastState == Intent.EXTRA_DOCK_STATE_CAR) {
  304. adjustStatusBarCarModeLocked();
  305. oldAction = UiModeManager.ACTION_EXIT_CAR_MODE;
  306. } else if (isDeskDockState(mLastBroadcastState)) {
  307. oldAction = UiModeManager.ACTION_EXIT_DESK_MODE;
  308. }
  309. if (mCarModeEnabled) {
  310. if (mLastBroadcastState != Intent.EXTRA_DOCK_STATE_CAR) {
  311. adjustStatusBarCarModeLocked();
  312. if (oldAction != null) {
  313. mContext.sendBroadcastAsUser(new Intent(oldAction), UserHandle.ALL);
  314. }
  315. mLastBroadcastState = Intent.EXTRA_DOCK_STATE_CAR;
  316. action = UiModeManager.ACTION_ENTER_CAR_MODE;
  317. }
  318. } else if (isDeskDockState(mDockState)) {
  319. if (!isDeskDockState(mLastBroadcastState)) {
  320. if (oldAction != null) {
  321. mContext.sendBroadcastAsUser(new Intent(oldAction), UserHandle.ALL);
  322. }
  323. mLastBroadcastState = mDockState;
  324. action = UiModeManager.ACTION_ENTER_DESK_MODE;
  325. }
  326. } else {
  327. mLastBroadcastState = Intent.EXTRA_DOCK_STATE_UNDOCKED;
  328. action = oldAction;
  329. }
  330. if (action != null) {
  331. if (LOG) {
  332. Slog.v(TAG, String.format(
  333. "updateLocked: preparing broadcast: action=%s enable=0x%08x disable=0x%08x",
  334. action, enableFlags, disableFlags));
  335. }
  336. // Send the ordered broadcast; the result receiver will receive after all
  337. // broadcasts have been sent. If any broadcast receiver changes the result
  338. // code from the initial value of RESULT_OK, then the result receiver will
  339. // not launch the corresponding dock application. This gives apps a chance
  340. // to override the behavior and stay in their app even when the device is
  341. // placed into a dock.
  342. Intent intent = new Intent(action);
  343. intent.putExtra("enableFlags", enableFlags);
  344. intent.putExtra("disableFlags", disableFlags);
  345. mContext.sendOrderedBroadcastAsUser(intent, UserHandle.CURRENT, null,
  346. mResultReceiver, null, Activity.RESULT_OK, null, null);
  347. // Attempting to make this transition a little more clean, we are going
  348. // to hold off on doing a configuration change until we have finished
  349. // the broadcast and started the home activity.
  350. mHoldingConfiguration = true;
  351. updateConfigurationLocked();
  352. } else {
  353. String category = null;
  354. if (mCarModeEnabled) {
  355. if (ENABLE_LAUNCH_CAR_DOCK_APP
  356. && (enableFlags & UiModeManager.ENABLE_CAR_MODE_GO_CAR_HOME) != 0) {
  357. category = Intent.CATEGORY_CAR_DOCK;
  358. }
  359. } else if (isDeskDockState(mDockState)) {
  360. if (ENABLE_LAUNCH_DESK_DOCK_APP
  361. && (enableFlags & UiModeManager.ENABLE_CAR_MODE_GO_CAR_HOME) != 0) {
  362. category = Intent.CATEGORY_DESK_DOCK;
  363. }
  364. } else {
  365. if ((disableFlags & UiModeManager.DISABLE_CAR_MODE_GO_HOME) != 0) {
  366. category = Intent.CATEGORY_HOME;
  367. }
  368. }
  369. if (LOG) {
  370. Slog.v(TAG, "updateLocked: null action, mDockState="
  371. + mDockState +", category=" + category);
  372. }
  373. sendConfigurationAndStartDreamOrDockAppLocked(category);
  374. }
  375. // keep screen on when charging and in car mode
  376. boolean keepScreenOn = mCharging &&
  377. ((mCarModeEnabled && mCarModeKeepsScreenOn) ||
  378. (mCurUiMode == Configuration.UI_MODE_TYPE_DESK && mDeskModeKeepsScreenOn));
  379. if (keepScreenOn != mWakeLock.isHeld()) {
  380. if (keepScreenOn) {
  381. mWakeLock.acquire();
  382. } else {
  383. mWakeLock.release();
  384. }
  385. }
  386. }
  387. private void updateAfterBroadcastLocked(String action, int enableFlags, int disableFlags) {
  388. // Launch a dock activity
  389. String category = null;
  390. if (UiModeManager.ACTION_ENTER_CAR_MODE.equals(action)) {
  391. // Only launch car home when car mode is enabled and the caller
  392. // has asked us to switch to it.
  393. if (ENABLE_LAUNCH_CAR_DOCK_APP
  394. && (enableFlags & UiModeManager.ENABLE_CAR_MODE_GO_CAR_HOME) != 0) {
  395. category = Intent.CATEGORY_CAR_DOCK;
  396. }
  397. } else if (UiModeManager.ACTION_ENTER_DESK_MODE.equals(action)) {
  398. // Only launch car home when desk mode is enabled and the caller
  399. // has asked us to switch to it. Currently re-using the car
  400. // mode flag since we don't have a formal API for "desk mode".
  401. if (ENABLE_LAUNCH_DESK_DOCK_APP
  402. && (enableFlags & UiModeManager.ENABLE_CAR_MODE_GO_CAR_HOME) != 0) {
  403. category = Intent.CATEGORY_DESK_DOCK;
  404. }
  405. } else {
  406. // Launch the standard home app if requested.
  407. if ((disableFlags & UiModeManager.DISABLE_CAR_MODE_GO_HOME) != 0) {
  408. category = Intent.CATEGORY_HOME;
  409. }
  410. }
  411. if (LOG) {
  412. Slog.v(TAG, String.format(
  413. "Handling broadcast result for action %s: enable=0x%08x, disable=0x%08x, "
  414. + "category=%s",
  415. action, enableFlags, disableFlags, category));
  416. }
  417. sendConfigurationAndStartDreamOrDockAppLocked(category);
  418. }
  419. private void sendConfigurationAndStartDreamOrDockAppLocked(String category) {
  420. // Update the configuration but don't send it yet.
  421. mHoldingConfiguration = false;
  422. updateConfigurationLocked();
  423. // Start the dock app, if there is one.
  424. boolean dockAppStarted = false;
  425. if (category != null) {
  426. // Now we are going to be careful about switching the
  427. // configuration and starting the activity -- we need to
  428. // do this in a specific order under control of the
  429. // activity manager, to do it cleanly. So compute the
  430. // new config, but don't set it yet, and let the
  431. // activity manager take care of both the start and config
  432. // change.
  433. Intent homeIntent = buildHomeIntent(category);
  434. if (Sandman.shouldStartDockApp(mContext, homeIntent)) {
  435. try {
  436. int result = ActivityManagerNative.getDefault().startActivityWithConfig(
  437. null, homeIntent, null, null, null, 0, 0,
  438. mConfiguration, null, UserHandle.USER_CURRENT);
  439. if (result >= ActivityManager.START_SUCCESS) {
  440. dockAppStarted = true;
  441. } else if (result != ActivityManager.START_INTENT_NOT_RESOLVED) {
  442. Slog.e(TAG, "Could not start dock app: " + homeIntent
  443. + ", startActivityWithConfig result " + result);
  444. }
  445. } catch (RemoteException ex) {
  446. Slog.e(TAG, "Could not start dock app: " + homeIntent, ex);
  447. }
  448. }
  449. }
  450. // Send the new configuration.
  451. sendConfigurationLocked();
  452. // If we did not start a dock app, then start dreaming if supported.
  453. if (category != null && !dockAppStarted) {
  454. Sandman.startDreamWhenDockedIfAppropriate(mContext);
  455. }
  456. }
  457. private void adjustStatusBarCarModeLocked() {
  458. if (mStatusBarManager == null) {
  459. mStatusBarManager = (StatusBarManager)
  460. mContext.getSystemService(Context.STATUS_BAR_SERVICE);
  461. }
  462. // Fear not: StatusBarManagerService manages a list of requests to disable
  463. // features of the status bar; these are ORed together to form the
  464. // active disabled list. So if (for example) the device is locked and
  465. // the status bar should be totally disabled, the calls below will
  466. // have no effect until the device is unlocked.
  467. if (mStatusBarManager != null) {
  468. mStatusBarManager.disable(mCarModeEnabled
  469. ? StatusBarManager.DISABLE_NOTIFICATION_TICKER
  470. : StatusBarManager.DISABLE_NONE);
  471. }
  472. if (mNotificationManager == null) {
  473. mNotificationManager = (NotificationManager)
  474. mContext.getSystemService(Context.NOTIFICATION_SERVICE);
  475. }
  476. if (mNotificationManager != null) {
  477. if (mCarModeEnabled) {
  478. Intent carModeOffIntent = new Intent(mContext, DisableCarModeActivity.class);
  479. Notification n = new Notification();
  480. n.icon = R.drawable.stat_notify_car_mode;
  481. n.defaults = Notification.DEFAULT_LIGHTS;
  482. n.flags = Notification.FLAG_ONGOING_EVENT;
  483. n.when = 0;
  484. n.setLatestEventInfo(
  485. mContext,
  486. mContext.getString(R.string.car_mode_disable_notification_title),
  487. mContext.getString(R.string.car_mode_disable_notification_message),
  488. PendingIntent.getActivityAsUser(mContext, 0, carModeOffIntent, 0,
  489. null, UserHandle.CURRENT));
  490. mNotificationManager.notifyAsUser(null,
  491. R.string.car_mode_disable_notification_title, n, UserHandle.ALL);
  492. } else {
  493. mNotificationManager.cancelAsUser(null,
  494. R.string.car_mode_disable_notification_title, UserHandle.ALL);
  495. }
  496. }
  497. }
  498. private void updateTwilight() {
  499. synchronized (mLock) {
  500. if (isDoingNightModeLocked() && mNightMode == UiModeManager.MODE_NIGHT_AUTO) {
  501. updateComputedNightModeLocked();
  502. updateLocked(0, 0);
  503. }
  504. }
  505. }
  506. private void updateComputedNightModeLocked() {
  507. TwilightState state = mTwilightService.getCurrentState();
  508. if (state != null) {
  509. mComputedNightMode = state.isNight();
  510. }
  511. }
  512. @Override
  513. protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
  514. if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP)
  515. != PackageManager.PERMISSION_GRANTED) {
  516. pw.println("Permission Denial: can't dump uimode service from from pid="
  517. + Binder.getCallingPid()
  518. + ", uid=" + Binder.getCallingUid());
  519. return;
  520. }
  521. synchronized (mLock) {
  522. pw.println("Current UI Mode Service state:");
  523. pw.print(" mDockState="); pw.print(mDockState);
  524. pw.print(" mLastBroadcastState="); pw.println(mLastBroadcastState);
  525. pw.print(" mNightMode="); pw.print(mNightMode);
  526. pw.print(" mCarModeEnabled="); pw.print(mCarModeEnabled);
  527. pw.print(" mComputedNightMode="); pw.println(mComputedNightMode);
  528. pw.print(" mCurUiMode=0x"); pw.print(Integer.toHexString(mCurUiMode));
  529. pw.print(" mSetUiMode=0x"); pw.println(Integer.toHexString(mSetUiMode));
  530. pw.print(" mHoldingConfiguration="); pw.print(mHoldingConfiguration);
  531. pw.print(" mSystemReady="); pw.println(mSystemReady);
  532. pw.print(" mTwilightService.getCurrentState()=");
  533. pw.println(mTwilightService.getCurrentState());
  534. }
  535. }
  536. }