Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +2 −8 Original line number Diff line number Diff line Loading @@ -285,7 +285,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab @VisibleForTesting protected boolean mTelephonyCapable; private final boolean mAcquiredHapticEnabled; private final boolean mAcquiredHapticEnabled = false; @Nullable private final Vibrator mVibrator; // Device provisioning state Loading Loading @@ -1413,11 +1413,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab @VisibleForTesting public void playAcquiredHaptic() { if (mAcquiredHapticEnabled && mVibrator != null) { String effect = Settings.Global.getString( mContext.getContentResolver(), "udfps_acquired_type"); mVibrator.vibrate(UdfpsController.getVibration(effect, UdfpsController.EFFECT_TICK), mVibrator.vibrate(UdfpsController.EFFECT_CLICK, UdfpsController.VIBRATION_SONIFICATION_ATTRIBUTES); } } Loading Loading @@ -1730,8 +1726,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab mLockPatternUtils = lockPatternUtils; mAuthController = authController; dumpManager.registerDumpable(getClass().getName(), this); mAcquiredHapticEnabled = Settings.Global.getInt(mContext.getContentResolver(), "udfps_acquired", 0) == 1; mVibrator = vibrator; mHandler = new Handler(mainLooper) { Loading packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +3 −58 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.systemui.biometrics; import static android.hardware.fingerprint.IUdfpsOverlayController.REASON_AUTH_FPM_KEYGUARD; import static android.os.VibrationEffect.Composition.PRIMITIVE_LOW_TICK; import static com.android.internal.util.Preconditions.checkArgument; import static com.android.internal.util.Preconditions.checkNotNull; Loading @@ -27,7 +26,6 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SuppressLint; import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; Loading @@ -47,8 +45,6 @@ import android.os.SystemClock; import android.os.Trace; import android.os.VibrationEffect; import android.os.Vibrator; import android.provider.Settings; import android.text.TextUtils; import android.util.Log; import android.view.Gravity; import android.view.LayoutInflater; Loading Loading @@ -160,16 +156,8 @@ public class UdfpsController implements DozeReceiver { .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION) .build(); public static final VibrationEffect EFFECT_TICK = VibrationEffect.get(VibrationEffect.EFFECT_TICK); private static final VibrationEffect EFFECT_TEXTURE_TICK = VibrationEffect.get(VibrationEffect.EFFECT_TEXTURE_TICK); @VisibleForTesting static final VibrationEffect EFFECT_CLICK = VibrationEffect.get(VibrationEffect.EFFECT_CLICK); private static final VibrationEffect EFFECT_HEAVY = VibrationEffect.get(VibrationEffect.EFFECT_HEAVY_CLICK); private static final VibrationEffect EFFECT_DOUBLE_CLICK = VibrationEffect.get(VibrationEffect.EFFECT_DOUBLE_CLICK); public static final VibrationEffect EFFECT_CLICK = VibrationEffect.get(VibrationEffect.EFFECT_CLICK); private final ScreenLifecycle.Observer mScreenObserver = new ScreenLifecycle.Observer() { @Override Loading Loading @@ -552,18 +540,7 @@ public class UdfpsController implements DozeReceiver { @VisibleForTesting public void playStartHaptic() { if (mVibrator != null) { final ContentResolver contentResolver = mContext.getContentResolver(); // TODO: these settings checks should eventually be removed after ux testing // (b/185124905) int startEnabled = Settings.Global.getInt(contentResolver, "udfps_start", 1); if (startEnabled > 0) { String startEffectSetting = Settings.Global.getString( contentResolver, "udfps_start_type"); mVibrator.vibrate(getVibration(startEffectSetting, EFFECT_CLICK), VIBRATION_SONIFICATION_ATTRIBUTES); } mVibrator.vibrate(EFFECT_CLICK, VIBRATION_SONIFICATION_ATTRIBUTES); } } Loading Loading @@ -880,38 +857,6 @@ public class UdfpsController implements DozeReceiver { } } /** * get vibration to play given string * used for testing purposes (b/185124905) */ public static VibrationEffect getVibration(String effect, VibrationEffect defaultEffect) { if (TextUtils.isEmpty(effect)) { return defaultEffect; } switch (effect.toLowerCase()) { case "click": return EFFECT_CLICK; case "heavy": return EFFECT_HEAVY; case "texture_tick": return EFFECT_TEXTURE_TICK; case "tick": return EFFECT_TICK; case "double_tap": return EFFECT_DOUBLE_CLICK; default: try { int primitive = Integer.parseInt(effect); if (primitive <= PRIMITIVE_LOW_TICK && primitive > -1) { return VibrationEffect.startComposition().addPrimitive(primitive).compose(); } } catch (NumberFormatException e) { } return defaultEffect; } } private void updateTouchListener() { if (mView == null) { return; Loading services/core/java/com/android/server/biometrics/sensors/AcquisitionClient.java +0 −14 Original line number Diff line number Diff line Loading @@ -188,18 +188,7 @@ public abstract class AcquisitionClient<T> extends HalClientMonitor<T> implement mPowerManager.userActivity(now, PowerManager.USER_ACTIVITY_EVENT_TOUCH, 0); } protected boolean successHapticsEnabled() { return true; } protected boolean errorHapticsEnabled() { return true; } protected final void vibrateSuccess() { if (!successHapticsEnabled()) { return; } Vibrator vibrator = getContext().getSystemService(Vibrator.class); if (vibrator != null) { vibrator.vibrate(SUCCESS_VIBRATION_EFFECT, VIBRATION_SONIFICATION_ATTRIBUTES); Loading @@ -207,9 +196,6 @@ public abstract class AcquisitionClient<T> extends HalClientMonitor<T> implement } protected final void vibrateError() { if (!errorHapticsEnabled()) { return; } Vibrator vibrator = getContext().getSystemService(Vibrator.class); if (vibrator != null) { vibrator.vibrate(ERROR_VIBRATION_EFFECT, VIBRATION_SONIFICATION_ATTRIBUTES); Loading services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClient.java +0 −23 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.server.biometrics.sensors.face.aidl; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.NotificationManager; import android.content.ContentResolver; import android.content.Context; import android.content.res.Resources; import android.hardware.biometrics.BiometricAuthenticator; Loading @@ -33,7 +32,6 @@ import android.hardware.face.FaceAuthenticationFrame; import android.hardware.face.FaceManager; import android.os.IBinder; import android.os.RemoteException; import android.provider.Settings; import android.util.Slog; import com.android.internal.R; Loading @@ -59,9 +57,6 @@ class FaceAuthenticationClient extends AuthenticationClient<ISession> implements @Nullable private final NotificationManager mNotificationManager; @Nullable private ICancellationSignal mCancellationSignal; @NonNull private final ContentResolver mContentResolver; private final boolean mCustomHaptics; private final int[] mBiometricPromptIgnoreList; private final int[] mBiometricPromptIgnoreListVendor; private final int[] mKeyguardIgnoreList; Loading Loading @@ -92,10 +87,6 @@ class FaceAuthenticationClient extends AuthenticationClient<ISession> implements R.array.config_face_acquire_keyguard_ignorelist); mKeyguardIgnoreListVendor = resources.getIntArray( R.array.config_face_acquire_vendor_keyguard_ignorelist); mContentResolver = context.getContentResolver(); mCustomHaptics = Settings.Global.getInt(mContentResolver, "face_custom_success_error", 0) == 1; } @NonNull Loading Loading @@ -261,18 +252,4 @@ class FaceAuthenticationClient extends AuthenticationClient<ISession> implements Slog.e(TAG, "Remote exception", e); } } @Override protected boolean successHapticsEnabled() { return mCustomHaptics ? Settings.Global.getInt(mContentResolver, "face_success_enabled", 1) == 0 : super.successHapticsEnabled(); } @Override protected boolean errorHapticsEnabled() { return mCustomHaptics ? Settings.Global.getInt(mContentResolver, "face_error_enabled", 1) == 0 : super.errorHapticsEnabled(); } } services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceAuthenticationClient.java +0 −22 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.server.biometrics.sensors.face.hidl; import android.annotation.NonNull; import android.content.ContentResolver; import android.content.Context; import android.content.res.Resources; import android.hardware.biometrics.BiometricAuthenticator; Loading @@ -28,7 +27,6 @@ import android.hardware.biometrics.face.V1_0.IBiometricsFace; import android.hardware.face.FaceManager; import android.os.IBinder; import android.os.RemoteException; import android.provider.Settings; import android.util.Slog; import com.android.internal.R; Loading @@ -49,8 +47,6 @@ class FaceAuthenticationClient extends AuthenticationClient<IBiometricsFace> { private static final String TAG = "FaceAuthenticationClient"; @NonNull private final ContentResolver mContentResolver; private final boolean mCustomHaptics; private final UsageStats mUsageStats; private final int[] mBiometricPromptIgnoreList; Loading Loading @@ -81,10 +77,6 @@ class FaceAuthenticationClient extends AuthenticationClient<IBiometricsFace> { R.array.config_face_acquire_keyguard_ignorelist); mKeyguardIgnoreListVendor = resources.getIntArray( R.array.config_face_acquire_vendor_keyguard_ignorelist); mContentResolver = context.getContentResolver(); mCustomHaptics = Settings.Global.getInt(mContentResolver, "face_custom_success_error", 0) == 1; } @NonNull Loading Loading @@ -200,18 +192,4 @@ class FaceAuthenticationClient extends AuthenticationClient<IBiometricsFace> { final boolean shouldSend = shouldSend(acquireInfo, vendorCode); onAcquiredInternal(acquireInfo, vendorCode, shouldSend); } @Override protected boolean successHapticsEnabled() { return mCustomHaptics ? Settings.Global.getInt(mContentResolver, "face_success_enabled", 1) == 0 : super.successHapticsEnabled(); } @Override protected boolean errorHapticsEnabled() { return mCustomHaptics ? Settings.Global.getInt(mContentResolver, "face_error_enabled", 1) == 0 : super.errorHapticsEnabled(); } } Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +2 −8 Original line number Diff line number Diff line Loading @@ -285,7 +285,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab @VisibleForTesting protected boolean mTelephonyCapable; private final boolean mAcquiredHapticEnabled; private final boolean mAcquiredHapticEnabled = false; @Nullable private final Vibrator mVibrator; // Device provisioning state Loading Loading @@ -1413,11 +1413,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab @VisibleForTesting public void playAcquiredHaptic() { if (mAcquiredHapticEnabled && mVibrator != null) { String effect = Settings.Global.getString( mContext.getContentResolver(), "udfps_acquired_type"); mVibrator.vibrate(UdfpsController.getVibration(effect, UdfpsController.EFFECT_TICK), mVibrator.vibrate(UdfpsController.EFFECT_CLICK, UdfpsController.VIBRATION_SONIFICATION_ATTRIBUTES); } } Loading Loading @@ -1730,8 +1726,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab mLockPatternUtils = lockPatternUtils; mAuthController = authController; dumpManager.registerDumpable(getClass().getName(), this); mAcquiredHapticEnabled = Settings.Global.getInt(mContext.getContentResolver(), "udfps_acquired", 0) == 1; mVibrator = vibrator; mHandler = new Handler(mainLooper) { Loading
packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +3 −58 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.systemui.biometrics; import static android.hardware.fingerprint.IUdfpsOverlayController.REASON_AUTH_FPM_KEYGUARD; import static android.os.VibrationEffect.Composition.PRIMITIVE_LOW_TICK; import static com.android.internal.util.Preconditions.checkArgument; import static com.android.internal.util.Preconditions.checkNotNull; Loading @@ -27,7 +26,6 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SuppressLint; import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; Loading @@ -47,8 +45,6 @@ import android.os.SystemClock; import android.os.Trace; import android.os.VibrationEffect; import android.os.Vibrator; import android.provider.Settings; import android.text.TextUtils; import android.util.Log; import android.view.Gravity; import android.view.LayoutInflater; Loading Loading @@ -160,16 +156,8 @@ public class UdfpsController implements DozeReceiver { .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION) .build(); public static final VibrationEffect EFFECT_TICK = VibrationEffect.get(VibrationEffect.EFFECT_TICK); private static final VibrationEffect EFFECT_TEXTURE_TICK = VibrationEffect.get(VibrationEffect.EFFECT_TEXTURE_TICK); @VisibleForTesting static final VibrationEffect EFFECT_CLICK = VibrationEffect.get(VibrationEffect.EFFECT_CLICK); private static final VibrationEffect EFFECT_HEAVY = VibrationEffect.get(VibrationEffect.EFFECT_HEAVY_CLICK); private static final VibrationEffect EFFECT_DOUBLE_CLICK = VibrationEffect.get(VibrationEffect.EFFECT_DOUBLE_CLICK); public static final VibrationEffect EFFECT_CLICK = VibrationEffect.get(VibrationEffect.EFFECT_CLICK); private final ScreenLifecycle.Observer mScreenObserver = new ScreenLifecycle.Observer() { @Override Loading Loading @@ -552,18 +540,7 @@ public class UdfpsController implements DozeReceiver { @VisibleForTesting public void playStartHaptic() { if (mVibrator != null) { final ContentResolver contentResolver = mContext.getContentResolver(); // TODO: these settings checks should eventually be removed after ux testing // (b/185124905) int startEnabled = Settings.Global.getInt(contentResolver, "udfps_start", 1); if (startEnabled > 0) { String startEffectSetting = Settings.Global.getString( contentResolver, "udfps_start_type"); mVibrator.vibrate(getVibration(startEffectSetting, EFFECT_CLICK), VIBRATION_SONIFICATION_ATTRIBUTES); } mVibrator.vibrate(EFFECT_CLICK, VIBRATION_SONIFICATION_ATTRIBUTES); } } Loading Loading @@ -880,38 +857,6 @@ public class UdfpsController implements DozeReceiver { } } /** * get vibration to play given string * used for testing purposes (b/185124905) */ public static VibrationEffect getVibration(String effect, VibrationEffect defaultEffect) { if (TextUtils.isEmpty(effect)) { return defaultEffect; } switch (effect.toLowerCase()) { case "click": return EFFECT_CLICK; case "heavy": return EFFECT_HEAVY; case "texture_tick": return EFFECT_TEXTURE_TICK; case "tick": return EFFECT_TICK; case "double_tap": return EFFECT_DOUBLE_CLICK; default: try { int primitive = Integer.parseInt(effect); if (primitive <= PRIMITIVE_LOW_TICK && primitive > -1) { return VibrationEffect.startComposition().addPrimitive(primitive).compose(); } } catch (NumberFormatException e) { } return defaultEffect; } } private void updateTouchListener() { if (mView == null) { return; Loading
services/core/java/com/android/server/biometrics/sensors/AcquisitionClient.java +0 −14 Original line number Diff line number Diff line Loading @@ -188,18 +188,7 @@ public abstract class AcquisitionClient<T> extends HalClientMonitor<T> implement mPowerManager.userActivity(now, PowerManager.USER_ACTIVITY_EVENT_TOUCH, 0); } protected boolean successHapticsEnabled() { return true; } protected boolean errorHapticsEnabled() { return true; } protected final void vibrateSuccess() { if (!successHapticsEnabled()) { return; } Vibrator vibrator = getContext().getSystemService(Vibrator.class); if (vibrator != null) { vibrator.vibrate(SUCCESS_VIBRATION_EFFECT, VIBRATION_SONIFICATION_ATTRIBUTES); Loading @@ -207,9 +196,6 @@ public abstract class AcquisitionClient<T> extends HalClientMonitor<T> implement } protected final void vibrateError() { if (!errorHapticsEnabled()) { return; } Vibrator vibrator = getContext().getSystemService(Vibrator.class); if (vibrator != null) { vibrator.vibrate(ERROR_VIBRATION_EFFECT, VIBRATION_SONIFICATION_ATTRIBUTES); Loading
services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClient.java +0 −23 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.server.biometrics.sensors.face.aidl; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.NotificationManager; import android.content.ContentResolver; import android.content.Context; import android.content.res.Resources; import android.hardware.biometrics.BiometricAuthenticator; Loading @@ -33,7 +32,6 @@ import android.hardware.face.FaceAuthenticationFrame; import android.hardware.face.FaceManager; import android.os.IBinder; import android.os.RemoteException; import android.provider.Settings; import android.util.Slog; import com.android.internal.R; Loading @@ -59,9 +57,6 @@ class FaceAuthenticationClient extends AuthenticationClient<ISession> implements @Nullable private final NotificationManager mNotificationManager; @Nullable private ICancellationSignal mCancellationSignal; @NonNull private final ContentResolver mContentResolver; private final boolean mCustomHaptics; private final int[] mBiometricPromptIgnoreList; private final int[] mBiometricPromptIgnoreListVendor; private final int[] mKeyguardIgnoreList; Loading Loading @@ -92,10 +87,6 @@ class FaceAuthenticationClient extends AuthenticationClient<ISession> implements R.array.config_face_acquire_keyguard_ignorelist); mKeyguardIgnoreListVendor = resources.getIntArray( R.array.config_face_acquire_vendor_keyguard_ignorelist); mContentResolver = context.getContentResolver(); mCustomHaptics = Settings.Global.getInt(mContentResolver, "face_custom_success_error", 0) == 1; } @NonNull Loading Loading @@ -261,18 +252,4 @@ class FaceAuthenticationClient extends AuthenticationClient<ISession> implements Slog.e(TAG, "Remote exception", e); } } @Override protected boolean successHapticsEnabled() { return mCustomHaptics ? Settings.Global.getInt(mContentResolver, "face_success_enabled", 1) == 0 : super.successHapticsEnabled(); } @Override protected boolean errorHapticsEnabled() { return mCustomHaptics ? Settings.Global.getInt(mContentResolver, "face_error_enabled", 1) == 0 : super.errorHapticsEnabled(); } }
services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceAuthenticationClient.java +0 −22 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.server.biometrics.sensors.face.hidl; import android.annotation.NonNull; import android.content.ContentResolver; import android.content.Context; import android.content.res.Resources; import android.hardware.biometrics.BiometricAuthenticator; Loading @@ -28,7 +27,6 @@ import android.hardware.biometrics.face.V1_0.IBiometricsFace; import android.hardware.face.FaceManager; import android.os.IBinder; import android.os.RemoteException; import android.provider.Settings; import android.util.Slog; import com.android.internal.R; Loading @@ -49,8 +47,6 @@ class FaceAuthenticationClient extends AuthenticationClient<IBiometricsFace> { private static final String TAG = "FaceAuthenticationClient"; @NonNull private final ContentResolver mContentResolver; private final boolean mCustomHaptics; private final UsageStats mUsageStats; private final int[] mBiometricPromptIgnoreList; Loading Loading @@ -81,10 +77,6 @@ class FaceAuthenticationClient extends AuthenticationClient<IBiometricsFace> { R.array.config_face_acquire_keyguard_ignorelist); mKeyguardIgnoreListVendor = resources.getIntArray( R.array.config_face_acquire_vendor_keyguard_ignorelist); mContentResolver = context.getContentResolver(); mCustomHaptics = Settings.Global.getInt(mContentResolver, "face_custom_success_error", 0) == 1; } @NonNull Loading Loading @@ -200,18 +192,4 @@ class FaceAuthenticationClient extends AuthenticationClient<IBiometricsFace> { final boolean shouldSend = shouldSend(acquireInfo, vendorCode); onAcquiredInternal(acquireInfo, vendorCode, shouldSend); } @Override protected boolean successHapticsEnabled() { return mCustomHaptics ? Settings.Global.getInt(mContentResolver, "face_success_enabled", 1) == 0 : super.successHapticsEnabled(); } @Override protected boolean errorHapticsEnabled() { return mCustomHaptics ? Settings.Global.getInt(mContentResolver, "face_error_enabled", 1) == 0 : super.errorHapticsEnabled(); } }