I added a system service ( not an application) to the Android framework (therefore, it works in system_process). Via Binder.getCallingUid () I can determine the calling process / application. So far, so good. But if my service tries to use other system services (for example, LocationManager), a SecurityException is thrown because the LocationManager considers it to be caused by the original application that called my service.
From what I understood, system services have all permissions by default, so this should not be the case if?
From program4.us/Mobile/1304.aspx: Binder services can be used to make binding calls for free, but these calls always occur with the property (UID and PID), not the identity of the caller.
Here is some code to illustrate the problem:
public class MyService implements IInterface { public IBinder asBinder() { return mBinder; } private final IMyService.Stub mBinder = new IMyService.Stub() { public void doSomething() { int uid = Binder.getCallingUid();
Thanks in advance for any help or comments!
muoah source share