15 package io.grpc.binder.cpp;
17 import android.content.ComponentName;
18 import android.content.Context;
19 import android.content.Intent;
20 import android.content.ServiceConnection;
21 import android.os.IBinder;
22 import android.util.Log;
26 private static final String
logTag =
"GrpcBinderConnection";
50 throw new IllegalArgumentException(
"service was null");
63 public void tryConnect(String pkg, String cls, String action_name) {
65 Intent intent =
new Intent(action_name);
66 ComponentName compName =
new ComponentName(pkg, cls);
67 intent.setComponent(compName);
71 boolean result =
mContext.bindService(intent,
this, Context.BIND_AUTO_CREATE);
77 "bindService failed. Maybe the system couldn't find the service or the"
78 +
" client doesn't have permission to bind to it.");