Add admin check before trying a remote wipe

* The code assumed that if we asked for a remote wipe, that it would
  be executed.  This isn't the case, however, if we're not a device
  admin at that time
* Test for Email app as device administrator before trying remote wipe

Bug: 2603931
Change-Id: I09dcff00e77bcf1e40c742c9dee923e6e07eecae
This commit is contained in:
Marc Blank 2010-04-17 14:57:36 -07:00
parent a90bb03c25
commit 075d34947f

View File

@ -1180,6 +1180,8 @@ public class EasSyncService extends AbstractSyncService {
}
if (pp.getRemoteWipe()) {
// We've gotten a remote wipe command
// If we're not the admin, we can't do the wipe, so just return
if (!sp.isActiveAdmin()) return false;
// First, we've got to acknowledge it, but wrap the wipe in try/catch so that
// we wipe the device regardless of any errors in acknowledgment
try {