Add GameSession#takeScreenshot API
The screenshot is taken using a new method added to the WindowManagerService: captureTaskSnapshot. The existing WindowManagerService methods for getting a TaskSnapshot are not suitable because they rely on previously cached snapshots (e.g., taken when the task is put into the background). To access the WindowManagerService functionality from the GameSessionService, an IBinder is passed from the GameServiceProviderInstanceImpl, which is running on the system server side (and thus can call the new method) to the GameSessionService when it is created. The GameSessionService then makes this reference available to each GameSession when the GameSession is created via the new GameSession#attach method. The GameSession can then use the IBinder reference to make an IPC back to the GameServiceProviderInstanceImpl instance which hosts the GameSessionService. This reference is then used by the GameSession to request a screenshot. By using the IBinder in this way, only GameSessions which are created via the system GameService can access the sensitive screenshot functionality implemented by GameServiceProviderInstanceImpl via the new captureTaskSnapshot method. Test: Manual e2e testing Bug: 210119689 Bug: 202414447 Bug: 202417255 CTS-Coverage-Bug: 206128693 Change-Id: If42dc9a5a5b6068db8670666a371117cf5865f20
Loading
Please register or sign in to comment