HFA support in services/Telephony for provisioning CDMA devices.

Adds a new activity that shows some ui allowing the user to see progress
and cancel the action.

At the end of the action (through error or completion) we return to the
setup wizard.

Change-Id: Idfe58d7b93463b59fc0de3eebd03517a36177d22
diff --git a/src/com/android/phone/InCallScreenShowActivation.java b/src/com/android/phone/InCallScreenShowActivation.java
index 243b437..15abb11 100644
--- a/src/com/android/phone/InCallScreenShowActivation.java
+++ b/src/com/android/phone/InCallScreenShowActivation.java
@@ -67,6 +67,14 @@
 
         if (intent.getAction().equals(OtaUtils.ACTION_PERFORM_CDMA_PROVISIONING)) {
 
+            boolean usesHfa = getResources().getBoolean(R.bool.config_use_hfa_for_provisioning);
+            if (usesHfa) {
+                Log.d(LOG_TAG, "Starting Hfa from ACTION_PERFORM_CDMA_PROVISIONING");
+                startHfa();
+                finish();
+                return;
+            }
+
             // On voice-capable devices, we perform CDMA provisioning in
             // "interactive" mode by directly launching the InCallScreen.
             // boolean interactiveMode = PhoneGlobals.sVoiceCapable;
@@ -137,4 +145,21 @@
 
         finish();
     }
+
+
+    /**
+     * Starts the HFA provisioning process by bringing up the HFA Activity.
+     */
+    private void startHfa() {
+        final Intent intent = new Intent(this, HfaActivity.class);
+
+        final PendingIntent otaResponseIntent = getIntent().getParcelableExtra(
+                OtaUtils.EXTRA_OTASP_RESULT_CODE_PENDING_INTENT);
+
+        intent.putExtra(OtaUtils.EXTRA_OTASP_RESULT_CODE_PENDING_INTENT, otaResponseIntent);
+        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
+
+        Log.v(LOG_TAG, "Starting hfa activation activity");
+        startActivity(intent);
+    }
 }