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

Commit bc97bfcb authored by Yuting Fang's avatar Yuting Fang Committed by Android (Google) Code Review
Browse files

Merge "[BugFix] Always include default device id when getting all device ids" into main

parents 213ba354 d6bad3e1
Loading
Loading
Loading
Loading
+8 −10
Original line number Diff line number Diff line
@@ -1110,12 +1110,12 @@ public class AppOpsService extends IAppOpsService.Stub {
                        final String changedPkg = changedPkgs[i];
                        // We trust packagemanager to insert matching uid and packageNames in the
                        // extras
                        Set<String> devices;
                        if (mVirtualDeviceManagerInternal != null) {
                            devices = mVirtualDeviceManagerInternal.getAllPersistentDeviceIds();
                        } else {
                            devices = new ArraySet<>();
                        Set<String> devices = new ArraySet<>();
                        devices.add(PERSISTENT_DEVICE_ID_DEFAULT);

                        if (mVirtualDeviceManagerInternal != null) {
                            devices.addAll(
                                    mVirtualDeviceManagerInternal.getAllPersistentDeviceIds());
                        }
                        for (String device: devices) {
                            notifyOpChanged(onModeChangedListeners, code, changedUid, changedPkg,
@@ -2609,12 +2609,10 @@ public class AppOpsService extends IAppOpsService.Stub {
                ArrayList<ChangeRec> reports = ent.getValue();
                for (int i=0; i<reports.size(); i++) {
                    ChangeRec rep = reports.get(i);
                    Set<String> devices;
                    if (mVirtualDeviceManagerInternal != null) {
                        devices = mVirtualDeviceManagerInternal.getAllPersistentDeviceIds();
                    } else {
                        devices = new ArraySet<>();
                    Set<String> devices = new ArraySet<>();
                    devices.add(PERSISTENT_DEVICE_ID_DEFAULT);
                    if (mVirtualDeviceManagerInternal != null) {
                        devices.addAll(mVirtualDeviceManagerInternal.getAllPersistentDeviceIds());
                    }
                    for (String device: devices) {
                        mHandler.sendMessage(PooledLambda.obtainMessage(