title: android-system: allowing an app to bind to a system service
body: <p>This answer is to the point on how to add a system service in android:
  <a href="https://stackoverflow.com/a/7434249/1993710">https://stackoverflow.com/a/7434249/1993710</a></p>
  
  <p>However, i am too lazy to wait for hours each time the android makesystem builds my stuff, so i deploy my service through android-studio as a regular apk into /system/app and then inside an app that is supposed to use the service i do:</p>
  
  <pre><code>private ServiceConnection myAidlConnection = new ServiceConnection(){
      @Override
      public void onServiceConnected(ComponentName name, IBinder service) {
          // do stuff
      }
  }
  
  public void bindService(Context context){
      Intent intent = new Intent();
      intent.setClassName("my.service","my.service.Service");
      intent.setAction("my.service.TOAST");
      intent.putExtra("text", "stulle");
      context.bindService(intent, myAidlConnection, Context.BIND_AUTO_CREATE);
  }
  </code></pre>
  
  <p>This works fine, as long as that app is also a system apk. If it's not a system apk, myAidlConnection.onServiceConnected  is just never called. I suppose that's some sort of security thing so you can't bind arbitrary system services from non-privileged apps.</p>
  
  <p>Is there any way to allow my system service to be bound by anyone, or does it really have to pass the binder through getSystemService()?</p>