summaryrefslogtreecommitdiffstats
path: root/services/core/java/com/android/server/power/ShutdownThread.java
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2014-03-19 22:09:06 -0400
committerJohn Spurlock <jspurlock@google.com>2014-03-21 08:57:53 -0400
commitf9e1a0b369740e11ea1ed4f141ffb936fc1a6cdb (patch)
tree4095fb5381f5140c540ad157a788aae7252f9338 /services/core/java/com/android/server/power/ShutdownThread.java
parente003e7e8ca0bd697838ce48700d3fee8faf5110d (diff)
downloadframeworks_base-f9e1a0b369740e11ea1ed4f141ffb936fc1a6cdb.zip
frameworks_base-f9e1a0b369740e11ea1ed4f141ffb936fc1a6cdb.tar.gz
frameworks_base-f9e1a0b369740e11ea1ed4f141ffb936fc1a6cdb.tar.bz2
Annotate framework vibrate calls with stream hints.
Migrate existing framework usages of Vibrator.vibrate to use the new overload with an explicit stream hint. This prevents them from being blocked by rules targeting the unspecified stream. For calls that pass the existing appops check in VibrateService, pass streamHint down to the input device vibrator so we don't lose the signal, but leave it up to InputManager to decide what to do with it - currently unused. Change-Id: I65c944e4010edea29a412bf57d8d7d3b8098b746
Diffstat (limited to 'services/core/java/com/android/server/power/ShutdownThread.java')
-rw-r--r--services/core/java/com/android/server/power/ShutdownThread.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/power/ShutdownThread.java b/services/core/java/com/android/server/power/ShutdownThread.java
index 88a27f5..8fed79f 100644
--- a/services/core/java/com/android/server/power/ShutdownThread.java
+++ b/services/core/java/com/android/server/power/ShutdownThread.java
@@ -24,6 +24,7 @@ import android.app.IActivityManager;
import android.app.ProgressDialog;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.IBluetoothManager;
+import android.media.AudioManager;
import android.nfc.NfcAdapter;
import android.nfc.INfcAdapter;
import android.content.BroadcastReceiver;
@@ -498,7 +499,7 @@ public final class ShutdownThread extends Thread {
// vibrate before shutting down
Vibrator vibrator = new SystemVibrator();
try {
- vibrator.vibrate(SHUTDOWN_VIBRATE_MS);
+ vibrator.vibrate(SHUTDOWN_VIBRATE_MS, AudioManager.STREAM_SYSTEM);
} catch (Exception e) {
// Failure to vibrate shouldn't interrupt shutdown. Just log it.
Log.w(TAG, "Failed to vibrate during shutdown.", e);