diff options
author | Eric Laurent <elaurent@google.com> | 2013-03-25 17:13:01 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-03-25 17:13:01 +0000 |
commit | 368fbb61b520b80ce1fac65584961f913448b999 (patch) | |
tree | 0f0464a78fb42c3bc79eb5ee8c5348f3ab95fc2a /policy | |
parent | 97bf092e6132dee3e7c8a718f8780faedf3f73ae (diff) | |
parent | e4ad1a7420f6ad9b7f3b1d28205ed3d18e2dd04d (diff) | |
download | frameworks_base-368fbb61b520b80ce1fac65584961f913448b999.zip frameworks_base-368fbb61b520b80ce1fac65584961f913448b999.tar.gz frameworks_base-368fbb61b520b80ce1fac65584961f913448b999.tar.bz2 |
am e4ad1a74: am 7c566bf3: Merge "audio service: add config option for fixed volume" into jb-mr2-dev
* commit 'e4ad1a7420f6ad9b7f3b1d28205ed3d18e2dd04d':
audio service: add config option for fixed volume
Diffstat (limited to 'policy')
-rwxr-xr-x | policy/src/com/android/internal/policy/impl/GlobalActions.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/policy/src/com/android/internal/policy/impl/GlobalActions.java b/policy/src/com/android/internal/policy/impl/GlobalActions.java index 761eb2d..a2ac8fe 100755 --- a/policy/src/com/android/internal/policy/impl/GlobalActions.java +++ b/policy/src/com/android/internal/policy/impl/GlobalActions.java @@ -102,6 +102,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac private boolean mIsWaitingForEcmExit = false; private boolean mHasTelephony; private boolean mHasVibrator; + private final boolean mShowSilentToggle; /** * @param context everything needs a context :( @@ -132,6 +133,9 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac mAirplaneModeObserver); Vibrator vibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE); mHasVibrator = vibrator != null && vibrator.hasVibrator(); + + mShowSilentToggle = SHOW_SILENT_TOGGLE && !mContext.getResources().getBoolean( + com.android.internal.R.bool.config_useFixedVolume); } /** @@ -309,7 +313,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac } // last: silent mode - if (SHOW_SILENT_TOGGLE) { + if (mShowSilentToggle) { mItems.add(mSilentModeAction); } @@ -390,7 +394,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac mAirplaneModeOn.updateState(mAirplaneState); mAdapter.notifyDataSetChanged(); mDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG); - if (SHOW_SILENT_TOGGLE) { + if (mShowSilentToggle) { IntentFilter filter = new IntentFilter(AudioManager.RINGER_MODE_CHANGED_ACTION); mContext.registerReceiver(mRingerModeReceiver, filter); } @@ -407,7 +411,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac /** {@inheritDoc} */ public void onDismiss(DialogInterface dialog) { - if (SHOW_SILENT_TOGGLE) { + if (mShowSilentToggle) { try { mContext.unregisterReceiver(mRingerModeReceiver); } catch (IllegalArgumentException ie) { |