mWildPromptText.requestFocus();
}
-
+ /**
+ * Updates the state of the in-call UI based on the current state of
+ * the Phone. This call has no effect if we're not currently the
+ * foreground activity.
+ *
+ * This method is only allowed to be called from the UI thread (since it
+ * manipulates our View hierarchy). If you need to update the screen from
+ * some other thread, or if you just want to "post a request" for the scree
+ * to be updated (rather than doing it synchronously), call
+ * requestUpdateScreen() instead.
+ */
+ final private void updateScreen()
+ {
+ updateScreen(false);
+ }
/**
* Updates the state of the in-call UI based on the current state of
* the Phone. This call has no effect if we're not currently the
@@ -2184,7 +2202,7 @@ public class InCallScreen extends Activity
* to be updated (rather than doing it synchronously), call
* requestUpdateScreen() instead.
*/
- private void updateScreen() {
+ private void updateScreen(boolean force) {
if (DBG) log("updateScreen()...");
final InCallScreenMode inCallScreenMode = mApp.inCallUiState.inCallScre
if (VDBG) {
@@ -2245,7 +2263,7 @@ public class InCallScreen extends Activity
// Note we update the InCallTouchUi widget before the CallCard,
// since the CallCard adjusts its size based on how much vertical
// space the InCallTouchUi widget needs.
- updateInCallTouchUi();
+ updateInCallTouchUi(force);
mCallCard.updateState(mCM);
updateDialpadVisibility();
updateProviderOverlay();
@@ -3925,13 +3943,18 @@ public class InCallScreen extends Activity
mRespondViaSmsManager = new RespondViaSmsManager();
mRespondViaSmsManager.setInCallScreenInstance(this);
}
-
/**
* Updates the state of the in-call touch UI.
*/
- private void updateInCallTouchUi() {
+ final private void updateInCallTouchUi() {
+ updateInCallTouchUi(false);
+ }
+ /**
+ * Updates the state of the in-call touch UI.
+ */
+ private void updateInCallTouchUi(boolean force) {
if (mInCallTouchUi != null) {
- mInCallTouchUi.updateState(mCM);
+ mInCallTouchUi.updateState(mCM,force);
}
}
@@ -3941,7 +3964,6 @@ public class InCallScreen extends Activity
/* package */ InCallTouchUi getInCallTouchUi() {
return mInCallTouchUi;
}
-
/**
* Posts a handler message telling the InCallScreen to refresh the
* onscreen in-call UI.
@@ -3958,7 +3980,23 @@ public class InCallScreen extends Activity
mHandler.removeMessages(REQUEST_UPDATE_SCREEN);
mHandler.sendEmptyMessage(REQUEST_UPDATE_SCREEN);
}
-
+ /**
+ * Posts a handler message telling the InCallScreen to force refresh the
+ * onscreen in-call UI.
+ *
+ * This is just a wrapper around updateScreen(true), for use by the
+ * rest of the phone app or from a thread other than the UI thread.
+ *
+ * updateScreen() is a no-op if the InCallScreen is not the foreground
+ * activity, so it's safe to call this whether or not the InCallScreen
+ * is currently visible.
+ */
+ /* package */ void requestForceUpdateScreen() {
+ if (DBG) log("requestForceUpdateScreen()...");
+ mHandler.removeMessages(REQUEST_UPDATE_SCREEN);
+ mHandler.removeMessages(REQUEST_FORCE_UPDATE_SCREEN);
+ mHandler.sendEmptyMessage(REQUEST_FORCE_UPDATE_SCREEN);
+ }
/**
* @return true if it's OK to display the in-call touch UI, given the
* current state of the InCallScreen.
RespondViaSmsManager.java文件的修改如下: