From 8423a1772b340c02e07c066b646baeae18521fe7 Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Thu, 12 Nov 2009 13:40:19 -0800 Subject: [PATCH] Fix http://b/2249983 . Place the other activities in Clock in their own task affinity and hide them from the recent apps list. Additionally, launch other apps with the new task flag (since we're behaving like a launcher). --- AndroidManifest.xml | 14 +++++++++++--- src/com/android/deskclock/DeskClock.java | 12 +++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 25ac74d..b030918 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -32,14 +32,22 @@ - + - + diff --git a/src/com/android/deskclock/DeskClock.java b/src/com/android/deskclock/DeskClock.java index f8b7129..e7060b5 100644 --- a/src/com/android/deskclock/DeskClock.java +++ b/src/com/android/deskclock/DeskClock.java @@ -630,7 +630,8 @@ public class DeskClock extends Activity { startActivity(new Intent( Intent.ACTION_VIEW, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI) - .putExtra("slideshow", true)); + .putExtra("slideshow", true) + .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)); } catch (android.content.ActivityNotFoundException e) { Log.e(LOG_TAG, "Couldn't launch image browser", e); } @@ -641,7 +642,9 @@ public class DeskClock extends Activity { musicButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { try { - Intent musicAppQuery = getPackageManager().getLaunchIntentForPackage(MUSIC_PACKAGE_ID); + Intent musicAppQuery = getPackageManager() + .getLaunchIntentForPackage(MUSIC_PACKAGE_ID) + .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); if (musicAppQuery != null) { startActivity(musicAppQuery); } @@ -656,6 +659,7 @@ public class DeskClock extends Activity { public void onClick(View v) { startActivity( new Intent(Intent.ACTION_MAIN) + .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) .addCategory(Intent.CATEGORY_HOME)); } }); @@ -680,7 +684,9 @@ public class DeskClock extends Activity { public void onClick(View v) { if (!supportsWeather()) return; - Intent genieAppQuery = getPackageManager().getLaunchIntentForPackage(GENIE_PACKAGE_ID); + Intent genieAppQuery = getPackageManager() + .getLaunchIntentForPackage(GENIE_PACKAGE_ID) + .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); if (genieAppQuery != null) { startActivity(genieAppQuery); } -- 2.11.0