Loading core/res/res/values/config.xml +5 −0 Original line number Diff line number Diff line Loading @@ -815,6 +815,11 @@ we rely on gravity to determine the effective orientation. --> <bool name="config_deskDockEnablesAccelerometer">true</bool> <!-- Control for allowing the dock rotation functionality before provision like when the SetupWizard is being shown to the user. This defaults to false to preserve existing behavior. --> <bool name="config_allowDockBeforeProvision">false</bool> <!-- Car dock behavior --> <!-- The number of degrees to rotate the display when the device is in a car dock. Loading core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1797,6 +1797,7 @@ <java-symbol type="bool" name="config_customUserSwitchUi" /> <java-symbol type="bool" name="config_canRemoveFirstAccount" /> <java-symbol type="string" name="config_accountTypeToKeepFirstAccount" /> <java-symbol type="bool" name="config_allowDockBeforeProvision" /> <java-symbol type="bool" name="config_deskDockEnablesAccelerometer" /> <java-symbol type="bool" name="config_disableMenuKeyInLockScreen" /> <java-symbol type="bool" name="config_enableCarDockHomeLaunch" /> Loading services/core/java/com/android/server/DockObserver.java +14 −4 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.server; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.database.ContentObserver; import android.media.AudioManager; import android.media.Ringtone; Loading @@ -35,6 +36,7 @@ import android.provider.Settings; import android.util.Pair; import android.util.Slog; import com.android.internal.R; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.DumpUtils; import com.android.internal.util.FrameworkStatsLog; Loading Loading @@ -259,12 +261,20 @@ final class DockObserver extends SystemService { + mReportedDockState); final int previousDockState = mPreviousDockState; mPreviousDockState = mReportedDockState; // Skip the dock intent if not yet provisioned. final ContentResolver cr = getContext().getContentResolver(); /// If the allow dock rotation before provision is enabled then we allow rotation. final Resources r = getContext().getResources(); final boolean allowDockBeforeProvision = r.getBoolean(R.bool.config_allowDockBeforeProvision); if (!allowDockBeforeProvision) { // Skip the dock intent if not yet provisioned. if (!mDeviceProvisionedObserver.isDeviceProvisioned()) { Slog.i(TAG, "Device not provisioned, skipping dock broadcast"); return; } } // Pack up the values and broadcast them to everyone Intent intent = new Intent(Intent.ACTION_DOCK_EVENT); Loading Loading
core/res/res/values/config.xml +5 −0 Original line number Diff line number Diff line Loading @@ -815,6 +815,11 @@ we rely on gravity to determine the effective orientation. --> <bool name="config_deskDockEnablesAccelerometer">true</bool> <!-- Control for allowing the dock rotation functionality before provision like when the SetupWizard is being shown to the user. This defaults to false to preserve existing behavior. --> <bool name="config_allowDockBeforeProvision">false</bool> <!-- Car dock behavior --> <!-- The number of degrees to rotate the display when the device is in a car dock. Loading
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1797,6 +1797,7 @@ <java-symbol type="bool" name="config_customUserSwitchUi" /> <java-symbol type="bool" name="config_canRemoveFirstAccount" /> <java-symbol type="string" name="config_accountTypeToKeepFirstAccount" /> <java-symbol type="bool" name="config_allowDockBeforeProvision" /> <java-symbol type="bool" name="config_deskDockEnablesAccelerometer" /> <java-symbol type="bool" name="config_disableMenuKeyInLockScreen" /> <java-symbol type="bool" name="config_enableCarDockHomeLaunch" /> Loading
services/core/java/com/android/server/DockObserver.java +14 −4 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.server; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.database.ContentObserver; import android.media.AudioManager; import android.media.Ringtone; Loading @@ -35,6 +36,7 @@ import android.provider.Settings; import android.util.Pair; import android.util.Slog; import com.android.internal.R; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.DumpUtils; import com.android.internal.util.FrameworkStatsLog; Loading Loading @@ -259,12 +261,20 @@ final class DockObserver extends SystemService { + mReportedDockState); final int previousDockState = mPreviousDockState; mPreviousDockState = mReportedDockState; // Skip the dock intent if not yet provisioned. final ContentResolver cr = getContext().getContentResolver(); /// If the allow dock rotation before provision is enabled then we allow rotation. final Resources r = getContext().getResources(); final boolean allowDockBeforeProvision = r.getBoolean(R.bool.config_allowDockBeforeProvision); if (!allowDockBeforeProvision) { // Skip the dock intent if not yet provisioned. if (!mDeviceProvisionedObserver.isDeviceProvisioned()) { Slog.i(TAG, "Device not provisioned, skipping dock broadcast"); return; } } // Pack up the values and broadcast them to everyone Intent intent = new Intent(Intent.ACTION_DOCK_EVENT); Loading