Add sample XML to GameService javadoc to show how to request BIND_GAME_SERVICE permission.

Bug: 204504879
Bug: 202414447
Bug: 202417255
Bug: 210622264
Change-Id: I0659b13c0cb511a205e3423b5a0b5c14ffedc225
This commit is contained in:
Shannon Chen
2021-12-14 15:32:04 +00:00
parent ca3f277231
commit 5704c4dfe8

View File

@@ -38,10 +38,23 @@ import java.util.Objects;
* when a game session should begin. It is always kept running by the system.
* Because of this it should be kept as lightweight as possible.
*
* Heavy weight operations (such as showing UI) should be implemented in the
* <p>Heavyweight operations (such as showing UI) should be implemented in the
* associated {@link GameSessionService} when a game session is taking place. Its
* implementation should run in a separate process from the {@link GameService}.
*
* <p>To extend this class, you must declare the service in your manifest file with
* the {@link android.Manifest.permission#BIND_GAME_SERVICE} permission
* and include an intent filter with the {@link #SERVICE_INTERFACE} action. For example:
* <pre>
* &lt;service android:name=".GameService"
* android:label="&#64;string/service_name"
* android:permission="android.permission.BIND_GAME_SERVICE">
* &lt;intent-filter>
* &lt;action android:name="android.service.games.GameService" />
* &lt;/intent-filter>
* &lt;/service>
* </pre>
*
* @hide
*/
@SystemApi