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
1
vote
0 answers

Android instrumentation.execStartActivity parameters

Having a bit of trouble. I'm trying to start an activity using another activity and need to get the 7 parameters of the execStartActivity method in the instrumentation.java class. From what I can tell the method is as follows: …
Pulkit
  • 119
  • 1
  • 1
  • 6
1
vote
0 answers

Activity bound to Service: Messages from service to activity become corrupted

I have following issue when using IPC: My activity binds to the service. When my activity is bound to service (very similar to http://www.survivingwithandroid.com/2014/01/android-bound-service-ipc-with-messenger-2.html ) i am facing the following…
user1734654
  • 103
  • 5
1
vote
0 answers

How to debug a binder page fault?

190 <7>[ 19.600070] Binder_2: unhandled page fault (11) at 0x00000000, code 0x005 191 <1>[ 19.600085] pgd = eb5b8000 192 <1>[ 19.601750] [00000000] *pgd=00000000 193 <6>[ 19.605354] 194 <6>[ 19.605370] CPU: 1 PID: 817 Comm: Binder_2…
linyx
  • 11
  • 2
1
vote
3 answers

How to send a service via a binder to a fragment on API level 14?

I have made an Android app, on Android 4.4.4, and I want to develop it on Android 4.0.0. I have a problem to send a service, my binder, to a fragment. On Android 4.4.4 I use the following lines : AddTrashFragment addTrashFragment = new…
Fred37b
  • 822
  • 2
  • 10
  • 29
1
vote
0 answers

All Android IPC by binder blocked

I got a problem where all RPC(whether provider or aidl) call into my service app blocked. Functions client called are simple enough that I'm sure would not block for hours.(and has no dead lock) Dive into binder driver, found some info in…
CompileLife
  • 163
  • 1
  • 13
1
vote
0 answers

Understanding Android Binders

I'm trying to understand a piece of code that uses Android Binders and Messages to perform IPC. I've read a few articles, papers and slides on binders, but I'm still confused and have a hard time understanding the code, since I didn't encounter any…
user1118764
  • 9,255
  • 18
  • 61
  • 113
1
vote
1 answer

Android exception : FAILED BINDER TRANSACTION

I have a Service which runs in the background when my app starts, and continues to run after the app is closed. It implements a Loader.OnLoadCompleteListener for a registered Uri from a Content Provider. When a new Cursor object is…
Mark
  • 9,604
  • 5
  • 36
  • 64
1
vote
0 answers

Why can WindowManager.LayoutParams.token be equal to ViewRootImpl.mWindow.asBinder?

In WindowManagerGlobal.addView, there is such a statement: if (mRoots.get(i).mWindow.asBinder() == wparams.token) I'm confuesd here. ViewRootImpl.mWindow is an instance of IWindow.stub, but WindowManager.LayoutParams.token is an instance of…
shhp
  • 3,653
  • 2
  • 18
  • 23
1
vote
1 answer

Why we use another class inheriting binder class to access BoundServices?

I know Bound Services Lives only until the Activity or any component needs it. We have to call the MyLocalBinder class from onBind function. Why is it so? Why can't we call it directly? public class MyService extends Service { private final IBinder…
1
vote
1 answer

Android - calling bindservice but not being able to access any methods in that service

So I've been writing an app that determines your running speed, and integrates that into a workout routine. As I was new to Android, I did everything in an Activity but I've reached a point where I want to divert the speed calculation portion, and…
Dale Diaz
  • 11
  • 3
1
vote
1 answer

Android: Why do we need an IBinder for the Messenger to communicate with the Handler?

Talking in the context of the third snippet of code given on this page, there is a method of a Messenger named getBinder() which returns the IBinder the Messenger is using to communicate with the associated Handler. Now why would we need an IBinder…
Solace
  • 8,612
  • 22
  • 95
  • 183
1
vote
1 answer

Is there any quick and simple IPC mechanism between Android Java and native processes?

I have such a requirement. In Android native service process, we will do something and post data to java layer in a constant speed, i.e 30 per second. In App layer, we have to receive these data and do the according operations. The native service…
BonderWu
  • 133
  • 1
  • 10
1
vote
2 answers

Android Binder IPC addService: is there a way to remove service again?

I'm somewhere in the code, where i have only very limited permissions, but have to ship data outside to an android application. (Android system C code) Obviously I cannot start a binder service in there, but I can connect to an already running…
1
vote
0 answers

SecurityException: Binder invocation to an incorrect interface

I get the Error message: "Binder invocation to an incorrect interface" on this code: IBluetoothA2dp ibta = a2dp.connect2.Bt_iadl.ibta2; try { if (ibta != null && ibta.getConnectionState(device) == 0) ibta.connect(device); …
silvia_aut
  • 1,481
  • 6
  • 19
  • 33
1
vote
1 answer

What's the CallingUid when AppX calls ServiceY which then calls ServiceZ?

From Android API documentation: Binder.getCallingUid() returns the Linux uid assigned to the process that sent you the current transaction that is being processed. When AppX calls ServiceY and ServiceY calls getCallingUid(), it will get UID for…
Wu Yongzheng
  • 1,707
  • 17
  • 23