Merge change 27014 into eclair
* changes:
Modified the test case name into a more meaningful name.
diff --git a/res/layout-long-port-finger/audio_player.xml b/res/layout-long-port-finger/audio_player.xml
new file mode 100644
index 0000000..fcb54dd
--- /dev/null
+++ b/res/layout-long-port-finger/audio_player.xml
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical">
+
+ <ImageView
+ android:id="@+id/album"
+ android:background="@drawable/album_border_large"
+ android:layout_width="270dip"
+ android:layout_height="270dip"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginTop="0dip" />
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:layout_gravity="center_horizontal">
+
+ <ImageButton android:id="@+id/curplaylist"
+ android:src="@drawable/ic_mp_current_playlist_btn"
+ android:layout_width="85dip"
+ android:layout_height="54dip" />
+
+ <ImageButton android:id="@+id/shuffle"
+ android:layout_width="85dip"
+ android:layout_height="54dip"
+ android:layout_marginLeft="19dip" />
+
+ <ImageButton android:id="@+id/repeat"
+ android:layout_width="85dip"
+ android:layout_height="54dip"
+ android:layout_marginLeft="19dip" />
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:baselineAligned="false"
+ android:paddingLeft="11dip"
+ android:paddingTop="2dip"
+ android:paddingBottom="4dip">
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginRight="4dip"
+ android:src="@drawable/ic_mp_artist_playback" />
+
+ <TextView android:id="@+id/artistname"
+ android:textSize="18sp"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:textStyle="bold"
+ android:layout_gravity="center_vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" />
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:baselineAligned="false"
+ android:paddingLeft="11dip"
+ android:paddingTop="4dip"
+ android:paddingBottom="8dip">
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginRight="4dip"
+ android:src="@drawable/ic_mp_album_playback" />
+
+ <TextView android:id="@+id/albumname"
+ android:textSize="14sp"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:layout_gravity="center_vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" />
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:baselineAligned="false"
+ android:paddingLeft="11dip"
+ android:paddingTop="0dip"
+ android:paddingBottom="8dip">
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginRight="4dip"
+ android:src="@drawable/ic_mp_song_playback" />
+
+ <TextView android:id="@+id/trackname"
+ android:textSize="14sp"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:layout_gravity="center_vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" />
+
+ </LinearLayout>
+
+ <include layout="@layout/audio_player_common" />
+
+</LinearLayout>
diff --git a/res/layout/media_picker_activity_expanding.xml b/res/layout/media_picker_activity_expanding.xml
index 3361431..888f909 100644
--- a/res/layout/media_picker_activity_expanding.xml
+++ b/res/layout/media_picker_activity_expanding.xml
@@ -29,7 +29,7 @@
android:textSize="18sp"
android:drawSelectorOnTop="false"
android:fastScrollEnabled="true"
- android:indicatorLeft="30dip" />
- android:indicatorRight="60dip" />
+ android:indicatorLeft="8dip"
+ android:indicatorRight="52dip" />
</LinearLayout>
diff --git a/src/com/android/music/AlbumBrowserActivity.java b/src/com/android/music/AlbumBrowserActivity.java
index 414947a..49a3893 100644
--- a/src/com/android/music/AlbumBrowserActivity.java
+++ b/src/com/android/music/AlbumBrowserActivity.java
@@ -229,7 +229,8 @@
CharSequence fancyName = "";
if (mAlbumCursor != null && mAlbumCursor.getCount() > 0) {
mAlbumCursor.moveToFirst();
- fancyName = mAlbumCursor.getString(3);
+ fancyName = mAlbumCursor.getString(
+ mAlbumCursor.getColumnIndex(MediaStore.Audio.Albums.ARTIST));
if (fancyName == null || fancyName.equals(MediaFile.UNKNOWN_STRING))
fancyName = getText(R.string.unknown_artist_name);
}
diff --git a/src/com/android/music/MediaPlaybackService.java b/src/com/android/music/MediaPlaybackService.java
index ddca25b..f92bc6d 100644
--- a/src/com/android/music/MediaPlaybackService.java
+++ b/src/com/android/music/MediaPlaybackService.java
@@ -561,28 +561,30 @@
}
@Override
- public void onStart(Intent intent, int startId) {
+ public int onStartCommand(Intent intent, int flags, int startId) {
mServiceStartId = startId;
mDelayedStopHandler.removeCallbacksAndMessages(null);
-
- String action = intent.getAction();
- String cmd = intent.getStringExtra("command");
-
- if (CMDNEXT.equals(cmd) || NEXT_ACTION.equals(action)) {
- next(true);
- } else if (CMDPREVIOUS.equals(cmd) || PREVIOUS_ACTION.equals(action)) {
- prev();
- } else if (CMDTOGGLEPAUSE.equals(cmd) || TOGGLEPAUSE_ACTION.equals(action)) {
- if (isPlaying()) {
+
+ if (intent != null) {
+ String action = intent.getAction();
+ String cmd = intent.getStringExtra("command");
+
+ if (CMDNEXT.equals(cmd) || NEXT_ACTION.equals(action)) {
+ next(true);
+ } else if (CMDPREVIOUS.equals(cmd) || PREVIOUS_ACTION.equals(action)) {
+ prev();
+ } else if (CMDTOGGLEPAUSE.equals(cmd) || TOGGLEPAUSE_ACTION.equals(action)) {
+ if (isPlaying()) {
+ pause();
+ } else {
+ play();
+ }
+ } else if (CMDPAUSE.equals(cmd) || PAUSE_ACTION.equals(action)) {
pause();
- } else {
- play();
+ } else if (CMDSTOP.equals(cmd)) {
+ pause();
+ seek(0);
}
- } else if (CMDPAUSE.equals(cmd) || PAUSE_ACTION.equals(action)) {
- pause();
- } else if (CMDSTOP.equals(cmd)) {
- pause();
- seek(0);
}
// make sure the service will shut down on its own if it was
@@ -590,6 +592,7 @@
mDelayedStopHandler.removeCallbacksAndMessages(null);
Message msg = mDelayedStopHandler.obtainMessage();
mDelayedStopHandler.sendMessageDelayed(msg, IDLE_DELAY);
+ return START_STICKY;
}
@Override