diff options
author | John Spurlock <jspurlock@google.com> | 2014-07-18 13:02:39 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2014-07-19 11:57:51 -0400 |
commit | 7b41467704f941b11af6aace3e40993afc7f6c6f (patch) | |
tree | 4590d4c1b8e949cfd86fa21c141b84d80d8b3ab9 /services/core/java/com/android/server/power | |
parent | ad8f1673f6f28fd9187b21a0a683208ad27bb87f (diff) | |
download | frameworks_base-7b41467704f941b11af6aace3e40993afc7f6c6f.zip frameworks_base-7b41467704f941b11af6aace3e40993afc7f6c6f.tar.gz frameworks_base-7b41467704f941b11af6aace3e40993afc7f6c6f.tar.bz2 |
Zen mode filtering should use new usage constants.
Refactor stream-based calls to usage-based calls.
Bug:15279516
Change-Id: I3f7757d8123c14670e2ad5f8e6aa4e9803efe7ec
Diffstat (limited to 'services/core/java/com/android/server/power')
-rw-r--r-- | services/core/java/com/android/server/power/ShutdownThread.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/power/ShutdownThread.java b/services/core/java/com/android/server/power/ShutdownThread.java index 956e3e6..5f3da07 100644 --- a/services/core/java/com/android/server/power/ShutdownThread.java +++ b/services/core/java/com/android/server/power/ShutdownThread.java @@ -24,7 +24,7 @@ import android.app.IActivityManager; import android.app.ProgressDialog; import android.bluetooth.BluetoothAdapter; import android.bluetooth.IBluetoothManager; -import android.media.AudioManager; +import android.media.AudioAttributes; import android.nfc.NfcAdapter; import android.nfc.INfcAdapter; import android.content.BroadcastReceiver; @@ -78,7 +78,12 @@ public final class ShutdownThread extends Thread { // static instance of this thread private static final ShutdownThread sInstance = new ShutdownThread(); - + + private static final AudioAttributes VIBRATION_ATTRIBUTES = new AudioAttributes.Builder() + .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) + .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION) + .build(); + private final Object mActionDoneSync = new Object(); private boolean mActionDone; private Context mContext; @@ -508,7 +513,7 @@ public final class ShutdownThread extends Thread { // vibrate before shutting down Vibrator vibrator = new SystemVibrator(); try { - vibrator.vibrate(SHUTDOWN_VIBRATE_MS, AudioManager.STREAM_SYSTEM); + vibrator.vibrate(SHUTDOWN_VIBRATE_MS, VIBRATION_ATTRIBUTES); } catch (Exception e) { // Failure to vibrate shouldn't interrupt shutdown. Just log it. Log.w(TAG, "Failed to vibrate during shutdown.", e); |