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

Commit 92790707 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "HIDD: Fix the logic in unregisterApp()"

parents 095bf6ed 1ac56496
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -531,15 +531,7 @@ public class HidDeviceService extends ProfileService {
        }

        int callingUid = Binder.getCallingUid();

        if (callingUid == mUserUid || callingUid < Process.FIRST_APPLICATION_UID) {
            mUserUid = 0;
            return mHidDeviceNativeInterface.unregisterApp();
        }
        if (DBG) {
            Log.d(TAG, "unregisterAppUid(): caller UID doesn't match user UID");
        }
        return false;
        return unregisterAppUid(callingUid);
    }

    private synchronized boolean unregisterAppUid(int uid) {
@@ -547,10 +539,13 @@ public class HidDeviceService extends ProfileService {
            Log.d(TAG, "unregisterAppUid(): uid=" + uid);
        }

        if (uid == mUserUid) {
        if (mUserUid != 0 && (uid == mUserUid || uid < Process.FIRST_APPLICATION_UID)) {
            mUserUid = 0;
            return mHidDeviceNativeInterface.unregisterApp();
        }
        if (DBG) {
            Log.d(TAG, "unregisterAppUid(): caller UID doesn't match user UID");
        }
        return false;
    }