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

Commit c068aafa authored by Calvin On's avatar Calvin On Committed by William Escande
Browse files

Unregister callback on unregisterAppUid.

Bug: 263323082
Bug: 199827901
Tag: #stability
Test: atest 'HidDeviceTest#testCallbacks'
Change-Id: Ib0065cc4d85bbd914b07f17080227ada969cbb44
parent f18221f5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -620,6 +620,7 @@ public class HidDeviceService extends ProfileService {

        if (mUserUid != 0 && (uid == mUserUid || uid < Process.FIRST_APPLICATION_UID)) {
            mUserUid = 0;
            mCallback = null;
            return mHidDeviceNativeInterface.unregisterApp();
        }
        if (DBG) {
+5 −1
Original line number Diff line number Diff line
@@ -528,6 +528,10 @@ public class HidDeviceTest {
        verify(mHidDeviceNativeInterface).unregisterApp();

        mHidDeviceService.onApplicationStateChangedFromNative(mTestDevice, false);
        verifyCallback(TIMEOUT_MS, CALLBACK_APP_UNREGISTERED, mCallbackQueue);
        Assert.assertThrows(
                AssertionError.class,
                () -> verifyCallback(TIMEOUT_MS, CALLBACK_APP_UNREGISTERED, mCallbackQueue)
        );

    }
}