[DO NOT MERGE] Guard against launching permission backup/restore twice per request
It looks like there is some case where AbstractRemoteService would #run the same PendingRequest the second time which violates AsyncTask assumption. Fixes: 135986503 Test: atest android.permission.cts.PermissionControllerTest Change-Id: I2d072714ee0fad3c365ff7eb191d690056c0931a
This commit is contained in:
@@ -808,6 +808,9 @@ public final class PermissionControllerManager {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (mBackupReader.getStatus() != AsyncTask.Status.PENDING) {
|
||||
return;
|
||||
}
|
||||
mBackupReader.execute();
|
||||
|
||||
ParcelFileDescriptor remotePipe = mBackupReader.getRemotePipe();
|
||||
@@ -919,6 +922,9 @@ public final class PermissionControllerManager {
|
||||
|
||||
@Override
|
||||
public void run(@NonNull IPermissionController service) {
|
||||
if (mBackupSender.getStatus() != AsyncTask.Status.PENDING) {
|
||||
return;
|
||||
}
|
||||
mBackupSender.execute(mBackup);
|
||||
|
||||
ParcelFileDescriptor remotePipe = mBackupSender.getRemotePipe();
|
||||
|
||||
Reference in New Issue
Block a user