diff options
author | Daniel Sandler <dsandler@google.com> | 2009-11-11 11:27:00 -0800 |
---|---|---|
committer | Daniel Sandler <dsandler@google.com> | 2009-11-11 11:27:00 -0800 |
commit | 9463551d754302e158b80357d9c5c88517fe6e58 (patch) | |
tree | 4b1baeba1b42544267f16b861ad3b4ffddd54ce5 | |
parent | ba328cd4a23a13732467ba5533a94ac3d7cbbf4e (diff) | |
download | android_packages_apps_DeskClock-9463551d754302e158b80357d9c5c88517fe6e58.tar.gz android_packages_apps_DeskClock-9463551d754302e158b80357d9c5c88517fe6e58.tar.bz2 android_packages_apps_DeskClock-9463551d754302e158b80357d9c5c88517fe6e58.zip |
Fix http://b/2232909 .
Rather than being fancy and firing off the NOW_PLAYING
activity (which doesn't like to be launched if nothing's
playing), we just launch the Music app as if it were
starting from Launcher.
-rw-r--r-- | src/com/android/deskclock/DeskClock.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/deskclock/DeskClock.java b/src/com/android/deskclock/DeskClock.java index 0cb23c85e..c7164fb25 100644 --- a/src/com/android/deskclock/DeskClock.java +++ b/src/com/android/deskclock/DeskClock.java @@ -89,9 +89,10 @@ public class DeskClock extends Activity { private static final String LOG_TAG = "DeskClock"; - // Intent used to start the music player. - private static final String MUSIC_NOW_PLAYING = "com.android.music.PLAYBACK_VIEWER"; + // Package ID of the music player. + private static final String MUSIC_PACKAGE_ID = "com.android.music"; + // Alarm action for midnight (so we can update the date display). private static final String ACTION_MIDNIGHT = "com.android.deskclock.MIDNIGHT"; // Interval between polls of the weather widget. Its refresh period is @@ -633,7 +634,10 @@ public class DeskClock extends Activity { musicButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { try { - startActivity(new Intent(MUSIC_NOW_PLAYING)); + Intent musicAppQuery = getPackageManager().getLaunchIntentForPackage(MUSIC_PACKAGE_ID); + if (musicAppQuery != null) { + startActivity(musicAppQuery); + } } catch (android.content.ActivityNotFoundException e) { Log.e(LOG_TAG, "Couldn't launch music browser", e); } |