Add the app name to the shortcut trampoline

This commit is contained in:
Cameron Gutman 2019-07-16 22:32:37 -07:00
parent d54fdc9f5f
commit e27129fc48
4 changed files with 11 additions and 6 deletions

View File

@ -276,10 +276,8 @@ public class Game extends Activity implements SurfaceHolder.Callback,
shortcutHelper = new ShortcutHelper(this);
shortcutHelper.reportComputerShortcutUsed(computer);
if (appName != null) {
NvApp app = new NvApp();
app.setAppId(appId);
app.setAppName(appName);
shortcutHelper.reportGameLaunched(computer, app);
// This may be null if launched from the "Resume Session" PC context menu item
shortcutHelper.reportGameLaunched(computer, new NvApp(appName, appId, willStreamHdr));
}
// Initialize the MediaCodec helper before creating the decoder

View File

@ -24,11 +24,13 @@ import java.util.UUID;
public class ShortcutTrampoline extends Activity {
private String uuidString;
private String appIdString;
private String appNameString;
private ArrayList<Intent> intentStack = new ArrayList<>();
private ComputerDetails computer;
private SpinnerDialog blockingLoadSpinner;
public final static String APP_NAME_EXTRA = "AppName";
public final static String APP_ID_EXTRA = "AppId";
private ComputerManagerService.ComputerManagerBinder managerBinder;
@ -104,7 +106,7 @@ public class ShortcutTrampoline extends Activity {
if (appIdString != null && appIdString.length() > 0) {
if (details.runningGameId == 0 || details.runningGameId == Integer.parseInt(appIdString)) {
intentStack.add(ServerHelper.createStartIntent(ShortcutTrampoline.this,
new NvApp(null, Integer.parseInt(appIdString), false), details, managerBinder));
new NvApp(appNameString, Integer.parseInt(appIdString), false), details, managerBinder));
// Close this activity
finish();
@ -115,7 +117,7 @@ public class ShortcutTrampoline extends Activity {
// Create the start intent immediately, so we can safely unbind the managerBinder
// below before we return.
final Intent startIntent = ServerHelper.createStartIntent(ShortcutTrampoline.this,
new NvApp(null, Integer.parseInt(appIdString), false), details, managerBinder);
new NvApp(appNameString, Integer.parseInt(appIdString), false), details, managerBinder);
UiHelper.displayQuitConfirmationDialog(ShortcutTrampoline.this, new Runnable() {
@Override
@ -243,6 +245,9 @@ public class ShortcutTrampoline extends Activity {
uuidString = getIntent().getStringExtra(AppView.UUID_EXTRA);
appIdString = getIntent().getStringExtra(APP_ID_EXTRA);
// Optional - may be null
appNameString = getIntent().getStringExtra(APP_NAME_EXTRA);
if (validateInput()) {
// Bind to the computer manager service
bindService(new Intent(this, ComputerManagerService.class), serviceConnection,

View File

@ -153,6 +153,7 @@ public class ShortcutHelper {
i.putExtra(AppView.NAME_EXTRA, computer.name);
i.putExtra(AppView.UUID_EXTRA, computer.uuid);
i.putExtra(ShortcutTrampoline.APP_NAME_EXTRA, app.getAppName());
i.putExtra(ShortcutTrampoline.APP_ID_EXTRA, ""+app.getAppId());
i.setAction(Intent.ACTION_DEFAULT);

View File

@ -130,6 +130,7 @@ public class TvChannelHelper {
i.putExtra(AppView.NAME_EXTRA, computer.name);
i.putExtra(AppView.UUID_EXTRA, computer.uuid);
i.putExtra(ShortcutTrampoline.APP_NAME_EXTRA, app.getAppName());
i.putExtra(ShortcutTrampoline.APP_ID_EXTRA, ""+app.getAppId());
i.setAction(Intent.ACTION_DEFAULT);