org.simalliance.openmobileapi 21版本 之前未升级的手机上可以使用 手机升级到Android9后 不好使了 报SEService: bindingSuccessful: false
public SEService(Context context, SEService.CallBack listener) {
if(context == null) {
throw new NullPointerException("context must not be null");
} else {
this.mContext = context;
this.mCallerCallback = listener;
this.mConnection = new ServiceConnection() {
public synchronized void onServiceConnected(ComponentName className, IBinder service) {
SEService.this.mSmartcardService = org.simalliance.openmobileapi.service.ISmartcardService.Stub.asInterface(service);
if(SEService.this.mCallerCallback != null) {
SEService.this.mCallerCallback.serviceConnected(SEService.this);
}
Log.v("SEService", "Service onServiceConnected");
}
public void onServiceDisconnected(ComponentName className) {
SEService.this.mSmartcardService = null;
Log.v("SEService", "Service onServiceDisconnected");
}
};
Intent intent = new Intent("org.simalliance.openmobileapi.BIND_SERVICE");
intent.setPackage("org.simalliance.openmobileapi.service");
boolean bindingSuccessful = this.mContext.bindService(intent, this.mConnection, 1);
Log.v("SEService", "bindingSuccessful: " + bindingSuccessful);
}
}