안드로이드 개발 질문/답변
(글 수 45,052)
안녕하세요 소스 수정하다 버그때문에
고민하고있는데요 고수님들의 답변 부탁 드립니다
SIM lock 되있는 화면에서 옆에 종료키를 길게 누르면 에어포트 모드 메뉴 맟 종료 메뉴가 나오는데
에어포트 모드로 들어갔다 나오면 쓰레드에서 가지고 있던 값을 잃어 버립니다
SimUnlockScreen.java 파일에서 아래 값 count 에 원래 정상적으로 3이 리턴되야 하는데
중간에 이 쓰래드가 실행되다가 powerManagerService 가 실행되고
값이 -1 이 되버리는 현상인데 ( 아래 count 값이 -1 이 됩니다 )
count = ITelephony.Stub.asInterface(ServiceManager.checkService("phone")).getPinRemainCountGsm();
ITelephony.java 에 있는 getPinRemainCountGsm 함수를 추적하다 보니 _result = _reply.readInt();
의 값이 -1 이 들어가는 거는 확인 했습니다
다른때는 값이 잘 나오는데
왜 그럴까요?
아시는 분 있으시면 답변좀 부탁 드립니다
private final class RemainCountThread extends Thread { public void run() { int count = -1; Log.d(TAG, "RemainCountThread run()"); if (mIsGsmPhone) { if (mIsPinLocked) { try { count = ITelephony.Stub.asInterface(ServiceManager.checkService("phone")).getPinRemainCountGsm(); } catch (RemoteException e) { Log.e(TAG, "*** getPinRemainCountGsm = RemoteException"); } } else { try { count = ITelephony.Stub.asInterface(ServiceManager.checkService("phone")).getPukRemainCountGsm(); } catch (RemoteException e) { Log.e(TAG, "*** getPukRemainCountGsm = RemoteException"); } } } public int getPinRemainCountGsm() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); int _result; try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_getPinRemainCountGsm, _data, _reply, 0); _reply.readException(); _result = _reply.readInt(); } finally { _reply.recycle(); _data.recycle(); }
수고하세요