[Feat] (Android): trace APK boots to POST; bottom nav bar switches to the render server

The trace flavor manifest removed PostActivity and made ServerControlActivity
the launcher, so the APK opened straight into the render server screen. Keep
both screens: PostActivity is the launcher again, and a bottom navigation bar
(NavBar, plugin flavor unaffected) switches between them via
FLAG_ACTIVITY_REORDER_TO_FRONT with transitions suppressed, so each screen
keeps its state. ServerControlActivity is singleTop now and handles extras in
onNewIntent so adb-driven starts still work. The POST screen also shows an
indeterminate progress bar while the self-test runs.
This commit is contained in:
2026-09-28 21:06:44 -04:00
parent b9a89967b0
commit 884f6aac96
4 changed files with 117 additions and 18 deletions
@@ -8,17 +8,16 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<application>
<!-- Launcher entry: start/stop the offscreen TCP supervisor (MobileGLServerService).
The trace flavor removes PostActivity, so without this the APK has no icon. -->
<!-- Render server control screen: start/stop the offscreen TCP supervisor
(MobileGLServerService) or the on-screen display server. Not the launcher:
PostActivity is the entry icon and the bottom navigation bar switches between
the two screens; exported so adb can drive it by explicit component with
listen/token/env/onscreen/start/stop extras. -->
<activity
android:name=".ServerControlActivity"
android:exported="true"
android:theme="@style/Theme.MobileGLPlugin">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
android:launchMode="singleTop"
android:theme="@style/Theme.MobileGLPlugin" />
<service
android:name=".MobileGLServerService"
android:exported="true"
@@ -42,9 +41,6 @@
<activity
android:name=".PluginActivity"
tools:node="remove" />
<activity
android:name=".PostActivity"
tools:node="remove" />
<meta-data
android:name="fclPlugin"
tools:node="remove" />
@@ -72,7 +72,7 @@ public final class ServerControlActivity extends Activity {
scrollView.setBackgroundColor(COLOR_BACKGROUND);
scrollView.setFillViewport(true);
scrollView.addView(contentLayout);
setContentView(scrollView);
setContentView(NavBar.wrap(this, scrollView, NavBar.TAB_SERVER));
contentLayout.addView(makeText("MobileGL Render Server", 20, COLOR_TEXT, true));
@@ -142,11 +142,23 @@ public final class ServerControlActivity extends Activity {
setStatus("Stopped.", COLOR_INFO);
}
// Intent extras prefill the form, so adb can drive the screen without the IME:
// --es listen @name --es token T --es env "K=V;K" --ez onscreen true --ez start true
// (--ez stop true instead stops). This mirrors how every other entry point in this
// APK is already driven by extras.
Intent intent = getIntent();
handleIntent(getIntent());
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
handleIntent(intent);
}
/**
* Intent extras prefill the form, so adb can drive the screen without the IME:
* --es listen @name --es token T --es env "K=V;K" --ez onscreen true --ez start true
* (--ez stop true instead stops). This mirrors how every other entry point in this
* APK is already driven by extras.
*/
private void handleIntent(Intent intent) {
if (intent != null) {
String prefillListen = intent.getStringExtra("listen");
if (prefillListen != null) listenField.setText(prefillListen);