From b154630235935e1aab2a41eff9ed794d40084a02 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 28 Jul 2010 13:46:24 -0700 Subject: [PATCH] Add "non-interactive" mode for the OTASP (CDMA provisioning) call. Non-voice-capable devices (like Stingray) have no built-in phone UI, but do still need to make a special phone call when first "activating" the device. Till now, the code handling the OTASP call (OtaUtils.java) was very tightly coupled to the InCallScreen, using special modes of the in-call UI to display the "skip" and "activate" choices, and display a DTMF dialpad and Speaker button and progress info during the call. This change decouples the OtaUtils and InCallScreen code, and allows the OTASP call to run in "non-interactive" mode. Now, on data-only devices we launch the OTASP call without involving the InCallScreen at all. This change also cleans up the way we send results back to the SetupWizard: - First of all, in non-interactive mode, we now return an activity result right away after kicking off the OTASP call. This lets our caller know either that the OTASP call started (and is running in the background), or that that we couldn't start the OTASP call at all. - And as before, when the OTASP call ultimately finishes, we send back a PendingIntent that was originally provided by our caller. But now, we explicitly add an extra called EXTRA_OTASP_RESULT_CODE to that PendingIntent. That extra's value is an integer code, which allows the caller to distinguish among several possible outcomes, namely "success", "failure", and "user skipped". Finally, this change includes a test activity called OtaspTestActivity which exercises the whole "non-interactive" OTASP sequence (which basically mimics the PERFORM_CDMA_PROVISIONING behavior of SetupWizard.) More details: - When we handle the PERFORM_CDMA_PROVISIONING intent (see InCallScreenShowActivation.java) we check a config resource called R.bool.voice_capable to decide whether to use the in-call UI. (That resource is true by default, but overridden to false on Stingray.) - The singleton OtaUtils instance is now owned by the PhoneApp, not the InCallScreen, since we can now have an OtaUtils instance *without* an InCallScreen. - I renamed the "com.android.phone.InCallScreen.SHOW_ACTIVATION" intent action to be "com.android.phone.PERFORM_CDMA_PROVISIONING", to be more precise, and especially to make it clear that it's not tied to the InCallScreen. - Moved all OTASP-releated string constants into OtaUtils (rather than having them sprinkled around in 3 or 4 places.) Bug: 2837917 Change-Id: Ifa82591478ccb2ec9501163963944d0d0659b9ea --- AndroidManifest.xml | 24 +- res/layout/ota_test_activity.xml | 68 +++ src/com/android/phone/CallNotifier.java | 9 + src/com/android/phone/InCallScreen.java | 107 ++-- .../phone/InCallScreenShowActivation.java | 125 ++++- src/com/android/phone/OtaUtils.java | 486 +++++++++++++++--- src/com/android/phone/OtaspTestActivity.java | 269 ++++++++++ src/com/android/phone/PhoneApp.java | 57 +- 8 files changed, 987 insertions(+), 158 deletions(-) create mode 100644 res/layout/ota_test_activity.xml create mode 100644 src/com/android/phone/OtaspTestActivity.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 10abd589..b97f28e0 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -73,6 +73,7 @@ + + - + @@ -423,6 +429,20 @@ android:configChanges="orientation|keyboardHidden"> + + + + + + + + + - diff --git a/res/layout/ota_test_activity.xml b/res/layout/ota_test_activity.xml new file mode 100644 index 00000000..371a6d44 --- /dev/null +++ b/res/layout/ota_test_activity.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + +