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

Commit 6e1c17a3 authored by Rubin Xu's avatar Rubin Xu Committed by Android (Google) Code Review
Browse files

Merge "clear caller identify before sending system update notification" into mnc-dev

parents 3d528698 2c84cc2e
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -6345,10 +6345,16 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                return;
            }

            ActivityInfo[] receivers = null;
            try {
                ActivityInfo[] receivers  = mContext.getPackageManager().getPackageInfo(
                receivers  = mContext.getPackageManager().getPackageInfo(
                        deviceOwnerPackage, PackageManager.GET_RECEIVERS).receivers;
            } catch (NameNotFoundException e) {
                Log.e(LOG_TAG, "Cannot find device owner package", e);
            }
            if (receivers != null) {
                long ident = Binder.clearCallingIdentity();
                try {
                    for (int i = 0; i < receivers.length; i++) {
                        if (permission.BIND_DEVICE_ADMIN.equals(receivers[i].permission)) {
                            intent.setComponent(new ComponentName(deviceOwnerPackage,
@@ -6356,9 +6362,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                            mContext.sendBroadcastAsUser(intent, UserHandle.OWNER);
                        }
                    }
                } finally {
                    Binder.restoreCallingIdentity(ident);
                }
            } catch (NameNotFoundException e) {
                Log.e(LOG_TAG, "Cannot find device owner package", e);
            }
        }
    }