OSDN Git Service

Potential fix for accidental deactivation of profile owner
authorAmith Yamasani <yamasani@google.com>
Thu, 4 Dec 2014 22:49:24 +0000 (14:49 -0800)
committerAmith Yamasani <yamasani@google.com>
Thu, 4 Dec 2014 22:49:24 +0000 (14:49 -0800)
commita0116afeaf9363c5a662624dda77b550aa9172a8
tree7fa215a10de8ffd760d13296ef771dbef2fa5f70
parent6ca3ba73b78be57dd50fe5813f076b3e166cc659
Potential fix for accidental deactivation of profile owner

This is a safeguard to only check for changing packages when
re-validating active admins.
1. If package is being removed, only check if it's not being
   replaced.
2. If package is changing, only check the changing package that
   matches one of the active admins.
3. If package is being added and is a replacement (update), then
   check if it affects any matching active admins and verify the
   validity of the receivers.

If by any chance some package broadcast was occuring at a time when
an admin was being updated, or the package removed broadcast was
coming in much before the update was registered with package manager
then this will help in avoiding accidental deactivation.

Bug: 18590558
Change-Id: I7f4897e8836f81aa037b8be87d399942ce78b1a2
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java