Skip to content

Commit a8b5636

Browse files
author
yuemingw
committed
Put back post launch intent since ACTION_PROFILE_PROVISIONING_COMPLETE
broadcast has been removed from admin integrated flow. Bug: 122721268 Test: manual Change-Id: Id9f560aba72ab10b340a1270b46194434e01ba63
1 parent 7313116 commit a8b5636

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

app/src/main/java/com/afwsamples/testdpc/DeviceAdminReceiver.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,16 @@ public void onProfileProvisioningComplete(Context context, Intent intent) {
121121
if (!task.performPostProvisioningOperations(intent)) {
122122
return;
123123
}
124+
125+
final Intent launchIntent = task.getPostProvisioningLaunchIntent(intent);
126+
if (launchIntent != null) {
127+
context.startActivity(launchIntent);
128+
} else {
129+
Log.e(TAG, "DeviceAdminReceiver.onProvisioningComplete() invoked, but ownership "
130+
+ "not assigned");
131+
Toast.makeText(context, R.string.device_admin_receiver_failure, Toast.LENGTH_LONG)
132+
.show();
133+
}
124134
}
125135

126136
@TargetApi(Build.VERSION_CODES.N)

0 commit comments

Comments
 (0)