summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/jni/android_util_Binder.cpp2
-rw-r--r--core/tests/coretests/src/android/os/BinderWorkSourceTest.java2
2 files changed, 3 insertions, 1 deletions
diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp
index 4f8bbc1396c8..3329e2047085 100644
--- a/core/jni/android_util_Binder.cpp
+++ b/core/jni/android_util_Binder.cpp
@@ -919,7 +919,7 @@ static jlong android_os_Binder_clearCallingWorkSource()
return IPCThreadState::self()->clearCallingWorkSource();
}
-static void android_os_Binder_restoreCallingWorkSource(long token)
+static void android_os_Binder_restoreCallingWorkSource(jlong token)
{
IPCThreadState::self()->restoreCallingWorkSource(token);
}
diff --git a/core/tests/coretests/src/android/os/BinderWorkSourceTest.java b/core/tests/coretests/src/android/os/BinderWorkSourceTest.java
index d1dbd3ccba33..ef14b00f9775 100644
--- a/core/tests/coretests/src/android/os/BinderWorkSourceTest.java
+++ b/core/tests/coretests/src/android/os/BinderWorkSourceTest.java
@@ -125,8 +125,10 @@ public class BinderWorkSourceTest {
Binder.setCallingWorkSourceUid(UID);
long token = Binder.clearCallingWorkSource();
Binder.restoreCallingWorkSource(token);
+ assertEquals(UID, Binder.getCallingWorkSourceUid());
assertEquals(UID, mService.getIncomingWorkSourceUid());
+ // Still the same after the binder transaction.
assertEquals(UID, Binder.getCallingWorkSourceUid());
}