From 075d34947fe2ed402997828794bdd99b59bc79ac Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Sat, 17 Apr 2010 14:57:36 -0700 Subject: [PATCH] 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 --- src/com/android/exchange/EasSyncService.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/android/exchange/EasSyncService.java b/src/com/android/exchange/EasSyncService.java index 43ebb2dee..4399d50f6 100644 --- a/src/com/android/exchange/EasSyncService.java +++ b/src/com/android/exchange/EasSyncService.java @@ -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 {