Fix bug 2078454 where clicking on Settings in the Home menu would
take the user to Market after clicking on "Install Voice Data" in
the TTS Settings page.
Launching the Activity for the installation of the TTS data should
be a distinct task, dissociated from the one associated with the
Settings app. Also the intent ACTION_INSTALL_TTS_DATA doesn't return
a result, so the activity should be started with startActivity()
rather than startActivityForResult().
diff --git a/src/com/android/settings/TextToSpeechSettings.java b/src/com/android/settings/TextToSpeechSettings.java
index d4ffe65..f60d0f2 100644
--- a/src/com/android/settings/TextToSpeechSettings.java
+++ b/src/com/android/settings/TextToSpeechSettings.java
@@ -90,11 +90,6 @@
      * startActivityForResult.
      */
     private static final int VOICE_DATA_INTEGRITY_CHECK = 1977;
-    /**
-     * Request code (arbitrary value) for voice data installation through
-     * startActivityForResult.
-     */
-    private static final int VOICE_DATA_INSTALLATION = 1980;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -218,13 +213,14 @@
         PackageManager pm = getPackageManager();
         Intent intent = new Intent();
         intent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
+        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         List<ResolveInfo> resolveInfos = pm.queryIntentActivities(intent, 0);
         // query only the package that matches that of the default engine
         for (int i = 0; i < resolveInfos.size(); i++) {
             ActivityInfo currentActivityInfo = resolveInfos.get(i).activityInfo;
             if (mDefaultEng.equals(currentActivityInfo.packageName)) {
                 intent.setClassName(mDefaultEng, currentActivityInfo.name);
-                this.startActivityForResult(intent, VOICE_DATA_INSTALLATION);
+                this.startActivity(intent);
             }
         }
     }