Methods Summary |
---|
public void | cleanup()
Looper looper = getLooper();
if (looper != null) looper.quit();
mHandler = null;
|
public com.android.internal.telephony.gsm.GSMPhone | getGSMPhone()
return mGSMPhone;
|
public android.os.Handler | getHandler()
return mHandler;
|
public com.android.internal.telephony.test.SimulatedCommands | getSimulatedCommands()
return sc;
|
public boolean | handleMessage(android.os.Message msg)
synchronized (this) {
mCurrentMessage = msg;
this.notifyAll();
while(!mMsgConsumed) {
try {
this.wait();
} catch (InterruptedException e) {}
}
mMsgConsumed = false;
}
return true;
|
protected void | onLooperPrepared()
sc = new SimulatedCommands();
mGSMPhone = new GSMPhone(mContext, sc, new TestPhoneNotifier(), true);
mHandler = new Handler(getLooper(), this);
synchronized (this) {
notifyAll();
}
|
public android.os.Message | waitForMessage(int code)
Message msg;
while(true) {
msg = null;
synchronized (this) {
try {
this.wait(FAIL_TIMEOUT_MILLIS);
} catch (InterruptedException e) {
}
// Check if timeout has occurred.
if (mCurrentMessage != null) {
// Consume the message
msg = Message.obtain();
msg.copyFrom(mCurrentMessage);
mCurrentMessage = null;
mMsgConsumed = true;
this.notifyAll();
}
}
if (msg == null || code == GSMPhoneTest.ANY_MESSAGE || msg.what == code) return msg;
}
|