Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b5f287d authored by Android Build Prod User's avatar Android Build Prod User Committed by Android (Google) Code Review
Browse files

Merge "Initial udfps vibration should always play" into sc-qpr1-dev

parents 64b885a4 f8a240e5
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -163,7 +163,8 @@ public class UdfpsController implements DozeReceiver {
    public static final AudioAttributes VIBRATION_SONIFICATION_ATTRIBUTES =
    public static final AudioAttributes VIBRATION_SONIFICATION_ATTRIBUTES =
            new AudioAttributes.Builder()
            new AudioAttributes.Builder()
                    .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
                    .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
                    .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)
                    // vibration will bypass battery saver mode:
                    .setUsage(AudioAttributes.USAGE_ASSISTANCE_ACCESSIBILITY)
                    .build();
                    .build();


    public static final VibrationEffect EFFECT_CLICK =
    public static final VibrationEffect EFFECT_CLICK =
+7 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,8 @@


package com.android.systemui.biometrics;
package com.android.systemui.biometrics;


import static android.media.AudioAttributes.USAGE_ASSISTANCE_ACCESSIBILITY;

import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertEquals;


import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.any;
@@ -563,5 +565,10 @@ public class UdfpsControllerTest extends SysuiTestCase {
                eq(mUdfpsController.EFFECT_CLICK),
                eq(mUdfpsController.EFFECT_CLICK),
                eq("udfps-onStart"),
                eq("udfps-onStart"),
                eq(UdfpsController.VIBRATION_SONIFICATION_ATTRIBUTES));
                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());
    }
    }
}
}