You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is not related to android-testdpc itself but related to DeviceAdminReceiver class.
I have done exactly the same things in my app as in testdpc app to create a work profile but as the title says DeviceAdminReceiver.onProfileProvisioningComplete() is never getting called.
This issue is even acknowledged in android-testdpcsource code but given some issue link which I don't know how to open because it is not a valid link. I also tried opening https://issuetracker.google.com/issues/177617306 but for some reason I don't have access to view that issue.
I want to understand if this is a know issue, what's the workaround or some alternative?
The text was updated successfully, but these errors were encountered:
well something like this, I just discovered it, maybe not 100% correct but worth a try!
class CompletionActivity : ComponentActivity() {
private val postProvisionJob: PostProvisionJob by inject()
private val devicePolicyManager: DevicePolicyManager by inject()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (Util.isProfileOwner(this)) { // This is true only after DevicePolicyManager.setProfileEnabled().
showToast(
this,
javaClass.getSimpleName() + " should not be started after provisioning."
)
return
}
if (!postProvisionJob.invoke(intent)) {
return
}
getPostProvisioningLaunchIntent(intent, this, devicePolicyManager)?.let { launchIntent ->
startActivity(launchIntent)
} ?: run {
showToast(
this,
"CompletionActivity.onProvisioningComplete() invoked, but ownership " + "not assigned"
)
}
}
}
This issue is not related to
android-testdpc
itself but related toDeviceAdminReceiver
class.I have done exactly the same things in my app as in testdpc app to create a work profile but as the title says
DeviceAdminReceiver.onProfileProvisioningComplete()
is never getting called.This issue is even acknowledged in
android-testdpc
source code but given some issue link which I don't know how to open because it is not a valid link. I also tried opening https://issuetracker.google.com/issues/177617306 but for some reason I don't have access to view that issue.I want to understand if this is a know issue, what's the workaround or some alternative?
The text was updated successfully, but these errors were encountered: