Fwk: Only chime when docked and accessbility is on
Bug: 32036947 Change-Id: I5786abe827735cc3a4bc1d52baacaa19bccaae77
This commit is contained in:
@@ -167,10 +167,17 @@ final class DockObserver extends SystemService {
|
||||
intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
|
||||
intent.putExtra(Intent.EXTRA_DOCK_STATE, mReportedDockState);
|
||||
|
||||
boolean dockSoundsEnabled = Settings.Global.getInt(cr,
|
||||
Settings.Global.DOCK_SOUNDS_ENABLED, 1) == 1;
|
||||
boolean dockSoundsEnabledWhenAccessibility = Settings.Global.getInt(cr,
|
||||
Settings.Global.DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY, 1) == 1;
|
||||
boolean accessibilityEnabled = Settings.Secure.getInt(cr,
|
||||
Settings.Secure.ACCESSIBILITY_ENABLED, 0) == 1;
|
||||
|
||||
// Play a sound to provide feedback to confirm dock connection.
|
||||
// Particularly useful for flaky contact pins...
|
||||
if (Settings.Global.getInt(cr,
|
||||
Settings.Global.DOCK_SOUNDS_ENABLED, 1) == 1) {
|
||||
if ((dockSoundsEnabled) ||
|
||||
(accessibilityEnabled && dockSoundsEnabledWhenAccessibility)) {
|
||||
String whichSound = null;
|
||||
if (mReportedDockState == Intent.EXTRA_DOCK_STATE_UNDOCKED) {
|
||||
if ((previousDockState == Intent.EXTRA_DOCK_STATE_DESK) ||
|
||||
|
||||
Reference in New Issue
Block a user