OSDN Git Service

Fix issue with repeatedly selecting the music notification.
authorMarco Nelissen <marcone@google.com>
Fri, 19 Mar 2010 20:00:37 +0000 (13:00 -0700)
committerMarco Nelissen <marcone@google.com>
Fri, 19 Mar 2010 20:32:07 +0000 (13:32 -0700)
Change-Id: Id0807b72ac09e28264074f82867b817c610f912b

AndroidManifest.xml
src/com/android/music/MediaAppWidgetProvider.java
src/com/android/music/MediaPlaybackActivityStarter.java [deleted file]
src/com/android/music/MusicUtils.java

index d42251c..0c0bee6 100644 (file)
@@ -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. -->
-        <activity android:name="com.android.music.MediaPlaybackActivityStarter"
+        <activity android:name="com.android.music.MediaPlaybackActivity"
                 android:theme="@android:style/Theme.NoTitleBar"
                 android:label="@string/mediaplaybacklabel"
                 android:taskAffinity=""
                 <category android:name="android.intent.category.DEFAULT" />
             </intent-filter>
         </activity>
-        <activity android:name="com.android.music.MediaPlaybackActivity"
-                android:theme="@android:style/Theme.NoTitleBar"
-                android:label="@string/mediaplaybacklabel" >
-        </activity>
 
         <activity android:name="com.android.music.StreamStarter"
                 android:theme="@android:style/Theme.Dialog" >
index cc7fdb9..f4ffc57 100644 (file)
@@ -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 (file)
index 248a5f1..0000000
+++ /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();
-    }
-    
-
-}
-
index ba28c57..398f462 100644 (file)
@@ -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);
         }
     }