Fix use of deprecated SoundPool API in Keyguard
Don't use stream types for operations other than volume control. Bug: 122901916 Test: verify logcat doesn't show warnings, see bug Change-Id: I46143e53978226f6f660c92e85e7b0b1b0a37622
This commit is contained in:
@@ -40,6 +40,7 @@ import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.pm.UserInfo;
|
||||
import android.hardware.biometrics.BiometricSourceType;
|
||||
import android.media.AudioAttributes;
|
||||
import android.media.AudioManager;
|
||||
import android.media.SoundPool;
|
||||
import android.os.Bundle;
|
||||
@@ -750,7 +751,14 @@ public class KeyguardViewMediator extends SystemUI {
|
||||
|
||||
mDeviceInteractive = mPM.isInteractive();
|
||||
|
||||
mLockSounds = new SoundPool(1, AudioManager.STREAM_SYSTEM, 0);
|
||||
mLockSounds = new SoundPool.Builder()
|
||||
.setMaxStreams(1)
|
||||
.setAudioAttributes(
|
||||
new AudioAttributes.Builder()
|
||||
.setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)
|
||||
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
|
||||
.build())
|
||||
.build();
|
||||
String soundPath = Settings.Global.getString(cr, Settings.Global.LOCK_SOUND);
|
||||
if (soundPath != null) {
|
||||
mLockSoundId = mLockSounds.load(soundPath, 1);
|
||||
|
||||
Reference in New Issue
Block a user