Skip to content

Commit 09de3ea

Browse files
TreeHugger RobotAndroid (Google) Code Review
authored andcommitted
Merge "Put back post launch intent since ACTION_PROFILE_PROVISIONING_COMPLETE broadcast has been removed from admin integrated flow." into ub-testdpc-qt
2 parents 2875cd7 + a8b5636 commit 09de3ea

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)