Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Support MediaBrowserService in AOSP Music
Browse files Browse the repository at this point in the history
* Use MediaSession and MediaController to interact between playback
  service and playback applications
* Introduced MusicProvdier to scan music resources on local disk
* Removed unnecessary intents and unused activities
* Disabled playlist add, edit, delete function temporarily

Bug: 34748293
Test: make, playing music, browse through Bluetooth on Carkit
Change-Id: Ic88847aa0b3dd4ef5e13afcb839c78544ac05a2a
  • Loading branch information
Jack He committed Oct 24, 2017
1 parent a6a2840 commit f02d3c6
Show file tree
Hide file tree
Showing 59 changed files with 4,419 additions and 11,316 deletions.
3 changes: 1 addition & 2 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional

LOCAL_SRC_FILES := $(call all-java-files-under, src) \
src/com/android/music/IMediaPlaybackService.aidl
LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_PACKAGE_NAME := Music

Expand Down
330 changes: 99 additions & 231 deletions AndroidManifest.xml

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions proguard.flags
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
-keep class com.android.music.AudioPreview {
public void playPauseClicked(android.view.View);
}
Binary file added res/drawable-hdpi/ic_notification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_pause_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_play_arrow_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_skip_next_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_skip_previous_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_pause_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_play_arrow_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_skip_next_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_skip_previous_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_default_art.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_pause_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_play_arrow_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_skip_next_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_skip_previous_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
140 changes: 74 additions & 66 deletions res/layout-land/audio_player.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,78 +67,86 @@

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:baselineAligned="false"
android:paddingTop="8dip"
android:paddingBottom="2dip">
<!-- This is the LinearLayout that contains album/artist/track info -->
<LinearLayout android:id="@+id/trackinfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<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"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" />

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:baselineAligned="false"
android:paddingTop="8dip"
android:paddingBottom="2dip">

<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:textStyle="bold"
android:layout_gravity="center_vertical"
android:orientation="horizontal"
android:baselineAligned="false"
android:paddingTop="8dip"
android:paddingBottom="2dip">

<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="match_parent"
android:layout_height="wrap_content" />

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" />

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:baselineAligned="false"
android:paddingTop="4dip"
android:paddingBottom="2dip">

<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:textStyle="bold"
android:layout_gravity="center_vertical"
android:orientation="horizontal"
android:baselineAligned="false"
android:paddingTop="8dip"
android:paddingBottom="2dip">

<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:textStyle="bold"
android:layout_gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:orientation="horizontal"
android:baselineAligned="false"
android:paddingTop="4dip"
android:paddingBottom="2dip">

<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:textStyle="bold"
android:layout_gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

</LinearLayout>

</LinearLayout>

Expand Down
143 changes: 74 additions & 69 deletions res/layout-port-finger-854x480/audio_player.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,80 +51,85 @@

</LinearLayout>

<LinearLayout
android:layout_width="match_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"
<LinearLayout android:id="@+id/trackinfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" />

</LinearLayout>

<LinearLayout
android:layout_width="match_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: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="match_parent"
android:layout_height="wrap_content" />

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" />

</LinearLayout>

<LinearLayout
android:layout_width="match_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: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="match_parent"
android:layout_height="wrap_content" />

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" />

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="match_parent"
android:layout_height="wrap_content" />

</LinearLayout>
</LinearLayout>

<include layout="@layout/audio_player_common" />
Expand Down
Loading

0 comments on commit f02d3c6

Please sign in to comment.