summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tianjie Xu <xunchang@google.com> 2021-04-21 03:34:25 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2021-04-21 03:34:25 +0000
commitffbcac67abb13e8f4208ba4d10b23df1afacb34e (patch)
tree4503186a75cb99a5d90d07e8482e3e771820553b
parent3bad1d413eb9eb7e9d0b7b2515b03bf487ab0b28 (diff)
parent27dcfb808c87b49c56321eafe4ba88a19df66b16 (diff)
Merge "Catch security exceptions in RoR APIs" am: 27dcfb808c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1651270 Change-Id: I4f06dc0b0dc5ae9ba252251f25b7a63cee0909ec
-rw-r--r--core/java/android/os/RecoverySystem.java21
1 files changed, 10 insertions, 11 deletions
diff --git a/core/java/android/os/RecoverySystem.java b/core/java/android/os/RecoverySystem.java
index b474d7c95996..051447f9219b 100644
--- a/core/java/android/os/RecoverySystem.java
+++ b/core/java/android/os/RecoverySystem.java
@@ -1423,8 +1423,8 @@ public class RecoverySystem {
private boolean requestLskf(String packageName, IntentSender sender) throws IOException {
try {
return mService.requestLskf(packageName, sender);
- } catch (RemoteException e) {
- throw new IOException("could request LSKF capture");
+ } catch (RemoteException | SecurityException e) {
+ throw new IOException("could not request LSKF capture", e);
}
}
@@ -1437,8 +1437,8 @@ public class RecoverySystem {
private boolean clearLskf(String packageName) throws IOException {
try {
return mService.clearLskf(packageName);
- } catch (RemoteException e) {
- throw new IOException("could not clear LSKF");
+ } catch (RemoteException | SecurityException e) {
+ throw new IOException("could not clear LSKF", e);
}
}
@@ -1452,8 +1452,8 @@ public class RecoverySystem {
private boolean isLskfCaptured(String packageName) throws IOException {
try {
return mService.isLskfCaptured(packageName);
- } catch (RemoteException e) {
- throw new IOException("could not get LSKF capture state");
+ } catch (RemoteException | SecurityException e) {
+ throw new IOException("could not get LSKF capture state", e);
}
}
@@ -1465,12 +1465,11 @@ public class RecoverySystem {
boolean slotSwitch) throws IOException {
try {
return mService.rebootWithLskf(packageName, reason, slotSwitch);
- } catch (RemoteException e) {
- throw new IOException("could not reboot for update");
+ } catch (RemoteException | SecurityException e) {
+ throw new IOException("could not reboot for update", e);
}
}
-
/**
* Calls the recovery system service to reboot and apply update. This is the legacy API and
* expects a slot switch for A/B devices.
@@ -1480,8 +1479,8 @@ public class RecoverySystem {
String reason) throws IOException {
try {
return mService.rebootWithLskfAssumeSlotSwitch(packageName, reason);
- } catch (RemoteException e) {
- throw new IOException("could not reboot for update");
+ } catch (RemoteException | RuntimeException e) {
+ throw new IOException("could not reboot for update", e);
}
}