Merge "Make it configurable whether to start dream immediately on docking (when keyguard is unlocked)." into tm-dev am: 23b8a6d640 am: e13d336e72
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17513712 Change-Id: Ic91070726b4527cd2ef7ac52b0ea49ee38f0cb10 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -690,6 +690,11 @@
|
|||||||
will apply, regardless of device state. -->
|
will apply, regardless of device state. -->
|
||||||
<string-array name="config_perDeviceStateRotationLockDefaults" />
|
<string-array name="config_perDeviceStateRotationLockDefaults" />
|
||||||
|
|
||||||
|
<!-- Dock behavior -->
|
||||||
|
|
||||||
|
<!-- Control whether to start dream immediately upon docking even if the lockscreen is unlocked.
|
||||||
|
This defaults to true to be consistent with historical behavior. -->
|
||||||
|
<bool name="config_startDreamImmediatelyOnDock">true</bool>
|
||||||
|
|
||||||
<!-- Desk dock behavior -->
|
<!-- Desk dock behavior -->
|
||||||
|
|
||||||
|
|||||||
@@ -1732,6 +1732,7 @@
|
|||||||
<java-symbol type="attr" name="dialogTitleIconsDecorLayout" />
|
<java-symbol type="attr" name="dialogTitleIconsDecorLayout" />
|
||||||
<java-symbol type="bool" name="config_allowAllRotations" />
|
<java-symbol type="bool" name="config_allowAllRotations" />
|
||||||
<java-symbol type="bool" name="config_annoy_dianne" />
|
<java-symbol type="bool" name="config_annoy_dianne" />
|
||||||
|
<java-symbol type="bool" name="config_startDreamImmediatelyOnDock" />
|
||||||
<java-symbol type="bool" name="config_carDockEnablesAccelerometer" />
|
<java-symbol type="bool" name="config_carDockEnablesAccelerometer" />
|
||||||
<java-symbol type="bool" name="config_customUserSwitchUi" />
|
<java-symbol type="bool" name="config_customUserSwitchUi" />
|
||||||
<java-symbol type="bool" name="config_deskDockEnablesAccelerometer" />
|
<java-symbol type="bool" name="config_deskDockEnablesAccelerometer" />
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import android.app.ActivityTaskManager;
|
|||||||
import android.app.AlarmManager;
|
import android.app.AlarmManager;
|
||||||
import android.app.IOnProjectionStateChangedListener;
|
import android.app.IOnProjectionStateChangedListener;
|
||||||
import android.app.IUiModeManager;
|
import android.app.IUiModeManager;
|
||||||
|
import android.app.KeyguardManager;
|
||||||
import android.app.Notification;
|
import android.app.Notification;
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
@@ -149,6 +150,8 @@ final class UiModeManagerService extends SystemService {
|
|||||||
private int mCarModeEnableFlags;
|
private int mCarModeEnableFlags;
|
||||||
private boolean mSetupWizardComplete;
|
private boolean mSetupWizardComplete;
|
||||||
|
|
||||||
|
// flag set by resource, whether to start dream immediately upon docking even if unlocked.
|
||||||
|
private boolean mStartDreamImmediatelyOnDock = true;
|
||||||
// flag set by resource, whether to enable Car dock launch when starting car mode.
|
// flag set by resource, whether to enable Car dock launch when starting car mode.
|
||||||
private boolean mEnableCarDockLaunch = true;
|
private boolean mEnableCarDockLaunch = true;
|
||||||
// flag set by resource, whether to lock UI mode to the default one or not.
|
// flag set by resource, whether to lock UI mode to the default one or not.
|
||||||
@@ -173,6 +176,7 @@ final class UiModeManagerService extends SystemService {
|
|||||||
private ActivityTaskManagerInternal mActivityTaskManager;
|
private ActivityTaskManagerInternal mActivityTaskManager;
|
||||||
private AlarmManager mAlarmManager;
|
private AlarmManager mAlarmManager;
|
||||||
private PowerManager mPowerManager;
|
private PowerManager mPowerManager;
|
||||||
|
private KeyguardManager mKeyguardManager;
|
||||||
|
|
||||||
// In automatic scheduling, the user is able
|
// In automatic scheduling, the user is able
|
||||||
// to override the computed night mode until the two match
|
// to override the computed night mode until the two match
|
||||||
@@ -374,6 +378,7 @@ final class UiModeManagerService extends SystemService {
|
|||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
final Context context = getContext();
|
final Context context = getContext();
|
||||||
mSystemReady = true;
|
mSystemReady = true;
|
||||||
|
mKeyguardManager = context.getSystemService(KeyguardManager.class);
|
||||||
mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
||||||
mWakeLock = mPowerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK, TAG);
|
mWakeLock = mPowerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK, TAG);
|
||||||
mWindowManager = LocalServices.getService(WindowManagerInternal.class);
|
mWindowManager = LocalServices.getService(WindowManagerInternal.class);
|
||||||
@@ -412,6 +417,8 @@ final class UiModeManagerService extends SystemService {
|
|||||||
verifySetupWizardCompleted();
|
verifySetupWizardCompleted();
|
||||||
|
|
||||||
final Resources res = context.getResources();
|
final Resources res = context.getResources();
|
||||||
|
mStartDreamImmediatelyOnDock = res.getBoolean(
|
||||||
|
com.android.internal.R.bool.config_startDreamImmediatelyOnDock);
|
||||||
mNightMode = res.getInteger(
|
mNightMode = res.getInteger(
|
||||||
com.android.internal.R.integer.config_defaultNightMode);
|
com.android.internal.R.integer.config_defaultNightMode);
|
||||||
mDefaultUiModeType = res.getInteger(
|
mDefaultUiModeType = res.getInteger(
|
||||||
@@ -1294,6 +1301,8 @@ final class UiModeManagerService extends SystemService {
|
|||||||
pw.print(" mDockState="); pw.print(mDockState);
|
pw.print(" mDockState="); pw.print(mDockState);
|
||||||
pw.print(" mLastBroadcastState="); pw.println(mLastBroadcastState);
|
pw.print(" mLastBroadcastState="); pw.println(mLastBroadcastState);
|
||||||
|
|
||||||
|
pw.print(" mStartDreamImmediatelyOnDock="); pw.print(mStartDreamImmediatelyOnDock);
|
||||||
|
|
||||||
pw.print(" mNightMode="); pw.print(mNightMode); pw.print(" (");
|
pw.print(" mNightMode="); pw.print(mNightMode); pw.print(" (");
|
||||||
pw.print(Shell.nightModeToStr(mNightMode, mNightModeCustomType)); pw.print(") ");
|
pw.print(Shell.nightModeToStr(mNightMode, mNightModeCustomType)); pw.print(") ");
|
||||||
pw.print(" mOverrideOn/Off="); pw.print(mOverrideNightModeOn);
|
pw.print(" mOverrideOn/Off="); pw.print(mOverrideNightModeOn);
|
||||||
@@ -1803,8 +1812,9 @@ final class UiModeManagerService extends SystemService {
|
|||||||
// Send the new configuration.
|
// Send the new configuration.
|
||||||
applyConfigurationExternallyLocked();
|
applyConfigurationExternallyLocked();
|
||||||
|
|
||||||
// If we did not start a dock app, then start dreaming if supported.
|
// If we did not start a dock app, then start dreaming if appropriate.
|
||||||
if (category != null && !dockAppStarted) {
|
if (category != null && !dockAppStarted && (mStartDreamImmediatelyOnDock
|
||||||
|
|| mKeyguardManager.isKeyguardLocked())) {
|
||||||
Sandman.startDreamWhenDockedIfAppropriate(getContext());
|
Sandman.startDreamWhenDockedIfAppropriate(getContext());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user