mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-06 21:15:43 +00:00
Keep Android shortcut touch and system Back on separate displays
This commit is contained in:
1 parent
a051cd5fa6
commit
e72b41e2e4
10 files changed
+105
-7
No files matched your search
@@ -877,6 +877,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
private var runtimeRemovalBlocked = false
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
setTheme(R.style.SessionTheme)
|
||||
super.onCreate(savedInstanceState)
|
||||
com.droiddeck.launcher.session.xr.XrPanels.setMenuHost(this)
|
||||
AgentGuest.readyListener = agentReadyListener
|
||||
|
||||
@@ -32,6 +32,7 @@ internal object AndroidSteamApps {
|
||||
if (Build.VERSION.SDK_INT < MIN_ANDROID) return emptyList()
|
||||
val packages = prefs(context).all.keys.sorted()
|
||||
val apps = JSONArray()
|
||||
val appIds = mutableListOf<Long>()
|
||||
for (pkg in packages) {
|
||||
if (!supports(pkg)) continue
|
||||
val pm = context.packageManager
|
||||
@@ -41,12 +42,14 @@ internal object AndroidSteamApps {
|
||||
pm.getActivityInfo(component, 0).loadLabel(pm).toString()
|
||||
}.getOrDefault(pkg).ifBlank { pkg }
|
||||
val id = CRC32().apply { update("droiddeck-android-app:$pkg".toByteArray()) }.value or 0x80000000L
|
||||
appIds.add(id)
|
||||
apps.put(JSONObject().put("name", label).put("appid", id)
|
||||
.put("exe", LAUNCHER).put("dir", "/usr/local/bin").put("launch", pkg).put("native", true))
|
||||
}
|
||||
if (apps.length() == 0) return emptyList()
|
||||
val listing = File(sessionDir, "android-apps.json").apply { writeText(apps.toString()) }
|
||||
val env = mutableListOf("DD_ANDROID_APPS=${listing.absolutePath}")
|
||||
val env = mutableListOf("DD_ANDROID_APPS=${listing.absolutePath}",
|
||||
"DD_ANDROID_APP_IDS=${appIds.joinToString(" ")}")
|
||||
if (WirelessAdbFix.hasSavedPairing(context)) {
|
||||
val link = AgentAdb.prepare(context)
|
||||
if (link.paired) {
|
||||
|
||||
Reference in new issue
Block a user