|
发表于 2020-10-13 09:31:26
浏览:7784
|
回复:12
打印
[复制链接]
楼主
- private ServiceConnection mServiceConnection = new ServiceConnection() {
- public void onServiceConnected(ComponentName name, IBinder service) {
- IDCardUtil.this.mService = Stub.asInterface(service);
- try {
- IDCardUtil.this.mService.registerCallback(IDCardUtil.this.mCallback);
- } catch (RemoteException var4) {
- }
- IDCardUtil.this.setModel(1);
- }
- public void onServiceDisconnected(ComponentName name) {
- IDCardUtil.this.mService = null;
- }
- };
复制代码
- private IDCardServiceCallback mCallback = new com.firefly.id_card.IDCardServiceCallback.Stub() {
- public void onMachineConnect() throws RemoteException {
- if (IDCardUtil.this.checkSupportIDCard()) {
- IDCardUtil.this.mSupportMode = 2;
- }
- if (IDCardUtil.this.mIDCardCallBack != null) {
- IDCardUtil.this.mIDCardCallBack.onMachineConnect();
- }
- }
- public void onModeChanged(int mode) throws RemoteException {
- if (IDCardUtil.this.mIDCardCallBack != null) {
- IDCardUtil.this.mIDCardCallBack.onModeChanged(mode);
- }
- }
- public void onSwipeIDCard(IDCardBean info) throws RemoteException {
- if (IDCardUtil.this.mIDCardCallBack != null && info != null) {
- IDCardUtil.this.mIDCardCallBack.onSwipeIDCard(info);
- }
- }
- public void onSwipeICCard(ICCardBean info) throws RemoteException {
- if (IDCardUtil.this.mIDCardCallBack != null && info != null) {
- if (IDCardUtil.this.mEndianMode == 1 && !TextUtils.isEmpty(info.getIcID())) {
- info.setIcID(IDCardUtil.this.covertLittleEndian(info.getIcID()));
- }
- IDCardUtil.this.mIDCardCallBack.onSwipeICCard(info);
- }
- }
- public void onSwipeIDCardUUID(String uuid) throws RemoteException {
- if (IDCardUtil.this.mIDCardCallBack != null) {
- IDCardUtil.this.mIDCardCallBack.onSwipeIDCardUUID(uuid);
- }
- }
- };
复制代码
IDCardServiceCallback mCallback不被回调,service注册是返回true了,请问是什么原因? |
|