Loading core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -54493,6 +54493,7 @@ package android.view { method public boolean performContextClick(); method public boolean performHapticFeedback(int); method public boolean performHapticFeedback(int, int); method @FlaggedApi("android.os.vibrator.haptic_feedback_with_custom_usage") public boolean performHapticFeedback(@NonNull android.os.vibrator.HapticFeedbackRequest); method public boolean performLongClick(); method public boolean performLongClick(float, float); method @Nullable public android.view.ContentInfo performReceiveContent(@NonNull android.view.ContentInfo); core/java/android/os/IVibratorManagerService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ interface IVibratorManagerService { // There is no order guarantee with respect to the two-way APIs above like // vibrate/isVibrating/cancel. oneway void performHapticFeedback(int uid, int deviceId, String opPkg, int constant, String reason, int flags, int privFlags); int usage, String reason, int flags, int privFlags); // Similar to performHapticFeedback but the effect is customized to the input device. The // customization for each constant is defined on a device basis, and the behavior will be the Loading core/java/android/os/SystemVibrator.java +3 −2 Original line number Diff line number Diff line Loading @@ -226,12 +226,13 @@ public class SystemVibrator extends Vibrator { } @Override public void performHapticFeedback(int constant, String reason, int flags, int privFlags) { public void performHapticFeedback(int constant, @VibrationAttributes.Usage int usage, String reason, int flags, int privFlags) { if (mVibratorManager == null) { Log.w(TAG, "Failed to perform haptic feedback; no vibrator manager."); return; } mVibratorManager.performHapticFeedback(constant, reason, flags, privFlags); mVibratorManager.performHapticFeedback(constant, usage, reason, flags, privFlags); } @Override Loading core/java/android/os/SystemVibratorManager.java +7 −4 Original line number Diff line number Diff line Loading @@ -163,7 +163,8 @@ public class SystemVibratorManager extends VibratorManager { } @Override public void performHapticFeedback(int constant, String reason, int flags, int privFlags) { public void performHapticFeedback(int constant, @VibrationAttributes.Usage int usage, String reason, int flags, int privFlags) { if (mService == null) { Log.w(TAG, "Failed to perform haptic feedback; no vibrator manager service."); return; Loading @@ -171,7 +172,7 @@ public class SystemVibratorManager extends VibratorManager { Trace.traceBegin(TRACE_TAG_VIBRATOR, "performHapticFeedback"); try { mService.performHapticFeedback(mUid, mContext.getDeviceId(), mPackageName, constant, reason, flags, privFlags); usage, reason, flags, privFlags); } catch (RemoteException e) { Log.w(TAG, "Failed to perform haptic feedback.", e); } finally { Loading Loading @@ -364,8 +365,10 @@ public class SystemVibratorManager extends VibratorManager { } @Override public void performHapticFeedback(int effectId, String reason, int flags, int privFlags) { SystemVibratorManager.this.performHapticFeedback(effectId, reason, flags, privFlags); public void performHapticFeedback(int effectId, @VibrationAttributes.Usage int usage, String reason, int flags, int privFlags) { SystemVibratorManager.this.performHapticFeedback( effectId, usage, reason, flags, privFlags); } @Override Loading core/java/android/os/Vibrator.java +5 −2 Original line number Diff line number Diff line Loading @@ -643,14 +643,17 @@ public abstract class Vibrator { * * @param constant the ID for the haptic feedback. This should be one of the constants defined * in {@link HapticFeedbackConstants}. * @param usage one of the {@link VibrationAttributes} usages with the class * {@link USAGE_CLASS_FEEDBACK}. Use {@link USAGE_UNKNOWN} if you are not sure about which * usage to use, and the system will assign a default usage. * @param reason the reason for this haptic feedback. * @param flags Additional flags as per {@link HapticFeedbackConstants}. * @param privFlags Additional private flags as per {@link HapticFeedbackConstants}. * * @hide */ public void performHapticFeedback(int constant, String reason, @HapticFeedbackConstants.Flags int flags, public void performHapticFeedback(int constant, @VibrationAttributes.Usage int usage, String reason, @HapticFeedbackConstants.Flags int flags, @HapticFeedbackConstants.PrivateFlags int privFlags) { Log.w(TAG, "performHapticFeedback is not supported"); } Loading Loading
core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -54493,6 +54493,7 @@ package android.view { method public boolean performContextClick(); method public boolean performHapticFeedback(int); method public boolean performHapticFeedback(int, int); method @FlaggedApi("android.os.vibrator.haptic_feedback_with_custom_usage") public boolean performHapticFeedback(@NonNull android.os.vibrator.HapticFeedbackRequest); method public boolean performLongClick(); method public boolean performLongClick(float, float); method @Nullable public android.view.ContentInfo performReceiveContent(@NonNull android.view.ContentInfo);
core/java/android/os/IVibratorManagerService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ interface IVibratorManagerService { // There is no order guarantee with respect to the two-way APIs above like // vibrate/isVibrating/cancel. oneway void performHapticFeedback(int uid, int deviceId, String opPkg, int constant, String reason, int flags, int privFlags); int usage, String reason, int flags, int privFlags); // Similar to performHapticFeedback but the effect is customized to the input device. The // customization for each constant is defined on a device basis, and the behavior will be the Loading
core/java/android/os/SystemVibrator.java +3 −2 Original line number Diff line number Diff line Loading @@ -226,12 +226,13 @@ public class SystemVibrator extends Vibrator { } @Override public void performHapticFeedback(int constant, String reason, int flags, int privFlags) { public void performHapticFeedback(int constant, @VibrationAttributes.Usage int usage, String reason, int flags, int privFlags) { if (mVibratorManager == null) { Log.w(TAG, "Failed to perform haptic feedback; no vibrator manager."); return; } mVibratorManager.performHapticFeedback(constant, reason, flags, privFlags); mVibratorManager.performHapticFeedback(constant, usage, reason, flags, privFlags); } @Override Loading
core/java/android/os/SystemVibratorManager.java +7 −4 Original line number Diff line number Diff line Loading @@ -163,7 +163,8 @@ public class SystemVibratorManager extends VibratorManager { } @Override public void performHapticFeedback(int constant, String reason, int flags, int privFlags) { public void performHapticFeedback(int constant, @VibrationAttributes.Usage int usage, String reason, int flags, int privFlags) { if (mService == null) { Log.w(TAG, "Failed to perform haptic feedback; no vibrator manager service."); return; Loading @@ -171,7 +172,7 @@ public class SystemVibratorManager extends VibratorManager { Trace.traceBegin(TRACE_TAG_VIBRATOR, "performHapticFeedback"); try { mService.performHapticFeedback(mUid, mContext.getDeviceId(), mPackageName, constant, reason, flags, privFlags); usage, reason, flags, privFlags); } catch (RemoteException e) { Log.w(TAG, "Failed to perform haptic feedback.", e); } finally { Loading Loading @@ -364,8 +365,10 @@ public class SystemVibratorManager extends VibratorManager { } @Override public void performHapticFeedback(int effectId, String reason, int flags, int privFlags) { SystemVibratorManager.this.performHapticFeedback(effectId, reason, flags, privFlags); public void performHapticFeedback(int effectId, @VibrationAttributes.Usage int usage, String reason, int flags, int privFlags) { SystemVibratorManager.this.performHapticFeedback( effectId, usage, reason, flags, privFlags); } @Override Loading
core/java/android/os/Vibrator.java +5 −2 Original line number Diff line number Diff line Loading @@ -643,14 +643,17 @@ public abstract class Vibrator { * * @param constant the ID for the haptic feedback. This should be one of the constants defined * in {@link HapticFeedbackConstants}. * @param usage one of the {@link VibrationAttributes} usages with the class * {@link USAGE_CLASS_FEEDBACK}. Use {@link USAGE_UNKNOWN} if you are not sure about which * usage to use, and the system will assign a default usage. * @param reason the reason for this haptic feedback. * @param flags Additional flags as per {@link HapticFeedbackConstants}. * @param privFlags Additional private flags as per {@link HapticFeedbackConstants}. * * @hide */ public void performHapticFeedback(int constant, String reason, @HapticFeedbackConstants.Flags int flags, public void performHapticFeedback(int constant, @VibrationAttributes.Usage int usage, String reason, @HapticFeedbackConstants.Flags int flags, @HapticFeedbackConstants.PrivateFlags int privFlags) { Log.w(TAG, "performHapticFeedback is not supported"); } Loading