Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f131611d authored by Christopher Tate's avatar Christopher Tate
Browse files

resolved conflicts for merge of b89ce434 to master

Change-Id: Ida7ef25adc2f4b9f22d8662c9f0e8a1ec9df0d55
parents 972e8bc0 b89ce434
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -65,6 +65,11 @@
         master volume stream and nothing else . -->
    <bool name="config_useMasterVolume">false</bool>

    <!-- Flag indicating that the media framework should support playing of sounds on volume
         key usage.  This adds noticeable additional overhead to volume key processing, so
         is disableable for products for which it is irrelevant. -->
    <bool name="config_useVolumeKeySounds">true</bool>

    <!-- Array of integer pairs controlling the rate at which the master volume changes
         in response to volume up and down key events.
         The first integer of each pair is compared against the current master volume
+17 −10
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ public class AudioManager {
    private final Context mContext;
    private long mVolumeKeyUpTime;
    private final boolean mUseMasterVolume;
    private final boolean mUseVolumeKeySounds;
    private static String TAG = "AudioManager";

    /**
@@ -408,6 +409,8 @@ public class AudioManager {
        mContext = context;
        mUseMasterVolume = mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_useMasterVolume);
        mUseVolumeKeySounds = mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_useVolumeKeySounds);
    }

    private static IAudioService getService()
@@ -459,6 +462,9 @@ public class AudioManager {
                 * responsive to the user.
                 */
                int flags = FLAG_SHOW_UI | FLAG_VIBRATE;
                // if there is no volume key-up sound, apply the new volume immediately
                if (!mUseVolumeKeySounds) flags |= FLAG_PLAY_SOUND;

                if (mUseMasterVolume) {
                    adjustMasterVolume(
                            keyCode == KeyEvent.KEYCODE_VOLUME_UP
@@ -498,6 +504,7 @@ public class AudioManager {
                 * Play a sound. This is done on key up since we don't want the
                 * sound to play when a user holds down volume down to mute.
                 */
                if (mUseVolumeKeySounds) {
                    if (mUseMasterVolume) {
                        if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
                            adjustMasterVolume(ADJUST_SAME, FLAG_PLAY_SOUND);
@@ -509,7 +516,7 @@ public class AudioManager {
                                stream,
                                flags);
                    }

                }
                mVolumeKeyUpTime = SystemClock.uptimeMillis();
                break;
        }