Questions tagged [android-binder]

Android's lightweight remote procedure call mechanism designed for high performance when performing in-process and cross-process calls.

While the term "binder" is somewhat generic, its most popular namesake is the Android-specific interprocess communication mechanism and remote method invocation system. It forms the basis for many of Android's core services.

The official documentation is here, and there is a collection of in-depth information at this wiki.

244 questions
4
votes
1 answer

Is there any way to get UID or PID of an IBinder instance?

I need to do security check on an IBinder instance carried from other process via IPC. The creator/receiver of this IBinder may not be the direct caller of the IPC carrying it, so I can't simply use Binder.getCallingUid(). How can I detect the UID…
Oasis Feng
  • 7,490
  • 3
  • 31
  • 44
4
votes
2 answers

Android Binder Example

I am looking for simple binder IPC example in C/C++. Recently I started reading about the Android Binder basic (http://bharathi.posterous.com/android-binder) and gone thru the code in Android source also. Most of the binder usage part is in C++. Can…
Midson
  • 1,018
  • 3
  • 12
  • 23
4
votes
1 answer

android - broadcast receiver - caller verification

I am writing an Android application wherein I need to receive some broadcasts sent by the system. I want to make sure the broadcasts are indeed sent by the system. I found this OWASP video. At time 18:00 in the video, the speaker suggests one of…
Jake
  • 16,329
  • 50
  • 126
  • 202
4
votes
2 answers

Android Widgets allowed to exceed Binder transaction limit somehow?

In the Android documentation for AppWidgetManager it says The total Bitmap memory used by the RemoteViews object cannot exceed that required to fill the screen 1.5 times, ie. (screen width x screen height x 4 x 1.5) bytes. But the documentation…
satur9nine
  • 13,927
  • 5
  • 80
  • 123
4
votes
1 answer

Recommended approach for handling errors across process using AIDL (Android)

I have a binder service and a client that live in different processes. Using AIDL, when the client calls into my remote binder service, there are times that I need to relay an error (exception) back to the client. However, from my understanding,…
Jon
  • 1,381
  • 3
  • 16
  • 41
3
votes
2 answers

Getting notified when clients attach and detach to an Android Service

I have an Android Service which exports an RPC interface via AIDL. The interface is connection-oriented, where a client will connect to it, transact with it, then disconnect on exit. Unfortunately is the client exits abnormally, e.g. gets killed by…
David Given
  • 13,277
  • 9
  • 76
  • 123
3
votes
2 answers

failed binder transaction on widget update

i am updating one bitmap in widget (the whole widget is only one ImageView) like this remoteViews.setImageViewBitmap(...) and in some rare situations (it happend 3 times in 6 months of every day use) i get "!!! FAILED BINDER TRANSACTION !!!". then,…
shelll
  • 3,234
  • 3
  • 33
  • 67
3
votes
0 answers

keeps getting W/Parcel: Expecting binder but got null! error

I am getting the W/Parcel: Expecting binder but got null! message in the log every time a new activity gets created in Android studio emulator. If anyone can help me that would be highly appreciated.
3
votes
1 answer

Can a non-privileged Linux native executable in Android communicate with a regular application using Binder?

In order to test and control my regular android application, I wrote a command line Linux test program and used adb shell to execute this test program. I can send a broadcast or start an activity to/from my android application indirectly by…
3
votes
1 answer

LocalService and LocalBinder leak memory in Android 10

I have a LocalService implementation exactly as suggested here in order to provide access to service methods through the binder. https://developer.android.com/guide/components/bound-services#Binder public class LocalService extends Service { //…
3
votes
1 answer

Latest Android NDK (r21c)'s libbinder_ndk is missing several exported APIs

I am interested in using the AServiceManager_get/addService() APIs that are made available via the NDK implementation of binder, libbinder_ndk. The sources for this can be found here for 10.0.0r30 - API29, and in your AOSP tree…
sherrellbc
  • 4,650
  • 9
  • 48
  • 77
3
votes
0 answers

Binder - How to get class and method name of the caller from the server?

For research purposes, I'm modifying Android SystemServer code. What am I trying to accomplish? Whenever there is a call to SystemServer (Binder server process), I want to know the source of this call on the Binder client process; more specifically…
Aviad
  • 31
  • 4
3
votes
1 answer

What is the downside if using ContentProvider within the same process

I am wondering if there'll be an extra cost to query the content provider within the same process. I'm aware that the Content Provider is transacting data by the binder, and all the data transition between binder service and binder client will be…
shanwu
  • 1,493
  • 6
  • 35
  • 45
3
votes
1 answer

Android Binder native service called from Java

I've created a native binder service with a few transactions types. At the moment i have native proxy ( Bp ) for clients, but i want to give Java clients the possibility to use my service. Basically, the Bp should be Java i think. I've found some…
Cumatru
  • 695
  • 2
  • 12
  • 34
3
votes
3 answers

Android Binder Tracing

In Android OS source code (Path: /drivers/staging/android/binder_trace.h), we have a file named binder_trace.h and also in /drivers/staging/android/binder.c binder_trace is included. As we can see in binder_trace.h file, the binder transactions are…
Cert
  • 99
  • 1
  • 2
  • 9