public class

InCallScreen

extends Activity
implements View.OnClickListener View.OnTouchListener
java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.view.ContextThemeWrapper
         ↳ android.app.Activity
           ↳ com.android.phone.InCallScreen

Class Overview

Phone app "in call" screen.

Summary

Constants
String ACTION_SHOW_ACTIVATION
String ACTION_UNDEFINED
String EXTRA_OTA_CALL
String OTA_NUMBER
[Expand]
Inherited Constants
From class android.app.Activity
From class android.content.Context
From interface android.content.ComponentCallbacks2
Fields
public OtaUtils otaUtils
[Expand]
Inherited Fields
From class android.app.Activity
Public Constructors
InCallScreen()
Public Methods
boolean dispatchKeyEvent(KeyEvent event)
boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event)
void endInCallScreenSession()
End the current in call screen session.
void finish()
Dismisses the in-call screen.
InCallControlState getUpdatedInCallControlState()
Updates and returns the InCallControlState instance.
void handleOtaCallEnd()
Handle OTA Call End scenario when display becomes dark during OTA Call and InCallScreen is in pause mode.
boolean isIncomingCallTouchUiEnabled()
boolean isOtaCallInActiveState()
boolean isOtaCallInEndState()
boolean isPhoneStateRestricted()
boolean isTouchUiEnabled()
void onBackPressed()
void onClick(View view)
void onConfigurationChanged(Configuration newConfig)
Manually handle configuration changes.
View onCreatePanelView(int featureId)
Override onCreatePanelView(), in order to get complete control over the UI that comes up when the user presses MENU.
boolean onKeyDown(int keyCode, KeyEvent event)
boolean onKeyUp(int keyCode, KeyEvent event)
void onPanelClosed(int featureId, Menu menu)
Override onPanelClosed() to capture the panel closing event, allowing us to set the poke lock correctly whenever the option menu panel goes away.
boolean onTouch(View v, MotionEvent event)
void onUserInteraction()
void onWindowFocusChanged(boolean hasFocus)
Overriden to track relevant focus changes.
void resetInCallScreenMode()
void updateMenuItems()
Protected Methods
void onCreate(Bundle icicle)
void onDestroy()
void onNewIntent(Intent intent)
void onPause()
void onResume()
void onStop()
[Expand]
Inherited Methods
From class android.app.Activity
From class android.view.ContextThemeWrapper
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface android.content.ComponentCallbacks
From interface android.content.ComponentCallbacks2
From interface android.view.KeyEvent.Callback
From interface android.view.LayoutInflater.Factory
From interface android.view.LayoutInflater.Factory2
From interface android.view.View.OnClickListener
From interface android.view.View.OnCreateContextMenuListener
From interface android.view.View.OnTouchListener
From interface android.view.Window.Callback

Constants

public static final String ACTION_SHOW_ACTIVATION

Constant Value: "com.android.phone.InCallScreen.SHOW_ACTIVATION"

public static final String ACTION_UNDEFINED

Constant Value: "com.android.phone.InCallScreen.UNDEFINED"

public static final String EXTRA_OTA_CALL

Constant Value: "android.phone.extra.OTA_CALL"

public static final String OTA_NUMBER

Constant Value: "*228"

Fields

public OtaUtils otaUtils

Public Constructors

public InCallScreen ()

Public Methods

public boolean dispatchKeyEvent (KeyEvent event)

public boolean dispatchPopulateAccessibilityEvent (AccessibilityEvent event)

public void endInCallScreenSession ()

End the current in call screen session. This must be called when an InCallScreen session has complete so that the next invocation via an onResume will not be in an old state.

public void finish ()

Dismisses the in-call screen. We never *really* finish() the InCallScreen, since we don't want to get destroyed and then have to be re-created from scratch for the next call. Instead, we just move ourselves to the back of the activity stack. This also means that we'll no longer be reachable via the BACK button (since moveTaskToBack() puts us behind the Home app, but the home app doesn't allow the BACK key to move you any farther down in the history stack.) (Since the Phone app itself is never killed, this basically means that we'll keep a single InCallScreen instance around for the entire uptime of the device. This noticeably improves the UI responsiveness for incoming calls.)

public InCallControlState getUpdatedInCallControlState ()

Updates and returns the InCallControlState instance.

public void handleOtaCallEnd ()

Handle OTA Call End scenario when display becomes dark during OTA Call and InCallScreen is in pause mode. CallNotifier will listen for call end indication and call this api to handle OTA Call end scenario

public boolean isIncomingCallTouchUiEnabled ()

Returns
  • true if the onscreen touch UI is enabled for the "incoming call" state on the current device.

public boolean isOtaCallInActiveState ()

public boolean isOtaCallInEndState ()

public boolean isPhoneStateRestricted ()

Returns
  • true if we're in restricted / emergency dialing only mode.

public boolean isTouchUiEnabled ()

Returns
  • true if the onscreen touch UI is enabled (for regular "ongoing call" states) on the current device.

public void onBackPressed ()

public void onClick (View view)

public void onConfigurationChanged (Configuration newConfig)

Manually handle configuration changes. We specify android:configChanges="orientation|keyboardHidden|uiMode" in our manifest to make sure the system doesn't destroy and re-create us due to the above config changes. Instead, this method will be called, and should manually rebuild the onscreen UI to keep it in sync with the current configuration.

public View onCreatePanelView (int featureId)

Override onCreatePanelView(), in order to get complete control over the UI that comes up when the user presses MENU. This callback allows me to return a totally custom View hierarchy (with custom layout and custom "item" views) to be shown instead of a standard android.view.Menu hierarchy. This gets called (with featureId == FEATURE_OPTIONS_PANEL) every time we need to bring up the menu. (And in cases where we return non-null, that means that the "standard" menu callbacks onCreateOptionsMenu() and onPrepareOptionsMenu() won't get called at all.)

public boolean onKeyDown (int keyCode, KeyEvent event)

public boolean onKeyUp (int keyCode, KeyEvent event)

public void onPanelClosed (int featureId, Menu menu)

Override onPanelClosed() to capture the panel closing event, allowing us to set the poke lock correctly whenever the option menu panel goes away.

public boolean onTouch (View v, MotionEvent event)

public void onUserInteraction ()

public void onWindowFocusChanged (boolean hasFocus)

Overriden to track relevant focus changes. If a key is down and some time later the focus changes, we may NOT recieve the keyup event; logically the keyup event has not occured in this window. This issue is fixed by treating a focus changed event as an interruption to the keydown, making sure that any code that needs to be run in onKeyUp is ALSO run here. Note, this focus change event happens AFTER the in-call menu is displayed, so mIsMenuDisplayed should always be correct by the time this method is called in the framework, please see: onCreatePanelView, onOptionsMenuClosed

public void resetInCallScreenMode ()

public void updateMenuItems ()

Protected Methods

protected void onCreate (Bundle icicle)

protected void onDestroy ()

protected void onNewIntent (Intent intent)

protected void onPause ()

protected void onResume ()

protected void onStop ()