I am using an app installed of a closed testers (google play) path, when I start I get error. Is it because I'm using the app as closed testers, or is there a bug in my appUpdateManager code?
2021-07-08 23:09:35.053 12389-12389/? I/PlayCore: UID: [10225] PID: [12389] AppUpdateService : requestUpdateInfo(com.testdev.test)
2021-07-08 23:09:35.054 12389-12444/? I/PlayCore: UID: [10225] PID: [12389] AppUpdateService : Initiate binding to the service.
2021-07-08 23:09:35.108 12389-12389/? I/PlayCore: UID: [10225] PID: [12389] AppUpdateService : ServiceConnectionImpl.onServiceConnected(ComponentInfo{com.android.vending/com.google.android.finsky.installservice.DevTriggeredUpdateService})
2021-07-08 23:09:35.109 12389-12444/? I/PlayCore: UID: [10225] PID: [12389] AppUpdateService : linkToDeath
2021-07-08 23:09:35.116 12389-12400/? I/PlayCore: UID: [10225] PID: [12389] OnRequestInstallCallback : onRequestInfo
2021-07-08 23:09:35.116 12389-12444/? I/PlayCore: UID: [10225] PID: [12389] AppUpdateService : Unbind from service.
MainActivity:
private static final int REQUEST_APP_UPDATE = 11;
appUpdateManager
.getAppUpdateInfo()
.addOnSuccessListener(
appUpdateInfo -> {
// Checks that the platform will allow the specified type of update.
if ((appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE)
&& appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.IMMEDIATE))
{
// Request the update.
try {
appUpdateManager.startUpdateFlowForResult(
appUpdateInfo,
AppUpdateType.IMMEDIATE,
this,
REQUEST_APP_UPDATE);
} catch (IntentSender.SendIntentException e) {
e.printStackTrace();
}
}
});