Initial code for AML MediaSessionService

Bug: 123000882
Test: build / manually
Change-Id: If2234340ed835fa02dcdbd1fd1b968418fe0a8ac
This commit is contained in:
Insun Kang
2019-01-16 17:21:05 +09:00
parent 0b9b1d420a
commit b3517bf1fe
6 changed files with 163 additions and 0 deletions

View File

@@ -1,3 +1,20 @@
java_library {
name: "media1",
srcs: [
":media1-srcs",
],
sdk_version: "system_current",
}
filegroup {
name: "media1-srcs",
srcs: [
"java/android/media/session/MediaSessionProviderService.java",
],
}
java_library {
// TODO: include media2.jar in the media apex and add it to the bootclasspath.
name: "media2",

View File

@@ -0,0 +1,35 @@
/*
* Copyright (C) 2019 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 android.media.session;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
/**
* Abstract class for mainline module services.
*
* @hide // TODO: Make it as a @SystemApi
*/
public abstract class MediaSessionProviderService extends Service {
@Override
public IBinder onBind(Intent intent) {
// TODO: Return IMediaSessionProviderService.Stub()
return null;
}
}

View File

@@ -0,0 +1,21 @@
android_app {
name: "MediaCore",
srcs: [
"src/**/*.java",
],
static_libs: [
// TODO: Temporarily statically linked. Should go into "libs"
"media1",
],
// System app
platform_apis: true,
// Privileged app
privileged: true,
// Make sure that the implementation only relies on SDK or system APIs.
sdk_version: "system_current",
}

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/* //device/apps/common/AndroidManifest.xml
**
** Copyright 2019, 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.
*/
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.media" coreApp="true" android:sharedUserId="android.uid.system"
android:sharedUserLabel="@string/android_system_label">
<application android:process="system"
android:persistent="true"
android:directBootAware="true">
<service android:name="AmlMediaSessionProviderService" android:singleUser="true">
<intent-filter>
<action android:name="android.media.session.MediaSessionProviderService"/>
</intent-filter>
</service>
</application>
</manifest>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2019 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.
-->
<resources>
<!-- Label for the Android system components when they are shown to the user. -->
<string name="android_system_label" translatable="false">Android System</string>
</resources>

View File

@@ -0,0 +1,37 @@
/*
* Copyright 2019 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.media;
import android.content.Context;
import android.media.session.MediaSessionProviderService;
import android.os.PowerManager;
import android.util.Log;
/**
* System implementation of MediaSessionProviderService
*/
public class AmlMediaSessionProviderService extends MediaSessionProviderService {
private static final String TAG = "AmlMediaSessionProviderS";
static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
private Context mContext;
public AmlMediaSessionProviderService(Context context) {
mContext = context;
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
}
}