diff options
author | Brad Fitzpatrick <bradfitz@android.com> | 2010-07-07 16:06:39 -0700 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@android.com> | 2010-07-15 13:18:05 -0700 |
commit | 727de40c6bc7c6521a0542ea9def5d5c7b1c5e06 (patch) | |
tree | 0d2f0f400211efbaf131020d7c4d38e647f5bbe3 /core/java/android/os/Binder.java | |
parent | d6343c26b8580f61a257a3045bfa124049201116 (diff) | |
download | frameworks_base-727de40c6bc7c6521a0542ea9def5d5c7b1c5e06.zip frameworks_base-727de40c6bc7c6521a0542ea9def5d5c7b1c5e06.tar.gz frameworks_base-727de40c6bc7c6521a0542ea9def5d5c7b1c5e06.tar.bz2 |
More StrictMode work, keeping Binder & BlockGuard's thread-locals in-sync.
Change-Id: Ia67cabcc17a73a0f15907ffea683d06bc41b90e5
Diffstat (limited to 'core/java/android/os/Binder.java')
-rw-r--r-- | core/java/android/os/Binder.java | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/core/java/android/os/Binder.java b/core/java/android/os/Binder.java index c9df567..4c40982 100644 --- a/core/java/android/os/Binder.java +++ b/core/java/android/os/Binder.java @@ -101,7 +101,30 @@ public class Binder implements IBinder { * @see #clearCallingIdentity */ public static final native void restoreCallingIdentity(long token); - + + /** + * Sets the native thread-local StrictMode policy mask. + * + * <p>The StrictMode settings are kept in two places: a Java-level + * threadlocal for libcore/Dalvik, and a native threadlocal (set + * here) for propagation via Binder calls. This is a little + * unfortunate, but necessary to break otherwise more unfortunate + * dependencies either of Dalvik on Android, or Android + * native-only code on Dalvik. + * + * @see StrictMode + * @hide + */ + public static final native void setThreadStrictModePolicy(int policyMask); + + /** + * Gets the current native thread-local StrictMode policy mask. + * + * @see #setThreadStrictModePolicy + * @hide + */ + public static final native int getThreadStrictModePolicy(); + /** * Flush any Binder commands pending in the current thread to the kernel * driver. This can be |