1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 ~ Copyright 2017 The Android Open Source Project 4 ~ 5 ~ Licensed under the Apache License, Version 2.0 (the "License"); 6 ~ you may not use this file except in compliance with the License. 7 ~ You may obtain a copy of the License at 8 ~ 9 ~ http://www.apache.org/licenses/LICENSE-2.0 10 ~ 11 ~ Unless required by applicable law or agreed to in writing, software 12 ~ distributed under the License is distributed on an "AS IS" BASIS, 13 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 ~ See the License for the specific language governing permissions and 15 ~ limitations under the License. 16 --> 17 18<manifest xmlns:android="http://schemas.android.com/apk/res/android" 19 package="com.example.android.mediasession"> 20 21 <uses-permission android:name="android.permission.INTERNET"/> 22 <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/> 23 <uses-permission android:name="android.permission.WAKE_LOCK"/> 24 25 <application 26 android:allowBackup="true" 27 android:icon="@mipmap/ic_launcher" 28 android:label="@string/app_name" 29 android:supportsRtl="true" 30 android:theme="@style/AppTheme"> 31 <activity 32 android:name=".ui.MainActivity" 33 android:launchMode="singleTop"> 34 <intent-filter> 35 <action android:name="android.intent.action.MAIN"/> 36 37 <category android:name="android.intent.category.LAUNCHER"/> 38 </intent-filter> 39 </activity> 40 41 <service 42 android:name=".service.MusicService" 43 android:enabled="true" 44 android:exported="true"> 45 <intent-filter> 46 <action android:name="android.media.browse.MediaBrowserService"/> 47 </intent-filter> 48 </service> 49 50 <!-- 51 MediaSession, prior to API 21, uses a broadcast receiver to communicate with a 52 media session. It does not have to be this broadcast receiver, but it must 53 handle the action "android.intent.action.MEDIA_BUTTON". 54 55 Additionally, this is used to resume the service from an inactive state upon 56 receiving a media button event (such as "play"). 57 --> 58 <receiver android:name="android.support.v4.media.session.MediaButtonReceiver"> 59 <intent-filter> 60 <action android:name="android.intent.action.MEDIA_BUTTON"/> 61 </intent-filter> 62 </receiver> 63 </application> 64 65</manifest>