summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nupur Saxena <nupursn@google.com> 2023-05-03 13:47:15 +0000
committer Nupur Saxena <nupursn@google.com> 2023-05-05 10:58:07 +0000
commit4d6eca5b36aed0cba7143e0e678318a4755c29db (patch)
tree4ddb7c42235032b4f8fa12c878b2a5196f5b2b01
parent3a9a83dad9a0822255cf96410d1004806673cb30 (diff)
Add timeout to removeAccount during provisioning
Bug: http://b/279192742 Change-Id: I909bf2f38b9d09addaf768fd86bd3910b0a82d2f (cherry picked from commit 378627c451e684d5f70cc41c1026c481780f8237)
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index debfedcd1806..d2db84c4c87e 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -21814,10 +21814,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
final AccountManager accountManager = mContext.createContextAsUser(
UserHandle.of(sourceUserId), /* flags= */ 0)
.getSystemService(AccountManager.class);
- final AccountManagerFuture<Bundle> bundle = accountManager.removeAccount(account,
- null, null /* callback */, null /* handler */);
try {
- final Bundle result = bundle.getResult();
+ final Bundle result = accountManager.removeAccount(account,
+ null, null /* callback */, null /* handler */).getResult(60, TimeUnit.SECONDS);
if (result.getBoolean(AccountManager.KEY_BOOLEAN_RESULT, /* default */ false)) {
Slogf.i(LOG_TAG, "Account removed from the primary user.");
} else {