Skip to content

Commit 7fa74c6

Browse files
nullxceptionOhMyVenyx
authored andcommitted
SystemUI: Add support for GameSpace
This is an addon for GameSpace for broadcasting about game start/stop. Additionally, it also has special option for suppressing fullscreen intent like incoming call. This also squash commits: - SystemUI: Improve GameSpace lifecycle and broadcast handling - GameSpaceManager: Handle various case against "locking screen" scenario
1 parent 109f559 commit 7fa74c6

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

core/java/android/provider/Settings.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5179,6 +5179,20 @@ public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean
51795179
@Readable
51805180
public static final String POINTER_SPEED = "pointer_speed";
51815181

5182+
/**
5183+
* GameSpace: List of added games by user
5184+
* @hide
5185+
*/
5186+
@Readable
5187+
public static final String GAMESPACE_GAME_LIST = "gamespace_game_list";
5188+
5189+
/**
5190+
* GameSpace: Whether fullscreen intent will be suppressed while in game session
5191+
* @hide
5192+
*/
5193+
@Readable
5194+
public static final String GAMESPACE_SUPPRESS_FULLSCREEN_INTENT = "gamespace_suppress_fullscreen_intent";
5195+
51825196
/**
51835197
* Whether lock-to-app will be triggered by long-press on recents.
51845198
* @hide

core/res/AndroidManifest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,10 @@
717717
<protected-broadcast android:name="com.android.server.app.AppLockManagerService.APP_LOCK_TIMEOUT" />
718718
<protected-broadcast android:name="android.app.action.UNLOCK_APP" />
719719

720+
<!-- GameSpace -->
721+
<protected-broadcast android:name="io.chaldeaprjkt.gamespace.action.GAME_START" />
722+
<protected-broadcast android:name="io.chaldeaprjkt.gamespace.action.GAME_STOP" />
723+
720724
<!-- ====================================================================== -->
721725
<!-- RUNTIME PERMISSIONS -->
722726
<!-- ====================================================================== -->

packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,8 @@ public void animateCollapsePanels(int flags, boolean force) {
543543
private NadSettingsObserver mNadSettingsObserver;
544544
private boolean mShowNavBar;
545545

546+
protected GameSpaceManager mGameSpaceManager;
547+
546548
// expanded notifications
547549
// the sliding/resizing panel within the notification window
548550
protected NotificationPanelViewController mNotificationPanelViewController;
@@ -947,6 +949,7 @@ public StatusBar(
947949

948950
mActivityIntentHelper = new ActivityIntentHelper(mContext);
949951
mActivityLaunchAnimator = activityLaunchAnimator;
952+
mGameSpaceManager = new GameSpaceManager(mContext, mKeyguardStateController);
950953

951954
// The status bar background may need updating when the ongoing call status changes.
952955
mOngoingCallController.addCallback((animate) -> maybeUpdateBarMode());
@@ -4543,6 +4546,10 @@ public NotificationGutsManager getGutsManager() {
45434546
return mGutsManager;
45444547
}
45454548

4549+
public GameSpaceManager getGameSpaceManager() {
4550+
return mGameSpaceManager;
4551+
}
4552+
45464553
boolean isTransientShown() {
45474554
return mTransientShown;
45484555
}

0 commit comments

Comments
 (0)