From: Marco Nelissen Date: Fri, 19 Mar 2010 20:00:37 +0000 (-0700) Subject: Fix issue with repeatedly selecting the music notification. X-Git-Tag: android-x86-2.2~18 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=38bcd927f46d6477e6bae88795c38bfe92d7a9f9;hp=8d39cfd9d2cc12066a08a66450a6ddefce7b4cf4;p=android-x86%2Fpackages-apps-Music.git Fix issue with repeatedly selecting the music notification. Change-Id: Id0807b72ac09e28264074f82867b817c610f912b --- diff --git a/AndroidManifest.xml b/AndroidManifest.xml index d42251c..0c0bee6 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -61,7 +61,7 @@ to it we want it back in its initial state. We exclude from recents since this is accessible through a notification when appropriate. --> - - - diff --git a/src/com/android/music/MediaAppWidgetProvider.java b/src/com/android/music/MediaAppWidgetProvider.java index cc7fdb9..f4ffc57 100644 --- a/src/com/android/music/MediaAppWidgetProvider.java +++ b/src/com/android/music/MediaAppWidgetProvider.java @@ -159,7 +159,7 @@ public class MediaAppWidgetProvider extends AppWidgetProvider { * Link up various button actions using {@link PendingIntents}. * * @param playerActive True if player is active in background, which means - * widget click will launch {@link MediaPlaybackActivityStarter}, + * widget click will launch {@link MediaPlaybackActivity}, * otherwise we launch {@link MusicBrowserActivity}. */ private void linkButtons(Context context, RemoteViews views, boolean playerActive) { @@ -170,7 +170,7 @@ public class MediaAppWidgetProvider extends AppWidgetProvider { final ComponentName serviceName = new ComponentName(context, MediaPlaybackService.class); if (playerActive) { - intent = new Intent(context, MediaPlaybackActivityStarter.class); + intent = new Intent(context, MediaPlaybackActivity.class); pendingIntent = PendingIntent.getActivity(context, 0 /* no requestCode */, intent, 0 /* no flags */); views.setOnClickPendingIntent(R.id.album_appwidget, pendingIntent); diff --git a/src/com/android/music/MediaPlaybackActivityStarter.java b/src/com/android/music/MediaPlaybackActivityStarter.java deleted file mode 100644 index 248a5f1..0000000 --- a/src/com/android/music/MediaPlaybackActivityStarter.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.music; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; - -public class MediaPlaybackActivityStarter extends Activity -{ - public MediaPlaybackActivityStarter() - { - } - - @Override - public void onCreate(Bundle icicle) - { - super.onCreate(icicle); - Intent i = new Intent(getIntent()); - i.setClass(this, MediaPlaybackActivity.class); - startActivity(i); - finish(); - } - - -} - diff --git a/src/com/android/music/MusicUtils.java b/src/com/android/music/MusicUtils.java index ba28c57..398f462 100644 --- a/src/com/android/music/MusicUtils.java +++ b/src/com/android/music/MusicUtils.java @@ -803,7 +803,7 @@ public class MusicUtils { sService.play(); } catch (RemoteException ex) { } finally { - Intent intent = new Intent(context, MediaPlaybackActivity.class) + Intent intent = new Intent("com.android.music.PLAYBACK_VIEWER") .setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); context.startActivity(intent); } @@ -1176,10 +1176,10 @@ public class MusicUtils { } final TabWidget ll = (TabWidget) a.findViewById(R.id.buttonbar); - ll.setCurrentTab((Integer) v.getTag()); activateTab(a, id); if (id != R.id.nowplayingtab) { + ll.setCurrentTab((Integer) v.getTag()); setIntPref(a, "activetab", id); } }