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

Commit b166fced authored by hupengcheng's avatar hupengcheng Committed by Hung-ying Tyan
Browse files

Fix for run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest

For dual vibrator device, the AOSP code needs to be adjusted as follow.

Bug: 209932477
Test:
run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest#testVibrateComposed
run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest#testVibratorIsVibrating
run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest#testVibrateMultiThread
run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest#testVibratorVibratesNoLongerThanDuration
run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest#testVibrateOneShot
run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest#testVibratorStateCallback
run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest#testVibratePattern
run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest#testVibratePredefined
run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest#testVibrateWaveform
run cts-on-gsi -m CtsOsTestCases -t android.os.cts.VibratorTest#testVibratorCancel

Change-Id: I31afc8179acb4f7749b1208f3abd13a1941a01b2
parent 40eb4030
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -389,7 +389,7 @@ public class SystemVibrator extends Vibrator {
            mExecutor.execute(() -> {
                boolean anyVibrating;
                synchronized (mLock) {
                    int allInitializedMask = 1 << mVibratorListeners.size() - 1;
                    int allInitializedMask = (1 << mVibratorListeners.size()) - 1;
                    int vibratorMask = 1 << vibratorIdx;
                    if ((mInitializedMask & vibratorMask) == 0) {
                        // First state report for this vibrator, set vibrating initial value.