summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/ExpandHelper.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/SearchPanelView.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java9
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java8
4 files changed, 29 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/ExpandHelper.java b/packages/SystemUI/src/com/android/systemui/ExpandHelper.java
index 006619b..bbda536 100644
--- a/packages/SystemUI/src/com/android/systemui/ExpandHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/ExpandHelper.java
@@ -21,6 +21,7 @@ import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.content.Context;
+import android.media.AudioAttributes;
import android.media.AudioManager;
import android.os.Vibrator;
import android.util.Log;
@@ -66,6 +67,11 @@ public class ExpandHelper implements Gefingerpoken {
// overstretch fills the range (GLOW_BASE, 1.0]
private static final float GLOW_BASE = 0.5f;
+ private static final AudioAttributes VIBRATION_ATTRIBUTES = new AudioAttributes.Builder()
+ .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
+ .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)
+ .build();
+
@SuppressWarnings("unused")
private Context mContext;
@@ -550,7 +556,7 @@ public class ExpandHelper implements Gefingerpoken {
mVibrator = (android.os.Vibrator)
mContext.getSystemService(Context.VIBRATOR_SERVICE);
}
- mVibrator.vibrate(duration, AudioManager.STREAM_SYSTEM);
+ mVibrator.vibrate(duration, VIBRATION_ATTRIBUTES);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/SearchPanelView.java b/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
index 09aa60f..ed03733 100644
--- a/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
@@ -25,7 +25,7 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
-import android.media.AudioManager;
+import android.media.AudioAttributes;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserHandle;
@@ -58,6 +58,12 @@ public class SearchPanelView extends FrameLayout implements
public static final boolean DEBUG_GESTURES = true;
private static final String ASSIST_ICON_METADATA_NAME =
"com.android.systemui.action_assist_icon";
+
+ private static final AudioAttributes VIBRATION_ATTRIBUTES = new AudioAttributes.Builder()
+ .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
+ .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)
+ .build();
+
private final Context mContext;
private BaseStatusBar mBar;
@@ -209,7 +215,7 @@ public class SearchPanelView extends FrameLayout implements
Resources res = context.getResources();
Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
vibrator.vibrate(res.getInteger(R.integer.config_search_panel_view_vibration_duration),
- AudioManager.STREAM_SYSTEM);
+ VIBRATION_ATTRIBUTES);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index e975045..fb0f1c1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -56,7 +56,7 @@ import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.inputmethodservice.InputMethodService;
-import android.media.AudioManager;
+import android.media.AudioAttributes;
import android.media.MediaMetadata;
import android.media.session.MediaController;
import android.media.session.MediaSession;
@@ -193,6 +193,11 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
*/
private static final int HINT_RESET_DELAY_MS = 1200;
+ private static final AudioAttributes VIBRATION_ATTRIBUTES = new AudioAttributes.Builder()
+ .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
+ .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)
+ .build();
+
PhoneStatusBarPolicy mIconPolicy;
// These are no longer handled by the policy, because we need custom strategies for them
@@ -2958,7 +2963,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
void vibrate() {
android.os.Vibrator vib = (android.os.Vibrator)mContext.getSystemService(
Context.VIBRATOR_SERVICE);
- vib.vibrate(250, AudioManager.STREAM_SYSTEM);
+ vib.vibrate(250, VIBRATION_ATTRIBUTES);
}
Runnable mStartTracing = new Runnable() {
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java b/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java
index 0c5d2a5..4ada5ec 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java
@@ -27,6 +27,7 @@ import android.content.IntentFilter;
import android.content.res.Resources;
import android.graphics.PixelFormat;
import android.graphics.drawable.ColorDrawable;
+import android.media.AudioAttributes;
import android.media.AudioManager;
import android.media.AudioService;
import android.media.AudioSystem;
@@ -108,6 +109,11 @@ public class VolumePanel extends Handler {
private static final int STREAM_MASTER = -100;
// Pseudo stream type for remote volume is defined in AudioService.STREAM_REMOTE_MUSIC
+ private static final AudioAttributes VIBRATION_ATTRIBUTES = new AudioAttributes.Builder()
+ .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
+ .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)
+ .build();
+
private final String mTag;
protected final Context mContext;
private final AudioManager mAudioManager;
@@ -969,7 +975,7 @@ public class VolumePanel extends Handler {
return;
}
- mVibrator.vibrate(VIBRATE_DURATION, AudioManager.STREAM_SYSTEM);
+ mVibrator.vibrate(VIBRATE_DURATION, VIBRATION_ATTRIBUTES);
}
protected void onRemoteVolumeChanged(MediaController controller, int flags) {