Loading core/java/android/app/SystemServiceRegistry.java +11 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ import android.content.res.Resources; import android.content.rollback.RollbackManagerFrameworkInitializer; import android.debug.AdbManager; import android.debug.IAdbManager; import android.graphics.GameManager; import android.graphics.fonts.FontManager; import android.hardware.ConsumerIrManager; import android.hardware.ISerialManager; Loading Loading @@ -1426,6 +1427,16 @@ public final class SystemServiceRegistry { return new MediaMetricsManager(service, ctx.getUserId()); }}); registerService(Context.GAME_SERVICE, GameManager.class, new CachedServiceFetcher<GameManager>() { @Override public GameManager createService(ContextImpl ctx) throws ServiceNotFoundException { return new GameManager(ctx.getOuterContext(), ctx.mMainThread.getHandler()); } }); sInitializing = true; try { // Note: the following functions need to be @SystemApis, once they become mainline Loading core/java/android/content/Context.java +10 −0 Original line number Diff line number Diff line Loading @@ -5417,6 +5417,16 @@ public abstract class Context { */ public static final String SPEECH_RECOGNITION_SERVICE = "speech_recognition"; /** * Use with {@link #getSystemService(String)} to retrieve a * {@link android.graphics.GameManager}. * * @see #getSystemService(String) * * @hide */ public static final String GAME_SERVICE = "game"; /** * Determine whether the given permission is allowed for a particular * process and user ID running in the system. Loading core/tests/GameManagerTests/Android.bp 0 → 100644 +29 −0 Original line number Diff line number Diff line // Copyright (C) 2021 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. android_test { name: "FrameworksCoreGameManagerTests", // Include all test java files srcs: ["src/**/*.java"], static_libs: [ "androidx.test.rules", "frameworks-base-testutils", "junit", "truth-prebuilt", ], libs: ["android.test.runner"], platform_apis: true, certificate: "platform", test_suites: ["device-tests"], } core/tests/GameManagerTests/AndroidManifest.xml 0 → 100644 +30 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2021 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.graphics.gamemanagertests" android:sharedUserId="android.uid.system" > <application> <uses-library android:name="android.test.runner" /> </application> <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner" android:targetPackage="com.android.graphics.gamemanagertests" android:label="Game Manager Tests"/> </manifest> core/tests/GameManagerTests/AndroidTest.xml 0 → 100644 +32 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2021 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. --> <configuration description="Runs Game Manager Tests."> <option name="test-suite-tag" value="apct"/> <option name="test-suite-tag" value="apct-instrumentation"/> <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller"> <option name="cleanup-apks" value="true" /> <option name="test-file-name" value="FrameworksCoreGameManagerTests.apk" /> </target_preparer> <test class="com.android.tradefed.testtype.AndroidJUnitTest" > <option name="package" value="com.android.graphics.gamemanagertests" /> <option name="runner" value="androidx.test.runner.AndroidJUnitRunner" /> <option name="hidden-api-checks" value="false" /> </test> </configuration> Loading
core/java/android/app/SystemServiceRegistry.java +11 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ import android.content.res.Resources; import android.content.rollback.RollbackManagerFrameworkInitializer; import android.debug.AdbManager; import android.debug.IAdbManager; import android.graphics.GameManager; import android.graphics.fonts.FontManager; import android.hardware.ConsumerIrManager; import android.hardware.ISerialManager; Loading Loading @@ -1426,6 +1427,16 @@ public final class SystemServiceRegistry { return new MediaMetricsManager(service, ctx.getUserId()); }}); registerService(Context.GAME_SERVICE, GameManager.class, new CachedServiceFetcher<GameManager>() { @Override public GameManager createService(ContextImpl ctx) throws ServiceNotFoundException { return new GameManager(ctx.getOuterContext(), ctx.mMainThread.getHandler()); } }); sInitializing = true; try { // Note: the following functions need to be @SystemApis, once they become mainline Loading
core/java/android/content/Context.java +10 −0 Original line number Diff line number Diff line Loading @@ -5417,6 +5417,16 @@ public abstract class Context { */ public static final String SPEECH_RECOGNITION_SERVICE = "speech_recognition"; /** * Use with {@link #getSystemService(String)} to retrieve a * {@link android.graphics.GameManager}. * * @see #getSystemService(String) * * @hide */ public static final String GAME_SERVICE = "game"; /** * Determine whether the given permission is allowed for a particular * process and user ID running in the system. Loading
core/tests/GameManagerTests/Android.bp 0 → 100644 +29 −0 Original line number Diff line number Diff line // Copyright (C) 2021 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. android_test { name: "FrameworksCoreGameManagerTests", // Include all test java files srcs: ["src/**/*.java"], static_libs: [ "androidx.test.rules", "frameworks-base-testutils", "junit", "truth-prebuilt", ], libs: ["android.test.runner"], platform_apis: true, certificate: "platform", test_suites: ["device-tests"], }
core/tests/GameManagerTests/AndroidManifest.xml 0 → 100644 +30 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2021 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.graphics.gamemanagertests" android:sharedUserId="android.uid.system" > <application> <uses-library android:name="android.test.runner" /> </application> <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner" android:targetPackage="com.android.graphics.gamemanagertests" android:label="Game Manager Tests"/> </manifest>
core/tests/GameManagerTests/AndroidTest.xml 0 → 100644 +32 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2021 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. --> <configuration description="Runs Game Manager Tests."> <option name="test-suite-tag" value="apct"/> <option name="test-suite-tag" value="apct-instrumentation"/> <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller"> <option name="cleanup-apks" value="true" /> <option name="test-file-name" value="FrameworksCoreGameManagerTests.apk" /> </target_preparer> <test class="com.android.tradefed.testtype.AndroidJUnitTest" > <option name="package" value="com.android.graphics.gamemanagertests" /> <option name="runner" value="androidx.test.runner.AndroidJUnitRunner" /> <option name="hidden-api-checks" value="false" /> </test> </configuration>