Skip to content

Commit

Permalink
SystemUI: Add support for GameSpace
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nullxception authored and OhMyVenyx committed Jan 19, 2023
1 parent 109f559 commit 7fa74c6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
14 changes: 14 additions & 0 deletions core/java/android/provider/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -5179,6 +5179,20 @@ public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean
@Readable
public static final String POINTER_SPEED = "pointer_speed";

/**
* GameSpace: List of added games by user
* @hide
*/
@Readable
public static final String GAMESPACE_GAME_LIST = "gamespace_game_list";

/**
* GameSpace: Whether fullscreen intent will be suppressed while in game session
* @hide
*/
@Readable
public static final String GAMESPACE_SUPPRESS_FULLSCREEN_INTENT = "gamespace_suppress_fullscreen_intent";

/**
* Whether lock-to-app will be triggered by long-press on recents.
* @hide
Expand Down
4 changes: 4 additions & 0 deletions core/res/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,10 @@
<protected-broadcast android:name="com.android.server.app.AppLockManagerService.APP_LOCK_TIMEOUT" />
<protected-broadcast android:name="android.app.action.UNLOCK_APP" />

<!-- GameSpace -->
<protected-broadcast android:name="io.chaldeaprjkt.gamespace.action.GAME_START" />
<protected-broadcast android:name="io.chaldeaprjkt.gamespace.action.GAME_STOP" />

<!-- ====================================================================== -->
<!-- RUNTIME PERMISSIONS -->
<!-- ====================================================================== -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,8 @@ public void animateCollapsePanels(int flags, boolean force) {
private NadSettingsObserver mNadSettingsObserver;
private boolean mShowNavBar;

protected GameSpaceManager mGameSpaceManager;

// expanded notifications
// the sliding/resizing panel within the notification window
protected NotificationPanelViewController mNotificationPanelViewController;
Expand Down Expand Up @@ -947,6 +949,7 @@ public StatusBar(

mActivityIntentHelper = new ActivityIntentHelper(mContext);
mActivityLaunchAnimator = activityLaunchAnimator;
mGameSpaceManager = new GameSpaceManager(mContext, mKeyguardStateController);

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

public GameSpaceManager getGameSpaceManager() {
return mGameSpaceManager;
}

boolean isTransientShown() {
return mTransientShown;
}
Expand Down

0 comments on commit 7fa74c6

Please sign in to comment.