mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-18 18:42:46 +00:00
Fix IllegalArgumentException when trying to repin a disabled shortcut
This commit is contained in:
parent
eefc08db47
commit
977a1d4a3c
@ -517,6 +517,12 @@ public class AppView extends Activity implements AdapterFragmentCallbacks {
|
|||||||
if (!foundExistingApp) {
|
if (!foundExistingApp) {
|
||||||
// This app must be new
|
// This app must be new
|
||||||
appGridAdapter.addApp(new AppObject(app));
|
appGridAdapter.addApp(new AppObject(app));
|
||||||
|
|
||||||
|
// We could have a leftover shortcut from last time this PC was paired
|
||||||
|
// or if this app was removed then added again. Enable those shortcuts
|
||||||
|
// again if present.
|
||||||
|
shortcutHelper.enableAppShortcut(computer, app);
|
||||||
|
|
||||||
updated = true;
|
updated = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -192,4 +192,13 @@ public class ShortcutHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void enableAppShortcut(ComputerDetails computer, NvApp app) {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
|
||||||
|
String id = getShortcutIdForGame(computer, app);
|
||||||
|
if (getInfoForId(id) != null) {
|
||||||
|
sm.enableShortcuts(Collections.singletonList(id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user