Closed GoogleCodeExporter closed 9 years ago
Original comment by Daniel.A...@gi-de.com
on 8 May 2012 at 2:09
because the logic on calling back is already implemented in the safe way that
it would not do anything if mCallerCallback == null
while there is no other place that is using mCallerCallback. Only other thing
that need is to make a comment on declaration like this.
private CallBack mCallerCallback; // can be null
propose solution as following:
public SEService(Context context, SEService.CallBack listener) {
if (context == null) {
throw new NullPointerException("context must not be null");
}
// propose solution start, comment out the following
//if (listener == null) {
// throw new NullPointerException("listener must not be null");
//}
// propose solution end
mContext = context;
mCallerCallback = listener;
mConnection = new ServiceConnection() {
public synchronized void onServiceConnected(ComponentName className, IBinder service) {
mSmartcardService = ISmartcardService.Stub.asInterface(service);
if (mCallerCallback != null) {
mCallerCallback.serviceConnected(SEService.this);
}
Log.v(SERVICE_TAG, "Service onServiceConnected");
}
public void onServiceDisconnected(ComponentName className) {
synchronized (mReaders) {
for (Reader reader : mReaders) {
try {
reader.closeSessions();
} catch (Exception ignore) {
}
}
}
mSmartcardService = null;
Log.v(SERVICE_TAG, "Service onServiceDisconnected");
}
};
boolean bindingSuccessful = mContext.bindService(new Intent(ISmartcardService.class
.getName()), mConnection, Context.BIND_AUTO_CREATE);
if (bindingSuccessful) {
Log.v(SERVICE_TAG, "bindService successful");
}
}
Original comment by tommypo...@gmail.com
on 11 May 2012 at 2:58
Accepted solution according to Comment 2.
Original comment by schus...@gmail.com
on 18 May 2012 at 6:11
Attachments:
setting old issues from fixed to done
Original comment by Daniel.A...@gi-de.com
on 5 Jul 2013 at 2:33
Original issue reported on code.google.com by
tommypo...@gmail.com
on 2 May 2012 at 4:15