Fix/android17 iserviceconnection#16
Merged
superturtlee merged 2 commits intoJul 24, 2026
Merged
Conversation
Android 17 (API 36) replaced the old 3-argument IServiceConnection.connected(ComponentName, IBinder, boolean) with a new 4-argument overload that adds an IBinderSession parameter, and removed the old overload entirely from the framework interface. Vector's IServiceConnection stub and the ManagerService connection implementation only declared/overrode the old 3-argument signature. When system_server dispatched the new 4-argument connected() to the parasitic manager process on Android 17, the Stub lacked the new abstract method and threw AbstractMethodError, killing the manager process. system_server then hit DeadObjectException while dispatching a broadcast to the dead process, triggering a framework restart (SYSTEM_RESTART) every time the manager was opened. Fix: - Add an IBinderSession stub (android.app.IBinderSession extends IInterface) with binderTransactionCompleted(long) and binderTransactionStarting(String):long, matching the Android 17 framework interface. - Declare both connected() overloads in the IServiceConnection stub so it compiles against Android 8.1~17 (the old overload is simply never invoked on Android 17+). - Override the new 4-argument connected() in ManagerService's connection Stub (no-op, same as the existing 3-argument override).
The build system passed string macros to the C/C++ compiler wrapped in single quotes, e.g. -DVERSION_NAME='2.0' and -DINJECTED_PACKAGE_NAME='com.android.shell'. On Linux/macOS the shell strips the single quotes and the compiler sees a quoted string literal, but on Windows single quotes are not shell quoting characters, so the compiler receives -DVERSION_NAME='2.0' (a multi-character constant) or -DINJECTED_PACKAGE_NAME='com.android.shell', causing compilation failures: - narrowing conversion from 'int' to 'const char*' - expected unqualified-id / multi-character constant Fix by passing the values as bare tokens (-DVERSION_NAME=2.0, -DINJECTED_PACKAGE_NAME=com.android.shell) and stringizing them at the C++ side via a STRINGIZE macro, which is robust across Windows and Unix toolchains. Also move the stringize helper macros out of a namespace (macros are not namespace members and cannot be invoked with a qualified name).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.