diff options
| author | 2019-04-03 11:07:59 -0700 | |
|---|---|---|
| committer | 2019-04-03 11:07:59 -0700 | |
| commit | 4f5e4b4983d03c6f49b44fcc9a8f9c16f49e9187 (patch) | |
| tree | 253d3e2b9a72ffaf68e225cad52421ca2e2a49a4 /libs/binder/ProcessState.cpp | |
| parent | 5fcbe6f6bce23518cd8ca4448c0d2098a1da2ee7 (diff) | |
| parent | 94c0cd9393c22759d3a375cf222d24e90bdcd8a9 (diff) | |
Merge changes from topic "kernel_v503_2" am: 06c65b864b
am: 94c0cd9393
Change-Id: Id0baff6b8cc227c6573e965471d47c70cb2a02f2
Diffstat (limited to 'libs/binder/ProcessState.cpp')
| -rw-r--r-- | libs/binder/ProcessState.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp index 1c74e7b077..63f49ddba7 100644 --- a/libs/binder/ProcessState.cpp +++ b/libs/binder/ProcessState.cpp @@ -181,8 +181,20 @@ bool ProcessState::becomeContextManager(context_check_func checkFunc, void* user mBinderContextCheckFunc = checkFunc; mBinderContextUserData = userData; - int dummy = 0; - status_t result = ioctl(mDriverFD, BINDER_SET_CONTEXT_MGR, &dummy); + flat_binder_object obj { + .flags = FLAT_BINDER_FLAG_TXN_SECURITY_CTX, + }; + + status_t result = ioctl(mDriverFD, BINDER_SET_CONTEXT_MGR_EXT, &obj); + + // fallback to original method + if (result != 0) { + android_errorWriteLog(0x534e4554, "121035042"); + + int dummy = 0; + result = ioctl(mDriverFD, BINDER_SET_CONTEXT_MGR, &dummy); + } + if (result == 0) { mManagesContexts = true; } else if (result == -1) { |