Merge "Initial udfps vibration should always play" into sc-qpr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
8b5f287dcb
@@ -163,7 +163,8 @@ public class UdfpsController implements DozeReceiver {
|
||||
public static final AudioAttributes VIBRATION_SONIFICATION_ATTRIBUTES =
|
||||
new AudioAttributes.Builder()
|
||||
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
|
||||
.setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)
|
||||
// vibration will bypass battery saver mode:
|
||||
.setUsage(AudioAttributes.USAGE_ASSISTANCE_ACCESSIBILITY)
|
||||
.build();
|
||||
|
||||
public static final VibrationEffect EFFECT_CLICK =
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.android.systemui.biometrics;
|
||||
|
||||
import static android.media.AudioAttributes.USAGE_ASSISTANCE_ACCESSIBILITY;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
@@ -563,5 +565,10 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
||||
eq(mUdfpsController.EFFECT_CLICK),
|
||||
eq("udfps-onStart"),
|
||||
eq(UdfpsController.VIBRATION_SONIFICATION_ATTRIBUTES));
|
||||
|
||||
// THEN make sure vibration attributes has so that it always will play the haptic,
|
||||
// even in battery saver mode
|
||||
assertEquals(USAGE_ASSISTANCE_ACCESSIBILITY,
|
||||
UdfpsController.VIBRATION_SONIFICATION_ATTRIBUTES.getUsage());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user