diff options
| author | 2019-02-27 13:55:38 -0700 | |
|---|---|---|
| committer | 2019-02-27 13:55:42 -0700 | |
| commit | b50f51e604d11afcf287c9980f8b087290a80124 (patch) | |
| tree | a4e4ec0ca1b2e1bd1d79277e48a45ab3fcd1ba16 | |
| parent | ab864c6dd358cb2b54f85ed31603871251e0086e (diff) | |
Translate SecurityException into EACCES.
Gives more consistent experience for code expecting errno values.
Bug: 122092631
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I74f27ae33adca69a563d9d8cfc4cf9bb186e1750
| -rw-r--r-- | core/java/android/app/ActivityThread.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 92302c501caf..b18c4de93b40 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -6954,6 +6954,8 @@ public final class ActivityThread extends ClientTransactionHandler { fd.setInt$(cr.openFileDescriptor(uri, FileUtils.translateModePosixToString(mode)).detachFd()); return fd; + } catch (SecurityException e) { + throw new ErrnoException(e.getMessage(), OsConstants.EACCES); } catch (FileNotFoundException e) { throw new ErrnoException(e.getMessage(), OsConstants.ENOENT); } |