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

Commit ce7586b5 authored by Android Build Prod User's avatar Android Build Prod User Committed by Automerger Merge Worker
Browse files

Merge "Initial udfps vibration should always play" into sc-qpr1-dev am: 8b5f287d am: b62fbaf4

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15675980

Change-Id: I240ebb39204326b0d428edcdf5acfc552e5f6e1d
parents 4e011915 b62fbaf4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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 =
+7 −0
Original line number Diff line number Diff line
@@ -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());
    }
}