summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jonathan Scott <scottjonathan@google.com> 2022-12-13 13:47:07 +0000
committer Jonathan Scott <scottjonathan@google.com> 2022-12-15 20:23:52 +0000
commita3d321a176095ac2c39f00bb5bb1de892bde38ca (patch)
tree7b9df90580f012ffc0840fa531edbbed08b7b620
parent89d3375fae67ea1cab8458e0a8e771c6ddecbb6c (diff)
Don't supress failures in adopting shell permission identity.
This is required as we've seen recent flakiness in our tests where the only way to find out the root cause (DeadObjectException when adopting permissions) is to look in logcat. Test: btest CtsDevicePolicyTestCases Bug: 262371074 Change-Id: I2291984c77494a4afca0e403938e75cab1363ba6
-rw-r--r--core/java/android/app/UiAutomation.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/core/java/android/app/UiAutomation.java b/core/java/android/app/UiAutomation.java
index 814f38b2f3e6..e75b503d5f69 100644
--- a/core/java/android/app/UiAutomation.java
+++ b/core/java/android/app/UiAutomation.java
@@ -76,7 +76,6 @@ import java.io.IOException;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeoutException;
@@ -484,7 +483,7 @@ public final class UiAutomation {
// Calling out without a lock held.
mUiAutomationConnection.adoptShellPermissionIdentity(Process.myUid(), null);
} catch (RemoteException re) {
- Log.e(LOG_TAG, "Error executing adopting shell permission identity!", re);
+ throw re.rethrowFromSystemServer();
}
}
@@ -509,7 +508,7 @@ public final class UiAutomation {
// Calling out without a lock held.
mUiAutomationConnection.adoptShellPermissionIdentity(Process.myUid(), permissions);
} catch (RemoteException re) {
- Log.e(LOG_TAG, "Error executing adopting shell permission identity!", re);
+ throw re.rethrowFromSystemServer();
}
}
@@ -525,7 +524,7 @@ public final class UiAutomation {
// Calling out without a lock held.
mUiAutomationConnection.dropShellPermissionIdentity();
} catch (RemoteException re) {
- Log.e(LOG_TAG, "Error executing dropping shell permission identity!", re);
+ throw re.rethrowFromSystemServer();
}
}
@@ -543,8 +542,7 @@ public final class UiAutomation {
final List<String> permissions = mUiAutomationConnection.getAdoptedShellPermissions();
return permissions == null ? ALL_PERMISSIONS : new ArraySet<>(permissions);
} catch (RemoteException re) {
- Log.e(LOG_TAG, "Error getting adopted shell permissions", re);
- return Collections.emptySet();
+ throw re.rethrowFromSystemServer();
}
}