Commit 362e215e authored by Alan Treadway's avatar Alan Treadway Committed by Android (Google) Code Review
Browse files

Merge "Ensure ManagedProvisioning finish() calls set result code." into mnc-dev

parents 9c64d6b5 caeb2381
......@@ -125,7 +125,6 @@ public class DeviceOwnerPreProvisioningActivity extends SetupLayoutActivity
|| SystemProperties.getBoolean("persist.sys.no_req_encrypt", false)
|| mParams.skipEncryption)) {
requestEncryption(parser, mParams);
finish();
return;
// System will reboot. Bootreminder will restart this activity.
}
......@@ -275,11 +274,13 @@ public class DeviceOwnerPreProvisioningActivity extends SetupLayoutActivity
if (requestCode == ENCRYPT_DEVICE_REQUEST_CODE) {
if (resultCode == RESULT_CANCELED) {
ProvisionLogger.loge("User canceled device encryption.");
setResult(RESULT_CANCELED);
finish();
}
} else if (requestCode == WIFI_REQUEST_CODE) {
if (resultCode == RESULT_CANCELED) {
ProvisionLogger.loge("User canceled wifi picking.");
setResult(RESULT_CANCELED);
finish();
} else if (resultCode == RESULT_OK) {
if (DEBUG) ProvisionLogger.logd("Wifi request result is OK");
......
......@@ -230,7 +230,8 @@ public class DeviceOwnerProvisioningActivity extends SetupLayoutActivity {
"DeviceOwnerProvisioningActivity.showCancelResetDialog()");
sendBroadcast(intent);
stopService(new Intent(DeviceOwnerProvisioningActivity.this,
DeviceOwnerProvisioningService.class));
DeviceOwnerProvisioningService.class));
setResult(RESULT_CANCELED);
finish();
}
})
......@@ -270,6 +271,7 @@ public class DeviceOwnerProvisioningActivity extends SetupLayoutActivity {
sendBroadcast(intent);
stopService(new Intent(DeviceOwnerProvisioningActivity.this,
DeviceOwnerProvisioningService.class));
setResult(RESULT_CANCELED);
finish();
}
});
......@@ -283,6 +285,7 @@ public class DeviceOwnerProvisioningActivity extends SetupLayoutActivity {
// Close activity.
stopService(new Intent(DeviceOwnerProvisioningActivity.this,
DeviceOwnerProvisioningService.class));
setResult(RESULT_CANCELED);
finish();
}
});
......
......@@ -299,6 +299,7 @@ public class ProfileOwnerPreProvisioningActivity extends SetupLayoutActivity
@Override
public void onRemoveProfileCancel() {
setResult(Activity.RESULT_CANCELED);
finish();
}
......
......@@ -179,10 +179,9 @@ public class ProfileOwnerProvisioningActivity extends SetupLayoutActivity {
}
private void onProvisioningAborted() {
ProfileOwnerProvisioningActivity.this.setResult(Activity.RESULT_CANCELED);
stopService(new Intent(ProfileOwnerProvisioningActivity.this,
ProfileOwnerProvisioningService.class));
ProfileOwnerProvisioningActivity.this.finish();
stopService(new Intent(this, ProfileOwnerProvisioningService.class));
setResult(Activity.RESULT_CANCELED);
finish();
}
@Override
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment