resolved conflicts for merge of 79ee0a9a to master

Change-Id: I110bd412e38358b3d99235bf10fd9d1022aa04e9
This commit is contained in:
Kenny Root
2010-10-18 13:56:13 -07:00
3 changed files with 26 additions and 5 deletions

View File

@@ -186,6 +186,13 @@
android:text="@string/wipe_data"> android:text="@string/wipe_data">
</Button> </Button>
<Button android:id="@+id/wipe_all_data"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0"
android:text="@string/wipe_all_data">
</Button>
</LinearLayout> </LinearLayout>
<LinearLayout android:orientation="horizontal" android:gravity="center" <LinearLayout android:orientation="horizontal" android:gravity="center"

View File

@@ -537,6 +537,7 @@
<string name="max_failed_pw_hint">Password Attempts Wipe Data</string> <string name="max_failed_pw_hint">Password Attempts Wipe Data</string>
<string name="force_lock">Force Lock</string> <string name="force_lock">Force Lock</string>
<string name="wipe_data">Wipe Data</string> <string name="wipe_data">Wipe Data</string>
<string name="wipe_all_data">Wipe All Data</string>
<string name="timeout_hint">Max screen timeout</string> <string name="timeout_hint">Max screen timeout</string>
<string name="set_timeout_label">Set Timeout</string> <string name="set_timeout_label">Set Timeout</string>
<string name="proxyhost_hint">Global proxyhost:port</string> <string name="proxyhost_hint">Global proxyhost:port</string>

View File

@@ -148,6 +148,7 @@ public class DeviceAdminSample extends DeviceAdminReceiver {
Button mForceLockButton; Button mForceLockButton;
Button mWipeDataButton; Button mWipeDataButton;
Button mWipeAllDataButton;
private Button mTimeoutButton; private Button mTimeoutButton;
@@ -323,6 +324,8 @@ public class DeviceAdminSample extends DeviceAdminReceiver {
mForceLockButton.setOnClickListener(mForceLockListener); mForceLockButton.setOnClickListener(mForceLockListener);
mWipeDataButton = (Button)findViewById(R.id.wipe_data); mWipeDataButton = (Button)findViewById(R.id.wipe_data);
mWipeDataButton.setOnClickListener(mWipeDataListener); mWipeDataButton.setOnClickListener(mWipeDataListener);
mWipeAllDataButton = (Button)findViewById(R.id.wipe_all_data);
mWipeAllDataButton.setOnClickListener(mWipeDataListener);
mTimeout = (EditText) findViewById(R.id.timeout); mTimeout = (EditText) findViewById(R.id.timeout);
mTimeoutButton = (Button) findViewById(R.id.set_timeout); mTimeoutButton = (Button) findViewById(R.id.set_timeout);
@@ -353,6 +356,7 @@ public class DeviceAdminSample extends DeviceAdminReceiver {
mResetPasswordButton.setEnabled(true); mResetPasswordButton.setEnabled(true);
mForceLockButton.setEnabled(true); mForceLockButton.setEnabled(true);
mWipeDataButton.setEnabled(true); mWipeDataButton.setEnabled(true);
mWipeAllDataButton.setEnabled(true);
} else { } else {
mEnableButton.setEnabled(true); mEnableButton.setEnabled(true);
mDisableButton.setEnabled(false); mDisableButton.setEnabled(false);
@@ -370,6 +374,7 @@ public class DeviceAdminSample extends DeviceAdminReceiver {
mResetPasswordButton.setEnabled(false); mResetPasswordButton.setEnabled(false);
mForceLockButton.setEnabled(false); mForceLockButton.setEnabled(false);
mWipeDataButton.setEnabled(false); mWipeDataButton.setEnabled(false);
mWipeAllDataButton.setEnabled(false);
} }
} }
@@ -576,7 +581,7 @@ public class DeviceAdminSample extends DeviceAdminReceiver {
}; };
private OnClickListener mWipeDataListener = new OnClickListener() { private OnClickListener mWipeDataListener = new OnClickListener() {
public void onClick(View v) { public void onClick(final View v) {
if (mAM.isUserAMonkey()) { if (mAM.isUserAMonkey()) {
// Don't trust monkeys to do the right thing! // Don't trust monkeys to do the right thing!
AlertDialog.Builder builder = new AlertDialog.Builder(Controller.this); AlertDialog.Builder builder = new AlertDialog.Builder(Controller.this);
@@ -590,14 +595,22 @@ public class DeviceAdminSample extends DeviceAdminReceiver {
builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() { builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
AlertDialog.Builder builder = new AlertDialog.Builder(Controller.this); AlertDialog.Builder builder = new AlertDialog.Builder(Controller.this);
builder.setMessage("This is not a test. " if (v == mWipeAllDataButton) {
+ "This WILL erase all of your data! " builder.setMessage("This is not a test. "
+ "Are you really absolutely sure?"); + "This WILL erase all of your data, "
+ "including external storage! "
+ "Are you really absolutely sure?");
} else {
builder.setMessage("This is not a test. "
+ "This WILL erase all of your data! "
+ "Are you really absolutely sure?");
}
builder.setPositiveButton("BOOM!", new DialogInterface.OnClickListener() { builder.setPositiveButton("BOOM!", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
boolean active = mDPM.isAdminActive(mDeviceAdminSample); boolean active = mDPM.isAdminActive(mDeviceAdminSample);
if (active) { if (active) {
mDPM.wipeData(0); mDPM.wipeData(v == mWipeAllDataButton
? DevicePolicyManager.WIPE_EXTERNAL_STORAGE : 0);
} }
} }
}); });