resolved conflicts for merge of 964eb438
to master
Change-Id: I0c54d6b88356d8734d7f51234b0114434414502e
This commit is contained in:
@ -17,6 +17,7 @@
|
||||
package com.android.server;
|
||||
|
||||
import com.android.internal.content.PackageMonitor;
|
||||
import com.android.internal.os.storage.ExternalStorageFormatter;
|
||||
import com.android.internal.util.FastXmlSerializer;
|
||||
import com.android.internal.util.JournaledFile;
|
||||
import com.android.internal.util.XmlUtils;
|
||||
@ -42,6 +43,7 @@ import android.content.pm.PackageManager.NameNotFoundException;
|
||||
import android.os.Binder;
|
||||
import android.os.IBinder;
|
||||
import android.os.IPowerManager;
|
||||
import android.os.PowerManager;
|
||||
import android.os.RecoverySystem;
|
||||
import android.os.RemoteCallback;
|
||||
import android.os.RemoteException;
|
||||
@ -76,6 +78,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
||||
|
||||
final Context mContext;
|
||||
final MyPackageMonitor mMonitor;
|
||||
final PowerManager.WakeLock mWakeLock;
|
||||
|
||||
IPowerManager mIPowerManager;
|
||||
|
||||
@ -343,6 +346,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
||||
mContext = context;
|
||||
mMonitor = new MyPackageMonitor();
|
||||
mMonitor.register(context, true);
|
||||
mWakeLock = ((PowerManager)context.getSystemService(Context.POWER_SERVICE))
|
||||
.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "DPM");
|
||||
}
|
||||
|
||||
private IPowerManager getIPowerManager() {
|
||||
@ -1345,10 +1350,17 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
||||
}
|
||||
|
||||
void wipeDataLocked(int flags) {
|
||||
try {
|
||||
RecoverySystem.rebootWipeUserData(mContext);
|
||||
} catch (IOException e) {
|
||||
Slog.w(TAG, "Failed requesting data wipe", e);
|
||||
if ((flags&DevicePolicyManager.WIPE_EXTERNAL_STORAGE) != 0) {
|
||||
Intent intent = new Intent(ExternalStorageFormatter.FORMAT_AND_FACTORY_RESET);
|
||||
intent.setComponent(ExternalStorageFormatter.COMPONENT_NAME);
|
||||
mWakeLock.acquire(10000);
|
||||
mContext.startService(intent);
|
||||
} else {
|
||||
try {
|
||||
RecoverySystem.rebootWipeUserData(mContext);
|
||||
} catch (IOException e) {
|
||||
Slog.w(TAG, "Failed requesting data wipe", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user