public class

OtaUtils

extends Object
java.lang.Object
   ↳ com.android.phone.OtaUtils

Class Overview

Handles all OTA Call related logic and UI functionality. The InCallScreen interacts with this class to perform an OTA Call. OTA is a CDMA-specific feature: OTA or OTASP == Over The Air service provisioning SPC == Service Programming Code TODO: Include pointer to more detailed documentation.

Summary

Nested Classes
class OtaUtils.CdmaOtaConfigData Defines OTA screen configuration items read from config.xml and used to control OTA display. 
class OtaUtils.CdmaOtaInCallScreenUiState The state of the OTA InCallScreen UI. 
class OtaUtils.CdmaOtaProvisionData Defines OTA information that needs to be maintained during an OTA call when display orientation changes. 
class OtaUtils.CdmaOtaScreenState The OTA screen state machine. 
Constants
int OTA_PLAY_SUCCESS_FAILURE_TONE_OFF
int OTA_PLAY_SUCCESS_FAILURE_TONE_ON
int OTA_SHOW_ACTIVATE_FAIL_COUNT_OFF
int OTA_SHOW_ACTIVATE_FAIL_COUNT_THREE
int OTA_SHOW_ACTIVATION_SCREEN_OFF
int OTA_SHOW_ACTIVATION_SCREEN_ON
int OTA_SHOW_LISTENING_SCREEN_OFF
int OTA_SHOW_LISTENING_SCREEN_ON
Fields
public final int OTA_FAILURE_DIALOG_TIMEOUT
public final int OTA_SPC_TIMEOUT
Public Constructors
OtaUtils(Context context, InCallScreen inCallScreen, ViewGroup inCallPanel, CallCard callCard, DTMFTwelveKeyDialer dialer)
Public Methods
void cleanOtaScreen(boolean disableSpeaker)
Clear out all OTA UI widget elements.
void dismissAllOtaDialogs()
OtaUtils.CdmaOtaInCallScreenUiState.State getCdmaOtaInCallScreenUiState()
Get the Ota InCallScreen UI state
void hideOtaScreen()
static boolean isCdmaPhone()
boolean isDialerOpened()
static boolean maybeDoOtaCall(Context context, Handler handler, int request)
Starts the OTA provisioning call.
static boolean needsActivation(String minString)
Returns true if the phone needs activation.
void onClickHandler(int id)
Handle the click events for OTA buttons.
void onOtaCloseFailureNotice()
Handle OTA unsuccessful notice expiry.
void onOtaCloseSpcNotice()
When SPC notice times out, force phone to power down.
void onOtaProvisionStatusChanged(AsyncResult r)
Handle OTA Provision events from Framework.
void otaShowActivateScreen()
Show Activation Screen when phone powers up and OTA provision is required.
void otaShowProperScreen()
Show the appropriate OTA screen based on the current state of OTA call.
void otaShowSuccessFailure()
Show either programming success dialog when OTA provisioning succeeds, or programming failure dialog when it fails.
void setCdmaOtaInCallScreenUiState(OtaUtils.CdmaOtaInCallScreenUiState.State state)
Save the Ota InCallScreen UI state
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int OTA_PLAY_SUCCESS_FAILURE_TONE_OFF

Constant Value: 0 (0x00000000)

public static final int OTA_PLAY_SUCCESS_FAILURE_TONE_ON

Constant Value: 1 (0x00000001)

public static final int OTA_SHOW_ACTIVATE_FAIL_COUNT_OFF

Constant Value: 0 (0x00000000)

public static final int OTA_SHOW_ACTIVATE_FAIL_COUNT_THREE

Constant Value: 3 (0x00000003)

public static final int OTA_SHOW_ACTIVATION_SCREEN_OFF

Constant Value: 0 (0x00000000)

public static final int OTA_SHOW_ACTIVATION_SCREEN_ON

Constant Value: 1 (0x00000001)

public static final int OTA_SHOW_LISTENING_SCREEN_OFF

Constant Value: 0 (0x00000000)

public static final int OTA_SHOW_LISTENING_SCREEN_ON

Constant Value: 1 (0x00000001)

Fields

public final int OTA_FAILURE_DIALOG_TIMEOUT

Constant Value: 2 (0x00000002)

public final int OTA_SPC_TIMEOUT

Constant Value: 60 (0x0000003c)

Public Constructors

public OtaUtils (Context context, InCallScreen inCallScreen, ViewGroup inCallPanel, CallCard callCard, DTMFTwelveKeyDialer dialer)

Public Methods

public void cleanOtaScreen (boolean disableSpeaker)

Clear out all OTA UI widget elements. Needs to get called when OTA call ends or InCallScreen is destroyed.

Parameters
disableSpeaker parameter control whether Speaker should be turned off.

public void dismissAllOtaDialogs ()

public OtaUtils.CdmaOtaInCallScreenUiState.State getCdmaOtaInCallScreenUiState ()

Get the Ota InCallScreen UI state

public void hideOtaScreen ()

public static boolean isCdmaPhone ()

public boolean isDialerOpened ()

public static boolean maybeDoOtaCall (Context context, Handler handler, int request)

Starts the OTA provisioning call. If the MIN isn't available yet, it returns false and adds an event to return the request to the calling app when it becomes available.

Returns
  • true if we were able to launch Ota activity or it's not required; false otherwise

public static boolean needsActivation (String minString)

Returns true if the phone needs activation.

Parameters
minString the phone's MIN configuration string
Returns
  • true if phone needs activation
Throws
if the string is invalid
IllegalArgumentException

public void onClickHandler (int id)

Handle the click events for OTA buttons.

public void onOtaCloseFailureNotice ()

Handle OTA unsuccessful notice expiry. Dismisses the two-second notice and shows the activation screen.

public void onOtaCloseSpcNotice ()

When SPC notice times out, force phone to power down.

public void onOtaProvisionStatusChanged (AsyncResult r)

Handle OTA Provision events from Framework. Possible events are: OTA Commit Event - OTA provisioning was successful SPC retries exceeded - SPC failure retries has exceeded, and Phone needs to power down.

public void otaShowActivateScreen ()

Show Activation Screen when phone powers up and OTA provision is required. Also shown when activation fails and user needs to re-attempt it. Contains ACTIVATE and SKIP buttons which allow user to start OTA activation or skip the activation process.

public void otaShowProperScreen ()

Show the appropriate OTA screen based on the current state of OTA call. Shown whenever calling screen is resumed.

public void otaShowSuccessFailure ()

Show either programming success dialog when OTA provisioning succeeds, or programming failure dialog when it fails. See otaShowProgramFailure for more details.

public void setCdmaOtaInCallScreenUiState (OtaUtils.CdmaOtaInCallScreenUiState.State state)

Save the Ota InCallScreen UI state