diff options
| author | Jeff Sharkey <jsharkey@android.com> | 2020-10-06 14:54:58 -0600 |
|---|---|---|
| committer | Jeff Sharkey <jsharkey@android.com> | 2020-10-07 21:24:05 -0600 |
| commit | b93712f623e29ba7beec2253a239be3129f4100a (patch) | |
| tree | 6c7b90c266e938d037442b7b50193922c8cada9d /core/java/android/os/Looper.java | |
| parent | b381789fa8a8225858531f33ecc9815b367e2aee (diff) | |
Tighten up Binder.clearCallingIdentity() usage.
This is a third CL in a chain that adjusts existing malformed code
to follow AndroidFrameworkBinderIdentity best-practices.
Specifically, if a thread clears an identity they need to restore it
to avoid obscure security vulnerabilities. In addition, the relevant
"try" block must start immediately after the identity is cleared to
ensure that its restored if/when any exceptions are thrown.
Bug: 155703208
Test: make
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: I74cb958b68d55a647547aae21baff6ddc364859b
Diffstat (limited to 'core/java/android/os/Looper.java')
| -rw-r--r-- | core/java/android/os/Looper.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/java/android/os/Looper.java b/core/java/android/os/Looper.java index b05ea39850f8..c39fd4d1bc43 100644 --- a/core/java/android/os/Looper.java +++ b/core/java/android/os/Looper.java @@ -155,6 +155,7 @@ public final class Looper { /** * Poll and deliver single message, return true if the outer loop should continue. */ + @SuppressWarnings("AndroidFrameworkBinderIdentity") private static boolean loopOnce(final Looper me, final long ident, final int thresholdOverride) { Message msg = me.mQueue.next(); // might block @@ -255,6 +256,7 @@ public final class Looper { * Run the message queue in this thread. Be sure to call * {@link #quit()} to end the loop. */ + @SuppressWarnings("AndroidFrameworkBinderIdentity") public static void loop() { final Looper me = myLooper(); if (me == null) { |
