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

Commit b62fbaf4 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

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

Change-Id: Ibddbc9758169d8e201083085a900e4b38c4cf62f
parents 699dcf20 8b5f287d
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());
    }
    }
}
}