Compare commits
No commits in common. "04c980f32af39410e252350621a18e5b7e614133" and "2739b278cd6558c82ce98c7143db25f23d328325" have entirely different histories.
04c980f32a
...
2739b278cd
27 changed files with 82 additions and 852 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -13,4 +13,3 @@ output/*.log
|
||||||
output/wake-before/
|
output/wake-before/
|
||||||
output/Luma-wake-tests.apk*
|
output/Luma-wake-tests.apk*
|
||||||
output/performance/
|
output/performance/
|
||||||
output/private/
|
|
||||||
|
|
|
||||||
|
|
@ -23,11 +23,3 @@ Follow Android and Android TV best practices. Keep Luma portable across current
|
||||||
- Preserve D-pad navigation, accessibility, focus visibility, smooth scrolling, and lifecycle recovery. Test meaningful failure and recovery cases for changes affecting rendering, persistence, updates, or background work.
|
- Preserve D-pad navigation, accessibility, focus visibility, smooth scrolling, and lifecycle recovery. Test meaningful failure and recovery cases for changes affecting rendering, persistence, updates, or background work.
|
||||||
- Do not ship a claimed performance improvement based only on an isolated microbenchmark. Compare normal and rapid navigation on both available devices and disclose material tradeoffs or untested cases.
|
- Do not ship a claimed performance improvement based only on an isolated microbenchmark. Compare normal and rapid navigation on both available devices and disclose material tradeoffs or untested cases.
|
||||||
- Review the final diff for hardcoded device assumptions and secrets before committing. Document relevant behavior, settings, and validation alongside the change.
|
- Review the final diff for hardcoded device assumptions and secrets before committing. Document relevant behavior, settings, and validation alongside the change.
|
||||||
|
|
||||||
## Build and release
|
|
||||||
|
|
||||||
- Set `JAVA_HOME` (JDK 17) and `ANDROID_HOME` (Android SDK), then run `python scripts/build.py --tests`. On macOS/Linux `bash scripts/build.sh --tests` wraps the same build. Run device tests serially, with an explicit ADB serial; restore preferences and remove the test APK afterward.
|
|
||||||
- Version both `app/build.gradle` and `app/src/main/AndroidManifest.xml`, edit `docs/UPDATE_NOTES.md`, build, and commit **both** `output/Luma.apk` and `output/update.json` with source/docs to `main`. Push `main`, then verify the public feed and downloaded APK checksum. This branch feed is the release mechanism; no separate release upload is required.
|
|
||||||
- Signing uses ignored `.tools/luma-development.keystore` and `.tools/signing.json`, or `LUMA_KEYSTORE`, `LUMA_KEY_ALIAS`, and `LUMA_KEYSTORE_PASSWORD`. Back up the key and local signing configuration securely. Never regenerate them to fix a routine build failure.
|
|
||||||
- Version 1.1.13 intentionally begins a new signing identity after the old key was lost and replacement was authorized. Versions through 1.1.12 require a one-time uninstall/reinstall, which resets app data. Keep signature verification enabled; later releases must reuse the replacement key.
|
|
||||||
- Move mode must compare the actual displayed order with the requested order before rebuilding; do not mutate `visibleApps` before the reuse check. Keep selection stable while focused children are replaced. `HomeActionsInstrumentation` covers remote movement/save/cancel, network lifecycle, and simulated input-header layout.
|
|
||||||
|
|
|
||||||
27
README.md
27
README.md
|
|
@ -2,9 +2,7 @@
|
||||||
|
|
||||||
A native, remote-first Android TV launcher designed for limited-memory streamers and integrated TVs. Its package name is `tv.luma.launcher`.
|
A native, remote-first Android TV launcher designed for limited-memory streamers and integrated TVs. Its package name is `tv.luma.launcher`.
|
||||||
|
|
||||||
Version **1.1.13** fixes D-pad app rearranging, adds uninstall to the app menu and a network status shortcut beside Settings, and removes the duplicate Personalize footer button. Physical-input controls have their own space on compatible TVs.
|
Version **1.1.12** removes obsolete alternate-launcher integration, avoids redundant screen-on window updates during navigation, and waits for focus to settle before transitioning app background colors. Every resume restores missing images, including when Android briefly pauses the launcher without stopping it. Leaving the launcher releases image memory. Updates can be installed directly from the TV; physical-input controls appear on compatible TVs.
|
||||||
|
|
||||||
**One-time reinstall required:** the original signing key was lost. This release uses an authorized replacement key, so Android cannot install it over versions through 1.1.12. Uninstall the old Luma and install this APK; Luma settings and Plex credentials reset. Subsequent updates use the replacement key normally. Update signature verification remains enabled.
|
|
||||||
|
|
||||||
## Use it
|
## Use it
|
||||||
|
|
||||||
|
|
@ -15,11 +13,10 @@ Press **Home** after configuring Home routing, or open **Luma** from Android's a
|
||||||
```
|
```
|
||||||
|
|
||||||
- D-pad navigates the installed app grid; OK opens an app.
|
- D-pad navigates the installed app grid; OK opens an app.
|
||||||
- Hold OK on an app to move it, move it to the front, hide it, uninstall it, or open Android app info. Uninstall is available for user-installed apps and opens Android's confirmation screen; system apps retain app info.
|
- Hold OK on an app to move it, move it to the front, hide it, or open Android app info.
|
||||||
- In move mode, arrows move the app; OK saves and Back restores the previous order.
|
- In move mode, arrows move the app; OK saves and Back restores the previous order.
|
||||||
- Menu or the gear opens Luma settings. **All apps** includes hidden apps so they can be restored.
|
- Menu or the gear opens Luma settings. **All apps** includes hidden apps so they can be restored.
|
||||||
- Back scrolls to the first row and stays on Luma. Home returns to Luma.
|
- Back scrolls to the first row and stays on Luma. Home returns to Luma.
|
||||||
- The network icon beside Settings opens network settings. It shows Wi-Fi or Ethernet for the active connection, muted when disconnected and gold when Android has not validated internet access. Its accessibility label describes the state. It uses a callback only while Home is foreground, without scans, location permission, or polling. Unsupported network-settings screens fall back to wireless settings and then general settings.
|
|
||||||
|
|
||||||
## Default launcher and Home routing
|
## Default launcher and Home routing
|
||||||
|
|
||||||
|
|
@ -94,10 +91,10 @@ No SSH key or Forgejo account token is stored on the TV. For branch-based Forgej
|
||||||
### Publish an update
|
### Publish an update
|
||||||
|
|
||||||
1. Increase `versionCode` and `versionName` in both `app/src/main/AndroidManifest.xml` and `app/build.gradle`. Every published update needs a greater version code.
|
1. Increase `versionCode` and `versionName` in both `app/src/main/AndroidManifest.xml` and `app/build.gradle`. Every published update needs a greater version code.
|
||||||
2. Edit `docs/UPDATE_NOTES.md`, then run `python scripts/build.py` (or `bash scripts/build.sh`) using the existing signing keystore. Set `JAVA_HOME` and `ANDROID_HOME`. The build generates `output/Luma.apk` and `output/update.json` together, including the APK checksum and size.
|
2. Edit `docs/UPDATE_NOTES.md`, then run `scripts/build.sh` using the existing signing keystore. The build generates `output/Luma.apk` and `output/update.json` together, including the APK checksum and size.
|
||||||
3. Commit and push the source changes, **both output files**, and release notes to `main`. The next scheduled/manual check on each TV discovers the update. No separate release upload or account setup is needed.
|
3. Commit and push the source changes, **both output files**, and release notes to `main`. The next scheduled/manual check on each TV discovers the update. No separate release upload or account setup is needed.
|
||||||
|
|
||||||
Preserve `.tools/luma-development.keystore` and `.tools/signing.json` securely outside Git: the same signing key and password are required for every update. The first APK using the replacement identity must be installed on each TV once, through ADB, Downloader, or a file manager; later updates can be handled within Luma.
|
Preserve `.tools/luma-development.keystore` separately from Git: the same signing key is required for every update. The first updater-capable APK must be installed on each TV once, through ADB, Downloader, or a file manager; later updates can be handled within Luma.
|
||||||
|
|
||||||
Android scheduling and installation behavior follow the [JobInfo API](https://developer.android.com/reference/android/app/job/JobInfo.Builder) and [package installation API](https://developer.android.com/reference/android/content/pm/PackageManager#canRequestPackageInstalls()).
|
Android scheduling and installation behavior follow the [JobInfo API](https://developer.android.com/reference/android/app/job/JobInfo.Builder) and [package installation API](https://developer.android.com/reference/android/content/pm/PackageManager#canRequestPackageInstalls()).
|
||||||
|
|
||||||
|
|
@ -120,16 +117,16 @@ Measurements are in [docs/VALIDATION.md](docs/VALIDATION.md). PSS includes Andro
|
||||||
|
|
||||||
The signed APK is [output/Luma.apk](output/Luma.apk). Source is in `app/src/main/java/tv/luma/launcher`.
|
The signed APK is [output/Luma.apk](output/Luma.apk). Source is in `app/src/main/java/tv/luma/launcher`.
|
||||||
|
|
||||||
Rebuild without Gradle using Python 3, JDK 17, and an Android SDK with platform/build tools 34 or newer. Set `JAVA_HOME` and `ANDROID_HOME` to those installations. On the current Windows checkout they are `.tools/jdk` and `.tools/sdk`:
|
The current workspace already contains a local JDK 17 and Android SDK under `.tools`. Rebuild without Gradle:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
python scripts/build.py --tests
|
bash scripts/build.sh
|
||||||
adb -s "$LUMA_ADB_DEVICE" install -r output/Luma.apk
|
.tools/platform-tools/adb -s 192.168.50.195:35635 install -r output/Luma.apk
|
||||||
```
|
```
|
||||||
|
|
||||||
For a fresh macOS checkout, run `scripts/bootstrap.sh`, review/accept the SDK licenses, then build. Alternatively use the included Gradle project with JDK 17, Gradle 8.7 and Android SDK 34. No third-party app dependencies are needed.
|
For a fresh macOS checkout, run `scripts/bootstrap.sh`, review/accept the SDK licenses, then build. Alternatively use the included Gradle project with JDK 17, Gradle 8.7 and Android SDK 34. No third-party app dependencies are needed.
|
||||||
|
|
||||||
The build reuses `.tools/luma-development.keystore` with the password in ignored `.tools/signing.json`. Alternatively set `LUMA_KEYSTORE`, `LUMA_KEY_ALIAS`, and `LUMA_KEYSTORE_PASSWORD`. It refuses to generate a missing key unless explicitly run with `--create-signing-key`; that option is only for an intentionally new identity and requires reinstalling existing copies. Passwords are passed to signing tools through environment variables.
|
The local build creates and reuses `.tools/luma-development.keystore`. Preserve that file to install future updates over the existing APK. It is ignored by source control. This is a development signing identity for your sideloaded build; configure your own signing identity before distributing it.
|
||||||
|
|
||||||
To remove Luma, run `adb uninstall tv.luma.launcher`. No command in the build/install scripts disables another launcher or changes the default Home app.
|
To remove Luma, run `adb uninstall tv.luma.launcher`. No command in the build/install scripts disables another launcher or changes the default Home app.
|
||||||
|
|
||||||
|
|
@ -152,9 +149,9 @@ The wake regression uses a separate test APK signed with the same development ke
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
bash scripts/build-wake-tests.sh
|
bash scripts/build-wake-tests.sh
|
||||||
adb -s "$LUMA_ADB_DEVICE" install -r output/Luma-wake-tests.apk
|
.tools/platform-tools/adb -s 192.168.50.195:35635 install -r output/Luma-wake-tests.apk
|
||||||
adb -s "$LUMA_ADB_DEVICE" shell am instrument -w -r tv.luma.launcher.tests/.WakeRegressionInstrumentation
|
.tools/platform-tools/adb -s 192.168.50.195:35635 shell am instrument -w -r tv.luma.launcher.tests/.WakeRegressionInstrumentation
|
||||||
adb -s "$LUMA_ADB_DEVICE" uninstall tv.luma.launcher.tests
|
.tools/platform-tools/adb -s 192.168.50.195:35635 uninstall tv.luma.launcher.tests
|
||||||
```
|
```
|
||||||
|
|
||||||
Successful output ends with `INSTRUMENTATION_CODE: -1` and PASS lines for all cases. The runner controls activity lifecycle callbacks and should be run with no other device tests in progress.
|
Successful output ends with `INSTRUMENTATION_CODE: -1` and PASS lines for all cases. The runner controls activity lifecycle callbacks and should be run with no other device tests in progress.
|
||||||
|
|
@ -162,8 +159,6 @@ Android force-stops the target package during instrumentation and can mark its a
|
||||||
|
|
||||||
The `.AccentSchedulingInstrumentation` runner verifies focus-color coalescing, the final selected color, pause cancellation, resume recovery, and immediate reduced-motion updates in both rendering modes.
|
The `.AccentSchedulingInstrumentation` runner verifies focus-color coalescing, the final selected color, pause cancellation, resume recovery, and immediate reduced-motion updates in both rendering modes.
|
||||||
|
|
||||||
The `tv.luma.launcher.HomeActionsInstrumentation` runner checks the actual remote menu and all four move directions, focus, boundary clamping, save/cancel, saved order after resume, callback cleanup/recovery, and header spacing/focus with simulated physical-input availability. Run `scripts/check-app-move.py --adb <adb-path> --device <serial>` for the original UI reproduction. After instrumentation, `scripts/check-home-actions.py` checks the native network page and both canceling and confirming an uninstall of the disposable **Luma test app**; it removes that test APK as part of its check. These scripts do not uninstall user apps.
|
|
||||||
|
|
||||||
Additional runners in the same test APK check real GPU pixels (`.TileRenderingInstrumentation`, `.RenderingInstrumentation`) and normal/rapid D-pad navigation without spawning an input process per key (`.NavigationInstrumentation`). Pass `-e memorySaver true` to the wake or navigation runner to exercise the optional mode; the runner restores its preference afterward.
|
Additional runners in the same test APK check real GPU pixels (`.TileRenderingInstrumentation`, `.RenderingInstrumentation`) and normal/rapid D-pad navigation without spawning an input process per key (`.NavigationInstrumentation`). Pass `-e memorySaver true` to the wake or navigation runner to exercise the optional mode; the runner restores its preference afterward.
|
||||||
|
|
||||||
The same test APK also includes `tv.luma.launcher.tests/.PerformanceInstrumentation` for the background/shadow A/B benchmark. It changes only runtime view state and writes a temporary `performance.txt` in Luma's external-files directory. Reopen Luma afterward and remove the diagnostic APK.
|
The same test APK also includes `tv.luma.launcher.tests/.PerformanceInstrumentation` for the background/shadow A/B benchmark. It changes only runtime view state and writes a temporary `performance.txt` in Luma's external-files directory. Reopen Luma afterward and remove the diagnostic APK.
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ android {
|
||||||
applicationId 'tv.luma.launcher'
|
applicationId 'tv.luma.launcher'
|
||||||
minSdk 26
|
minSdk 26
|
||||||
targetSdk 34
|
targetSdk 34
|
||||||
versionCode 16
|
versionCode 15
|
||||||
versionName '1.1.13'
|
versionName '1.1.12'
|
||||||
}
|
}
|
||||||
compileOptions { sourceCompatibility JavaVersion.VERSION_1_8; targetCompatibility JavaVersion.VERSION_1_8 }
|
compileOptions { sourceCompatibility JavaVersion.VERSION_1_8; targetCompatibility JavaVersion.VERSION_1_8 }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="tv.luma.launcher" android:versionCode="16" android:versionName="1.1.13">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="tv.luma.launcher" android:versionCode="15" android:versionName="1.1.12">
|
||||||
<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="34" />
|
<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="34" />
|
||||||
<uses-feature android:name="android.software.leanback" android:required="true" />
|
<uses-feature android:name="android.software.leanback" android:required="true" />
|
||||||
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
|
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||||
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
|
|
||||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
<queries>
|
<queries>
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,8 @@ public final class MainActivity extends Activity {
|
||||||
private FocusScrollView scroll;
|
private FocusScrollView scroll;
|
||||||
private LinearLayout content, appsContainer, mediaContainer, hero, sectionHeading;
|
private LinearLayout content, appsContainer, mediaContainer, hero, sectionHeading;
|
||||||
private PlexClient.Media plexFeatured;
|
private PlexClient.Media plexFeatured;
|
||||||
private TextView clock, eyebrow, headline, description, openHint, appCount;
|
private TextView clock, eyebrow, headline, description, openHint, appCount, settingsButton;
|
||||||
private ImageButton inputButton, networkButton, settingsButton;
|
private ImageButton inputButton;
|
||||||
private NetworkStatus networkStatus;
|
|
||||||
private TvInputs tvInputs;
|
private TvInputs tvInputs;
|
||||||
private List<TvInputs.Source> inputSources = Collections.emptyList();
|
private List<TvInputs.Source> inputSources = Collections.emptyList();
|
||||||
private volatile int inputGeneration;
|
private volatile int inputGeneration;
|
||||||
|
|
@ -98,7 +97,6 @@ public final class MainActivity extends Activity {
|
||||||
getWindow().getDecorView().setSystemUiVisibility(5894);
|
getWindow().getDecorView().setSystemUiVisibility(5894);
|
||||||
getWindow().setNavigationBarColor(Ui.BG);
|
getWindow().setNavigationBarColor(Ui.BG);
|
||||||
buildShell();
|
buildShell();
|
||||||
networkStatus = new NetworkStatus(this, networkButton, handler);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int d(float n) {
|
private int d(float n) {
|
||||||
|
|
@ -185,30 +183,11 @@ public final class MainActivity extends Activity {
|
||||||
LinearLayout.LayoutParams inputLp = new LinearLayout.LayoutParams(d(39), d(34));
|
LinearLayout.LayoutParams inputLp = new LinearLayout.LayoutParams(d(39), d(34));
|
||||||
inputLp.leftMargin = d(17);
|
inputLp.leftMargin = d(17);
|
||||||
header.addView(inputButton, inputLp);
|
header.addView(inputButton, inputLp);
|
||||||
networkButton = new ImageButton(this);
|
settingsButton = chip("⚙", v -> showSettings());
|
||||||
networkButton.setImageResource(R.drawable.ic_wifi_off);
|
settingsButton.setTextSize(19);
|
||||||
networkButton.setImageTintList(Ui.textColors());
|
|
||||||
networkButton.setPadding(d(9), d(7), d(9), d(7));
|
|
||||||
networkButton.setFocusable(true);
|
|
||||||
networkButton.setContentDescription("Network status · Open network settings");
|
|
||||||
networkButton.setId(View.generateViewId());
|
|
||||||
Ui.glass(networkButton, 18);
|
|
||||||
networkButton.setOnClickListener(v -> openNetworkSettings());
|
|
||||||
LinearLayout.LayoutParams networkLp = new LinearLayout.LayoutParams(d(39), d(34));
|
|
||||||
networkLp.leftMargin = d(17);
|
|
||||||
header.addView(networkButton, networkLp);
|
|
||||||
settingsButton = new ImageButton(this);
|
|
||||||
settingsButton.setImageResource(R.drawable.ic_settings);
|
|
||||||
settingsButton.setImageTintList(Ui.textColors());
|
|
||||||
settingsButton.setPadding(d(9), d(7), d(9), d(7));
|
|
||||||
settingsButton.setFocusable(true);
|
|
||||||
Ui.glass(settingsButton, 18);
|
|
||||||
settingsButton.setOnClickListener(v -> showSettings());
|
|
||||||
settingsButton.setContentDescription("Luma settings");
|
settingsButton.setContentDescription("Luma settings");
|
||||||
settingsButton.setId(View.generateViewId());
|
settingsButton.setId(View.generateViewId());
|
||||||
inputButton.setNextFocusRightId(networkButton.getId());
|
inputButton.setNextFocusRightId(settingsButton.getId());
|
||||||
networkButton.setNextFocusRightId(settingsButton.getId());
|
|
||||||
settingsButton.setNextFocusLeftId(networkButton.getId());
|
|
||||||
LinearLayout.LayoutParams settingsLp = new LinearLayout.LayoutParams(d(39), d(34));
|
LinearLayout.LayoutParams settingsLp = new LinearLayout.LayoutParams(d(39), d(34));
|
||||||
settingsLp.leftMargin = d(17);
|
settingsLp.leftMargin = d(17);
|
||||||
header.addView(settingsButton, settingsLp);
|
header.addView(settingsButton, settingsLp);
|
||||||
|
|
@ -264,6 +243,10 @@ public final class MainActivity extends Activity {
|
||||||
footer.setPadding(d(4), d(24), d(4), 0);
|
footer.setPadding(d(4), d(24), d(4), 0);
|
||||||
TextView all = chip("All apps", v -> showAllApps());
|
TextView all = chip("All apps", v -> showAllApps());
|
||||||
footer.addView(all, new LinearLayout.LayoutParams(d(95), d(35)));
|
footer.addView(all, new LinearLayout.LayoutParams(d(95), d(35)));
|
||||||
|
TextView customize = chip("Personalize", v -> showSettings());
|
||||||
|
LinearLayout.LayoutParams customizeLp = new LinearLayout.LayoutParams(d(112), d(35));
|
||||||
|
customizeLp.leftMargin = d(10);
|
||||||
|
footer.addView(customize, customizeLp);
|
||||||
content.addView(footer, new LinearLayout.LayoutParams(-1, d(66)));
|
content.addView(footer, new LinearLayout.LayoutParams(-1, d(66)));
|
||||||
setContentView(root);
|
setContentView(root);
|
||||||
configureScene();
|
configureScene();
|
||||||
|
|
@ -348,7 +331,6 @@ public final class MainActivity extends Activity {
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
foreground = true;
|
foreground = true;
|
||||||
networkStatus.start();
|
|
||||||
tvInputs.start(
|
tvInputs.start(
|
||||||
() -> {
|
() -> {
|
||||||
handler.removeCallbacks(refreshInputTask);
|
handler.removeCallbacks(refreshInputTask);
|
||||||
|
|
@ -385,7 +367,6 @@ public final class MainActivity extends Activity {
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
foreground = false;
|
foreground = false;
|
||||||
networkStatus.stop();
|
|
||||||
tvInputs.stop();
|
tvInputs.stop();
|
||||||
handler.removeCallbacks(refreshInputTask);
|
handler.removeCallbacks(refreshInputTask);
|
||||||
inputGeneration++;
|
inputGeneration++;
|
||||||
|
|
@ -523,8 +504,6 @@ public final class MainActivity extends Activity {
|
||||||
|
|
||||||
private void renderApps() {
|
private void renderApps() {
|
||||||
iconGeneration++;
|
iconGeneration++;
|
||||||
// Removing focused children can focus another tile; retain the requested app across rebuilds.
|
|
||||||
String requestedSelection = selected;
|
|
||||||
List<AppRepository.App> previous = new ArrayList<>(visibleApps);
|
List<AppRepository.App> previous = new ArrayList<>(visibleApps);
|
||||||
Set<String> hidden = hidden();
|
Set<String> hidden = hidden();
|
||||||
List<String> order = savedOrder();
|
List<String> order = savedOrder();
|
||||||
|
|
@ -623,16 +602,14 @@ public final class MainActivity extends Activity {
|
||||||
if (!tiles.isEmpty()) {
|
if (!tiles.isEmpty()) {
|
||||||
settingsButton.setNextFocusDownId(tiles.values().iterator().next().getId());
|
settingsButton.setNextFocusDownId(tiles.values().iterator().next().getId());
|
||||||
inputButton.setNextFocusDownId(tiles.values().iterator().next().getId());
|
inputButton.setNextFocusDownId(tiles.values().iterator().next().getId());
|
||||||
networkButton.setNextFocusDownId(tiles.values().iterator().next().getId());
|
|
||||||
}
|
}
|
||||||
String restore =
|
String restore =
|
||||||
tiles.containsKey(requestedSelection)
|
tiles.containsKey(selected)
|
||||||
? requestedSelection
|
? selected
|
||||||
: (visibleApps.isEmpty() ? "" : visibleApps.get(0).pkg);
|
: (visibleApps.isEmpty() ? "" : visibleApps.get(0).pkg);
|
||||||
AppTile target = tiles.get(restore);
|
AppTile target = tiles.get(restore);
|
||||||
if (target != null) {
|
if (target != null) {
|
||||||
target.requestFocus();
|
target.requestFocus();
|
||||||
selected = restore;
|
|
||||||
updateHero(findApp(restore));
|
updateHero(findApp(restore));
|
||||||
if (reuse) target.post(() -> keepFocusVisible(target));
|
if (reuse) target.post(() -> keepFocusVisible(target));
|
||||||
}
|
}
|
||||||
|
|
@ -898,33 +875,15 @@ public final class MainActivity extends Activity {
|
||||||
handler.post(
|
handler.post(
|
||||||
() -> {
|
() -> {
|
||||||
if (!foreground || ticket != inputGeneration) return;
|
if (!foreground || ticket != inputGeneration) return;
|
||||||
applyInputSources(sources);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void applyInputSources(List<TvInputs.Source> sources) {
|
|
||||||
inputSources = sources;
|
inputSources = sources;
|
||||||
boolean available = !sources.isEmpty();
|
boolean available = !sources.isEmpty();
|
||||||
if (!available && inputButton.hasFocus()) networkButton.requestFocus();
|
if (!available && inputButton.hasFocus()) settingsButton.requestFocus();
|
||||||
inputButton.setVisibility(available ? View.VISIBLE : View.GONE);
|
inputButton.setVisibility(available ? View.VISIBLE : View.GONE);
|
||||||
networkButton.setNextFocusLeftId(available ? inputButton.getId() : View.NO_ID);
|
settingsButton.setNextFocusLeftId(available ? inputButton.getId() : View.NO_ID);
|
||||||
if (!tiles.isEmpty())
|
if (!tiles.isEmpty())
|
||||||
inputButton.setNextFocusDownId(tiles.values().iterator().next().getId());
|
inputButton.setNextFocusDownId(tiles.values().iterator().next().getId());
|
||||||
}
|
});
|
||||||
|
});
|
||||||
private void openNetworkSettings() {
|
|
||||||
for (String action : new String[] {
|
|
||||||
Settings.ACTION_WIFI_SETTINGS, Settings.ACTION_WIRELESS_SETTINGS, Settings.ACTION_SETTINGS
|
|
||||||
}) {
|
|
||||||
try {
|
|
||||||
startActivity(new Intent(action));
|
|
||||||
return;
|
|
||||||
} catch (ActivityNotFoundException | SecurityException e) {
|
|
||||||
// Some TV platforms omit a particular settings activity; try the portable fallback.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
toast("Network settings unavailable");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showInputs() {
|
private void showInputs() {
|
||||||
|
|
@ -1549,20 +1508,6 @@ public final class MainActivity extends Activity {
|
||||||
renderApps();
|
renderApps();
|
||||||
dismiss();
|
dismiss();
|
||||||
});
|
});
|
||||||
if ((app.info.activityInfo.applicationInfo.flags
|
|
||||||
& android.content.pm.ApplicationInfo.FLAG_SYSTEM) == 0)
|
|
||||||
action(
|
|
||||||
p,
|
|
||||||
"Uninstall app",
|
|
||||||
"Android will ask you to confirm",
|
|
||||||
() -> {
|
|
||||||
dismiss();
|
|
||||||
try {
|
|
||||||
startActivity(new Intent(Intent.ACTION_DELETE, Uri.parse("package:" + app.pkg)));
|
|
||||||
} catch (ActivityNotFoundException | SecurityException e) {
|
|
||||||
toast("Uninstall unavailable · Use Android app info");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
action(
|
action(
|
||||||
p,
|
p,
|
||||||
"Android app info",
|
"Android app info",
|
||||||
|
|
@ -1586,8 +1531,6 @@ public final class MainActivity extends Activity {
|
||||||
moving = true;
|
moving = true;
|
||||||
updateFeaturedText();
|
updateFeaturedText();
|
||||||
selected = app.pkg;
|
selected = app.pkg;
|
||||||
AppTile tile = tiles.get(app.pkg);
|
|
||||||
if (tile != null) tile.requestFocus();
|
|
||||||
moveOriginal = new ArrayList<>();
|
moveOriginal = new ArrayList<>();
|
||||||
for (AppRepository.App a : visibleApps) moveOriginal.add(a.pkg);
|
for (AppRepository.App a : visibleApps) moveOriginal.add(a.pkg);
|
||||||
openHint.setText("↔ ↕ Move " + app.label + " · OK saves · Back cancels");
|
openHint.setText("↔ ↕ Move " + app.label + " · OK saves · Back cancels");
|
||||||
|
|
@ -1635,10 +1578,9 @@ public final class MainActivity extends Activity {
|
||||||
: key == KeyEvent.KEYCODE_DPAD_DOWN ? columns() : 0;
|
: key == KeyEvent.KEYCODE_DPAD_DOWN ? columns() : 0;
|
||||||
if (delta != 0 && index >= 0) {
|
if (delta != 0 && index >= 0) {
|
||||||
int next = Math.max(0, Math.min(visibleApps.size() - 1, index + delta));
|
int next = Math.max(0, Math.min(visibleApps.size() - 1, index + delta));
|
||||||
|
Collections.swap(visibleApps, index, next);
|
||||||
List<String> order = new ArrayList<>();
|
List<String> order = new ArrayList<>();
|
||||||
for (AppRepository.App a : visibleApps) order.add(a.pkg);
|
for (AppRepository.App a : visibleApps) order.add(a.pkg);
|
||||||
// Keep visibleApps in displayed order until renderApps compares it with the new order.
|
|
||||||
Collections.swap(order, index, next);
|
|
||||||
saveOrder(order);
|
saveOrder(order);
|
||||||
renderApps();
|
renderApps();
|
||||||
openHint.setText(
|
openHint.setText(
|
||||||
|
|
|
||||||
|
|
@ -1,74 +0,0 @@
|
||||||
package tv.luma.launcher;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.res.ColorStateList;
|
|
||||||
import android.net.ConnectivityManager;
|
|
||||||
import android.net.Network;
|
|
||||||
import android.net.NetworkCapabilities;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.widget.ImageButton;
|
|
||||||
|
|
||||||
/** One foreground-only callback; no Wi-Fi scans, location access, or polling. */
|
|
||||||
final class NetworkStatus {
|
|
||||||
private final ConnectivityManager connectivity;
|
|
||||||
private final ImageButton button;
|
|
||||||
private final Handler handler;
|
|
||||||
private ConnectivityManager.NetworkCallback callback;
|
|
||||||
|
|
||||||
NetworkStatus(Context context, ImageButton button, Handler handler) {
|
|
||||||
connectivity = context.getSystemService(ConnectivityManager.class);
|
|
||||||
this.button = button;
|
|
||||||
this.handler = handler;
|
|
||||||
}
|
|
||||||
|
|
||||||
void start() {
|
|
||||||
if (callback != null || connectivity == null) return;
|
|
||||||
callback = new ConnectivityManager.NetworkCallback() {
|
|
||||||
@Override
|
|
||||||
public void onCapabilitiesChanged(Network network, NetworkCapabilities capabilities) {
|
|
||||||
if (callback == this) show(capabilities);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLost(Network network) {
|
|
||||||
if (callback == this) show(null);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
try {
|
|
||||||
// Initial snapshot covers resume; subsequent state comes directly from callback capabilities.
|
|
||||||
show(connectivity.getNetworkCapabilities(connectivity.getActiveNetwork()));
|
|
||||||
connectivity.registerDefaultNetworkCallback(callback, handler);
|
|
||||||
} catch (SecurityException | IllegalArgumentException e) {
|
|
||||||
callback = null;
|
|
||||||
show(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void stop() {
|
|
||||||
ConnectivityManager.NetworkCallback previous = callback;
|
|
||||||
callback = null;
|
|
||||||
if (previous != null) {
|
|
||||||
try {
|
|
||||||
connectivity.unregisterNetworkCallback(previous);
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
// Already removed by the platform.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void show(NetworkCapabilities capabilities) {
|
|
||||||
boolean connected = capabilities != null;
|
|
||||||
boolean ethernet = connected && capabilities.hasTransport(NetworkCapabilities.TRANSPORT_ETHERNET);
|
|
||||||
boolean wifi = connected && capabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI);
|
|
||||||
boolean internet = connected && capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED);
|
|
||||||
String status = !connected ? "Network disconnected"
|
|
||||||
: (wifi ? "Wi-Fi" : ethernet ? "Ethernet" : "Network")
|
|
||||||
+ (internet ? " connected" : " · No internet access");
|
|
||||||
button.setImageResource(!connected ? R.drawable.ic_wifi_off
|
|
||||||
: ethernet ? R.drawable.ic_ethernet : R.drawable.ic_wifi);
|
|
||||||
button.setImageTintList(internet ? Ui.textColors()
|
|
||||||
: ColorStateList.valueOf(connected ? Ui.GOLD : Ui.MUTED));
|
|
||||||
button.setContentDescription(status + " · Open network settings");
|
|
||||||
button.setTooltipText(status);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
|
||||||
<path android:fillColor="#FFFFFFFF" android:pathData="M3,5L21,5L21,17L16,17L16,21L8,21L8,17L3,17ZM5,7L5,15L10,15L10,19L14,19L14,15L19,15L19,7ZM7,8L9,8L9,12L7,12ZM11,8L13,8L13,12L11,12ZM15,8L17,8L17,12L15,12Z" />
|
|
||||||
</vector>
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
|
||||||
<path android:fillColor="#FFFFFFFF" android:pathData="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z" />
|
|
||||||
</vector>
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
|
||||||
<path android:fillColor="#FFFFFFFF" android:pathData="M1,9l2,2c4.97,-4.97 13.03,-4.97 18,0l2,-2C16.93,2.93 7.08,2.93 1,9zm8,8l3,3 3,-3c-1.65,-1.66 -4.34,-1.66 -6,0zm-4,-4l2,2c2.76,-2.76 7.24,-2.76 10,0l2,-2C15.14,9.14 8.87,9.14 5,13z" />
|
|
||||||
</vector>
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
|
||||||
<path android:fillColor="#FFFFFFFF" android:pathData="M22.99,9C19.15,5.16 13.8,3.76 8.84,4.78l2.52,2.52c3.47,-0.17 6.99,1.05 9.63,3.7l2,-2zm-4,4c-1.29,-1.29 -2.84,-2.13 -4.49,-2.56l3.53,3.53 0.96,-0.97zM2,3.05L5.07,6.1C3.6,6.82 2.22,7.78 1,9l1.99,2c1.24,-1.24 2.67,-2.16 4.2,-2.77l2.24,2.24C7.81,10.89 6.27,11.73 5,13v0.01L6.99,15c1.36,-1.36 3.14,-2.04 4.92,-2.06L18.98,20l1.27,-1.26L3.29,1.79 2,3.05zM9,17l3,3 3,-3c-1.65,-1.66 -4.34,-1.66 -6,0z" />
|
|
||||||
</vector>
|
|
||||||
|
|
@ -8,8 +8,6 @@ Final generation prompt:
|
||||||
|
|
||||||
App banners and icons are loaded from installed Android packages and retain their respective owners' branding. Plex artwork is retrieved from the user's connected server. Aurora and Midnight scenes are code-native gradients.
|
App banners and icons are loaded from installed Android packages and retain their respective owners' branding. Plex artwork is retrieved from the user's connected server. Aurora and Midnight scenes are code-native gradients.
|
||||||
|
|
||||||
The Wi-Fi, Wi-Fi-off, and Settings vector paths use Google's [Material Icons Wi-Fi](https://github.com/google/material-design-icons/blob/master/src/notification/wifi/materialicons/24px.svg), [Wi-Fi-off](https://github.com/google/material-design-icons/blob/master/src/notification/wifi_off/materialicons/24px.svg), and [Settings](https://github.com/google/material-design-icons/blob/master/src/action/settings/materialicons/24px.svg), Copyright Google LLC, under the [Apache 2.0 license](licenses/material-icons-LICENSE.txt). The standard geometry keeps the Wi-Fi bands/gaps consistent at TV size and replaces the font-dependent gear with a matching filled vector.
|
|
||||||
|
|
||||||
# Screensaver media
|
# Screensaver media
|
||||||
|
|
||||||
The offline image catalog is `app/src/main/assets/saver/catalog.json`, with titles, credits, and source links. The Met's object API marked each included painting `isPublicDomain=true` at retrieval; only works with that flag and an available image are eligible for in-app gallery downloads. See [The Met Open Access API and CC0 description](https://metmuseum.github.io/).
|
The offline image catalog is `app/src/main/assets/saver/catalog.json`, with titles, credits, and source links. The Met's object API marked each included painting `isPublicDomain=true` at retrieval; only works with that flag and an available image are eligible for in-app gallery downloads. See [The Met Open Access API and CC0 description](https://metmuseum.github.io/).
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1 @@
|
||||||
Adds Uninstall app to the held-OK menu for user-installed apps, with Android confirmation. Fixes D-pad app rearranging and keeps focus on the moving app. Adds a network status shortcut beside Settings, with separate space for TV inputs. Uses evenly spaced Material Wi-Fi bands and a matching filled Settings icon. Removes the duplicate Personalize button at the bottom of Home.
|
Removes obsolete alternate-launcher shortcuts and routing integration. Avoids redundant window relayouts when remote input resets the screensaver timer. Background app-color transitions wait for a 250 ms pause in navigation and skip animations to an already displayed color. Tile focus stays immediate, with the same image quality and smooth final crossfade. No device-specific rendering paths.
|
||||||
|
|
||||||
Signing identity changed because the original key was lost. Devices running 1.1.12 or older need a one-time uninstall and reinstall of this release; Android cannot install it over the old signing identity. Reinstalling resets Luma settings and Plex credentials. Future updates use the new key.
|
|
||||||
|
|
|
||||||
|
|
@ -260,23 +260,3 @@ Both devices passed the final 200 ms accent/coalescing regression, same-color ca
|
||||||
Final UI checks verified the removed package is absent on both devices, Settings and Default launcher contain no obsolete integration text/actions, Back stays in Luma, and physical-input controls remain visible only on the TV. The installed APK hashes match the final signed payload. Wallpaper, app art, original spacing, and focus behavior remain intact. Enabled accessibility lists remain Button Mapper only on the onn and null on the TV; the existing Home override remains Off on both. Memory saver remains Off on the onn and On on the TV. The supplied benchmark documents in the repository root were left untouched and untracked.
|
Final UI checks verified the removed package is absent on both devices, Settings and Default launcher contain no obsolete integration text/actions, Back stays in Luma, and physical-input controls remain visible only on the TV. The installed APK hashes match the final signed payload. Wallpaper, app art, original spacing, and focus behavior remain intact. Enabled accessibility lists remain Button Mapper only on the onn and null on the TV; the existing Home override remains Off on both. Memory saver remains Off on the onn and On on the TV. The supplied benchmark documents in the repository root were left untouched and untracked.
|
||||||
|
|
||||||
After settling with Android settings foreground, both launcher processes consumed zero CPU ticks over five seconds. This round's temporary diagnostic APKs, scripts, on-device reports, locks, and trace files were removed after archiving the reports locally. Both devices were returned to Luma. Android's stock launcher and unrelated apps/settings remain unchanged.
|
After settling with Android settings foreground, both launcher processes consumed zero CPU ticks over five seconds. This round's temporary diagnostic APKs, scripts, on-device reports, locks, and trace files were removed after archiving the reports locally. Both devices were returned to Luma. Android's stock launcher and unrelated apps/settings remain unchanged.
|
||||||
|
|
||||||
## 1.1.13 app actions and network shortcut (2026-10-25)
|
|
||||||
|
|
||||||
Built on Windows with JDK 17 and Android SDK/build tools 36, retaining minSdk 26 and targetSdk 34. VersionName 1.1.13 / versionCode 16. The original signing key was missing; the user explicitly authorized a replacement identity and a reinstall. The new RSA certificate SHA-256 is `5982677675475eab76e8aaa52f939b7a563aef69e869b8c5e342ac9e921b12ad`. The key and randomly generated signing password remain under ignored `.tools/`; neither is published. Build scripts now pass signing passwords through environment variables and refuse automatic key replacement.
|
|
||||||
|
|
||||||
On the authorized onn 4K Plus (Android 14/API 34), `scripts/check-app-move.py --adb <adb> --device <serial>` failed against installed 1.1.12: Right after selecting Move in grid left the first three visible apps in the same order. It passes against 1.1.13. The cause was mutating `visibleApps` before `renderApps` captured the displayed order, so the reuse comparison incorrectly skipped rebuilding. The fix swaps a separate order list, and preserves the requested selection while replacing focused children.
|
|
||||||
|
|
||||||
The final `HomeActionsInstrumentation` passed menu entry with remote OK, all four directions, upper/left boundaries, focus remaining on the moving app, Back restoring order, OK saving it across stop/start, and preference restoration. It also passed offline presentation followed by live-network recovery, callback stop/restart, absence of Personalize, and header bounds/D-pad navigation with simulated physical-input availability. The test exits Android touch mode with a remote arrow before requesting focus, so prior tap-based checks do not consume the first OK merely to leave touch mode.
|
|
||||||
|
|
||||||
`GridReuseInstrumentation` passed label-only reuse, focus callbacks, interrupted focus animation, hiding, reordering, and column changes. `WakeRegressionInstrumentation` passed interrupted loading, pause-only recovery, memory trimming, screensaver dismissal, and five stop/start cycles. Normal/rapid `NavigationInstrumentation` passed with zero dropped callbacks; FrameMetrics p95 was 16.37 ms normal and 16.64 ms rapid. These are functional navigation samples on one device, not a performance improvement claim or a comparison with another GPU.
|
|
||||||
|
|
||||||
The real UI check `scripts/check-home-actions.py` opened the native TV network page. Canceling Android's uninstall confirmation preserved the disposable Luma test app; confirming removed it for the current Android user and the resumed Luma library refreshed. The test checks the current user explicitly because the device has a second Android profile. System apps retain app info and do not receive an uninstall action. No user app was uninstalled by these checks.
|
|
||||||
|
|
||||||
Physical Ethernet, captive-portal/limited-internet hardware states, and real physical-input switching were not exercised in this run. Ethernet has its own vector port icon and accessible label selected by Android's active-network transport. Disconnected presentation was injected through the UI update seam without disconnecting wireless ADB. Input availability was simulated only for header bounds and focus; no input hardware or second TV was modified.
|
|
||||||
|
|
||||||
The signing migration required a reinstall of the authorized test device. The visible five-column layout, Kaleido-first ordering, Scenic screensaver with clock, and previously downloaded nature video were restored through Luma UI. Existing versions on the other two devices require a one-time reinstall; signature and update integrity checks remain enabled. Future releases must retain the new key.
|
|
||||||
|
|
||||||
Final cleanup restored the prior enabled-accessibility list (Button Mapper plus Luma's own Home override) and notification permission. Home returned from native Android settings to Luma after its existing accessibility redirect. Android's native Home selection and other launchers were preserved. The diagnostic APK was removed from all profiles, temporary on-device captures were deleted, and the installed APK SHA-256 matched the release manifest. The final Home screenshot was visually checked: the Wi-Fi icon has separate space beside the gear and the five-column app layout is intact.
|
|
||||||
|
|
||||||
Before publication, the Wi-Fi/Wi-Fi-off vectors were replaced with standard Material paths to correct uneven band spacing. The Unicode Settings glyph was replaced with the matching filled Material Settings vector and the same ImageButton padding/tint/focus treatment as the network button. Both were visually checked in a fresh TV screenshot. HomeActionsInstrumentation passed again after the Settings view-type change, including header focus and non-overlap; clicking the new gear opened Luma settings. Source attribution and the Apache 2.0 license are retained in docs/ASSETS.md and docs/licenses/.
|
|
||||||
|
|
|
||||||
|
|
@ -1,202 +0,0 @@
|
||||||
|
|
||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright [yyyy] [name of copyright owner]
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
BIN
output/Luma.apk
BIN
output/Luma.apk
Binary file not shown.
Binary file not shown.
|
|
@ -1,11 +1,11 @@
|
||||||
{
|
{
|
||||||
"schema": 1,
|
"schema": 1,
|
||||||
"packageName": "tv.luma.launcher",
|
"packageName": "tv.luma.launcher",
|
||||||
"versionCode": 16,
|
"versionCode": 15,
|
||||||
"versionName": "1.1.13",
|
"versionName": "1.1.12",
|
||||||
"minSdk": 26,
|
"minSdk": 26,
|
||||||
"apk": "Luma.apk",
|
"apk": "Luma.apk",
|
||||||
"size": 2766249,
|
"size": 2761885,
|
||||||
"sha256": "7fcffec0860791ed14db0924a35361225b89789f6cfe202c3d62390a92a16b3a",
|
"sha256": "77892c9ac3eea5559423d3a7692374c1a4c676b6a5da1cd712773e0bc5eb91c6",
|
||||||
"notes": "Adds Uninstall app to the held-OK menu for user-installed apps, with Android confirmation. Fixes D-pad app rearranging and keeps focus on the moving app. Adds a network status shortcut beside Settings, with separate space for TV inputs. Uses evenly spaced Material Wi-Fi bands and a matching filled Settings icon. Removes the duplicate Personalize button at the bottom of Home.\n\nSigning identity changed because the original key was lost. Devices running 1.1.12 or older need a one-time uninstall and reinstall of this release; Android cannot install it over the old signing identity. Reinstalling resets Luma settings and Plex credentials. Future updates use the new key."
|
"notes": "Removes obsolete alternate-launcher shortcuts and routing integration. Avoids redundant window relayouts when remote input resets the screensaver timer. Background app-color transitions wait for a 250 ms pause in navigation and skip animations to an already displayed color. Tile focus stays immediate, with the same image quality and smooth final crossfade. No device-specific rendering paths."
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,20 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
exec bash scripts/build.sh --tests "$@"
|
TASK_ROOT="$PWD"
|
||||||
|
export JAVA_HOME="${JAVA_HOME:-$TASK_ROOT/.tools/jdk/Contents/Home}"
|
||||||
|
export ANDROID_HOME="${ANDROID_HOME:-$TASK_ROOT/.tools/sdk}"
|
||||||
|
export PATH="$JAVA_HOME/bin:$PATH"
|
||||||
|
BT="$ANDROID_HOME/build-tools/34.0.0"
|
||||||
|
ANDROID_JAR="$ANDROID_HOME/platforms/android-34/android.jar"
|
||||||
|
mkdir -p build/wake-tests/classes build/wake-tests/dex output
|
||||||
|
"$BT/aapt2" link -o build/wake-tests/base.apk -I "$ANDROID_JAR" --manifest tests/device/AndroidManifest.xml
|
||||||
|
javac -encoding UTF-8 -source 8 -target 8 -bootclasspath "$ANDROID_JAR:$BT/core-lambda-stubs.jar" -classpath build/classes -d build/wake-tests/classes tests/device/*.java
|
||||||
|
find build/wake-tests/classes -name '*.class' > build/wake-tests/classes.txt
|
||||||
|
"$BT/d8" --lib "$ANDROID_JAR" --min-api 26 --output build/wake-tests/dex @build/wake-tests/classes.txt
|
||||||
|
cp build/wake-tests/base.apk build/wake-tests/with-dex.apk
|
||||||
|
(cd build/wake-tests/dex && zip -q -u ../with-dex.apk classes*.dex)
|
||||||
|
"$BT/zipalign" -f 4 build/wake-tests/with-dex.apk build/wake-tests/aligned.apk
|
||||||
|
"$BT/apksigner" sign --ks .tools/luma-development.keystore --ks-key-alias luma --ks-pass pass:android --key-pass pass:android --out output/Luma-wake-tests.apk build/wake-tests/aligned.apk
|
||||||
|
"$BT/apksigner" verify output/Luma-wake-tests.apk
|
||||||
|
echo "Built $TASK_ROOT/output/Luma-wake-tests.apk"
|
||||||
|
|
|
||||||
105
scripts/build.py
105
scripts/build.py
|
|
@ -1,105 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
"""Build signed launcher/test APKs with a local JDK and Android SDK (including Windows)."""
|
|
||||||
import argparse
|
|
||||||
import json
|
|
||||||
import os
|
|
||||||
from pathlib import Path
|
|
||||||
import secrets
|
|
||||||
import shutil
|
|
||||||
import subprocess
|
|
||||||
import sys
|
|
||||||
import zipfile
|
|
||||||
|
|
||||||
ROOT = Path(__file__).resolve().parents[1]
|
|
||||||
os.chdir(ROOT)
|
|
||||||
p = argparse.ArgumentParser()
|
|
||||||
p.add_argument('--tests', action='store_true')
|
|
||||||
p.add_argument('--create-signing-key', action='store_true', help='Explicitly create a new signing identity')
|
|
||||||
a = p.parse_args()
|
|
||||||
java = Path(os.environ['JAVA_HOME']) / 'bin'
|
|
||||||
sdk = Path(os.environ['ANDROID_HOME'])
|
|
||||||
bt = max((sdk / 'build-tools').iterdir(), key=lambda x: tuple(int(n) for n in x.name.split('.')))
|
|
||||||
platform = max((sdk / 'platforms').glob('android-*'), key=lambda x: int(x.name.split('-')[1]))
|
|
||||||
android = platform / 'android.jar'
|
|
||||||
suffix = '.exe' if os.name == 'nt' else ''
|
|
||||||
env = os.environ.copy()
|
|
||||||
env['PATH'] = str(java) + os.pathsep + env['PATH']
|
|
||||||
config = ROOT / '.tools/signing.json'
|
|
||||||
key = Path(env.get('LUMA_KEYSTORE', str(ROOT / '.tools/luma-development.keystore')))
|
|
||||||
alias = env.get('LUMA_KEY_ALIAS', 'luma')
|
|
||||||
password = env.get('LUMA_KEYSTORE_PASSWORD')
|
|
||||||
if not password and config.exists():
|
|
||||||
password = json.loads(config.read_text())['password']
|
|
||||||
if not key.exists():
|
|
||||||
if not a.create_signing_key:
|
|
||||||
sys.exit('Original signing key missing. Restore it; use --create-signing-key only for an authorized new identity.')
|
|
||||||
if config.exists():
|
|
||||||
sys.exit('Signing configuration exists but its key is missing. Restore the key before building.')
|
|
||||||
key.parent.mkdir(parents=True, exist_ok=True)
|
|
||||||
password = password or secrets.token_urlsafe(36)
|
|
||||||
env['LUMA_BUILD_PASSWORD'] = password
|
|
||||||
subprocess.run([str(java / ('keytool' + suffix)), '-genkeypair', '-keystore', str(key),
|
|
||||||
'-storepass:env', 'LUMA_BUILD_PASSWORD', '-keypass:env', 'LUMA_BUILD_PASSWORD',
|
|
||||||
'-alias', alias, '-keyalg', 'RSA', '-keysize', '3072', '-validity', '36500',
|
|
||||||
'-dname', 'CN=Luma', '-noprompt'], env=env, check=True)
|
|
||||||
config.parent.mkdir(parents=True, exist_ok=True)
|
|
||||||
config.write_text(json.dumps({'password': password}) + '\n')
|
|
||||||
if not password:
|
|
||||||
sys.exit('Set LUMA_KEYSTORE_PASSWORD for the existing signing key.')
|
|
||||||
env['LUMA_BUILD_PASSWORD'] = password
|
|
||||||
env['AAPT2'] = str(bt / ('aapt2' + suffix))
|
|
||||||
|
|
||||||
def run(*args):
|
|
||||||
subprocess.run([str(x) for x in args], env=env, check=True)
|
|
||||||
|
|
||||||
def jar_tool(main):
|
|
||||||
return [java / ('java' + suffix), '-cp', bt / 'lib' / (main + '.jar')]
|
|
||||||
|
|
||||||
def build(test=False):
|
|
||||||
out = ROOT / 'build' / ('device-tests' if test else 'launcher')
|
|
||||||
if out.exists():
|
|
||||||
shutil.rmtree(out)
|
|
||||||
(out / 'classes').mkdir(parents=True)
|
|
||||||
(out / 'dex').mkdir()
|
|
||||||
(out / 'generated').mkdir()
|
|
||||||
manifest = ROOT / ('tests/device/AndroidManifest.xml' if test else 'app/src/main/AndroidManifest.xml')
|
|
||||||
link = [env['AAPT2'], 'link', '-o', out / 'base.apk', '-I', android, '--manifest', manifest]
|
|
||||||
if not test:
|
|
||||||
run(env['AAPT2'], 'compile', '--dir', ROOT / 'app/src/main/res', '-o', out / 'resources.zip')
|
|
||||||
link += ['--java', out / 'generated', '-A', ROOT / 'app/src/main/assets',
|
|
||||||
'--auto-add-overlay', out / 'resources.zip']
|
|
||||||
run(*link)
|
|
||||||
source = ROOT / ('tests/device' if test else 'app/src/main/java')
|
|
||||||
files = list(source.rglob('*.java')) + list((out / 'generated').rglob('*.java'))
|
|
||||||
# Java argfiles require forward slashes and quoting on Windows paths with spaces.
|
|
||||||
(out / 'sources.txt').write_text('\n'.join('"' + x.as_posix() + '"' for x in files))
|
|
||||||
javac = [java / ('javac' + suffix), '-encoding', 'UTF-8', '-source', '8', '-target', '8',
|
|
||||||
'-bootclasspath', str(android) + os.pathsep + str(bt / 'core-lambda-stubs.jar'),
|
|
||||||
'-d', out / 'classes']
|
|
||||||
if test:
|
|
||||||
javac += ['-classpath', ROOT / 'build/launcher/classes']
|
|
||||||
run(*javac, '@' + str(out / 'sources.txt'))
|
|
||||||
classes = list((out / 'classes').rglob('*.class'))
|
|
||||||
# D8 treats each argfile line as a complete argument, including any spaces.
|
|
||||||
(out / 'classes.txt').write_text('\n'.join(x.as_posix() for x in classes))
|
|
||||||
run(*jar_tool('d8'), 'com.android.tools.r8.D8', '--lib', android, '--min-api', '26',
|
|
||||||
'--output', out / 'dex', '@' + str(out / 'classes.txt'))
|
|
||||||
with zipfile.ZipFile(out / 'base.apk') as resources, zipfile.ZipFile(
|
|
||||||
out / 'dex.apk', 'w', compression=zipfile.ZIP_DEFLATED) as apk:
|
|
||||||
for entry in resources.infolist():
|
|
||||||
apk.writestr(entry, resources.read(entry.filename))
|
|
||||||
for dex in (out / 'dex').glob('*.dex'):
|
|
||||||
apk.write(dex, dex.name)
|
|
||||||
run(bt / ('zipalign' + suffix), '-f', '4', out / 'dex.apk', out / 'aligned.apk')
|
|
||||||
result = ROOT / 'output' / ('Luma-wake-tests.apk' if test else 'Luma.apk')
|
|
||||||
result.parent.mkdir(exist_ok=True)
|
|
||||||
run(*jar_tool('apksigner'), 'com.android.apksigner.ApkSignerTool', 'sign', '--ks', key,
|
|
||||||
'--ks-key-alias', alias, '--ks-pass', 'env:LUMA_BUILD_PASSWORD',
|
|
||||||
'--key-pass', 'env:LUMA_BUILD_PASSWORD', '--out', result, out / 'aligned.apk')
|
|
||||||
run(*jar_tool('apksigner'), 'com.android.apksigner.ApkSignerTool', 'verify', result)
|
|
||||||
print('Built ' + str(result), flush=True)
|
|
||||||
|
|
||||||
build()
|
|
||||||
run(sys.executable, ROOT / 'scripts/make-update-manifest.py')
|
|
||||||
if a.tests:
|
|
||||||
build(True)
|
|
||||||
|
|
@ -1,6 +1,27 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
export JAVA_HOME="${JAVA_HOME:-$PWD/.tools/jdk/Contents/Home}"
|
ROOT="$PWD"
|
||||||
export ANDROID_HOME="${ANDROID_HOME:-$PWD/.tools/sdk}"
|
export JAVA_HOME="${JAVA_HOME:-$ROOT/.tools/jdk/Contents/Home}"
|
||||||
exec python3 scripts/build.py "$@"
|
export ANDROID_HOME="${ANDROID_HOME:-$ROOT/.tools/sdk}"
|
||||||
|
export PATH="$JAVA_HOME/bin:$PATH"
|
||||||
|
BT="$ANDROID_HOME/build-tools/34.0.0"
|
||||||
|
ANDROID_JAR="$ANDROID_HOME/platforms/android-34/android.jar"
|
||||||
|
mkdir -p build/classes build/dex output .tools
|
||||||
|
rm -rf build/classes/* build/dex/*
|
||||||
|
"$BT/aapt2" compile --dir app/src/main/res -o build/resources.zip
|
||||||
|
"$BT/aapt2" link -o build/unsigned.apk -I "$ANDROID_JAR" --manifest app/src/main/AndroidManifest.xml --java build/generated -A app/src/main/assets --auto-add-overlay build/resources.zip
|
||||||
|
find app/src/main/java build/generated -name '*.java' > build/sources.txt
|
||||||
|
javac -encoding UTF-8 -source 8 -target 8 -Xlint:unchecked -bootclasspath "$ANDROID_JAR:$BT/core-lambda-stubs.jar" -d build/classes @build/sources.txt
|
||||||
|
find build/classes -name '*.class' > build/classes.txt
|
||||||
|
"$BT/d8" --lib "$ANDROID_JAR" --min-api 26 --output build/dex @build/classes.txt
|
||||||
|
cp build/unsigned.apk build/with-dex.apk
|
||||||
|
(cd build/dex && zip -q -u ../with-dex.apk classes*.dex)
|
||||||
|
"$BT/zipalign" -f 4 build/with-dex.apk build/aligned.apk
|
||||||
|
if [ ! -f .tools/luma-development.keystore ]; then
|
||||||
|
keytool -genkeypair -keystore .tools/luma-development.keystore -storepass android -keypass android -alias luma -keyalg RSA -keysize 2048 -validity 10000 -dname 'CN=Luma Development' -noprompt
|
||||||
|
fi
|
||||||
|
"$BT/apksigner" sign --ks .tools/luma-development.keystore --ks-key-alias luma --ks-pass pass:android --key-pass pass:android --out output/Luma.apk build/aligned.apk
|
||||||
|
"$BT/apksigner" verify output/Luma.apk
|
||||||
|
python3 scripts/make-update-manifest.py
|
||||||
|
echo "Built $ROOT/output/Luma.apk"
|
||||||
|
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
"""Exercise remote move entry and one arrow; Back restores the original order."""
|
|
||||||
import argparse
|
|
||||||
import subprocess
|
|
||||||
import time
|
|
||||||
import xml.etree.ElementTree as ET
|
|
||||||
|
|
||||||
p = argparse.ArgumentParser()
|
|
||||||
p.add_argument('--adb', required=True)
|
|
||||||
p.add_argument('--device', required=True)
|
|
||||||
a = p.parse_args()
|
|
||||||
|
|
||||||
def adb(*args):
|
|
||||||
return subprocess.check_output([a.adb, '-s', a.device, *map(str, args)]).decode('utf-8')
|
|
||||||
|
|
||||||
def key(k, long=False):
|
|
||||||
adb('shell', 'input', 'keyevent', *(['--longpress'] if long else []), k)
|
|
||||||
time.sleep(.3)
|
|
||||||
|
|
||||||
def tree():
|
|
||||||
adb('shell', 'uiautomator', 'dump', '/sdcard/luma-move.xml')
|
|
||||||
return ET.fromstring(adb('shell', 'cat', '/sdcard/luma-move.xml'))
|
|
||||||
|
|
||||||
def apps():
|
|
||||||
return [n.get('content-desc') for n in tree().iter('node')
|
|
||||||
if n.get('long-clickable') == 'true' and n.get('content-desc')]
|
|
||||||
|
|
||||||
adb('shell', 'am', 'start', '-W', '-n', 'tv.luma.launcher/.MainActivity')
|
|
||||||
key(4)
|
|
||||||
key(19)
|
|
||||||
key(20)
|
|
||||||
before = apps()
|
|
||||||
assert len(before) >= 2, before
|
|
||||||
key(23, True)
|
|
||||||
for _ in range(2):
|
|
||||||
key(20)
|
|
||||||
focused = next(n.get('text') for n in tree().iter('node') if n.get('focused') == 'true')
|
|
||||||
assert focused.startswith('Move in grid'), focused
|
|
||||||
key(23)
|
|
||||||
try:
|
|
||||||
key(22)
|
|
||||||
after = apps()
|
|
||||||
assert after[:2] == [before[1], before[0]], f'Arrow did not move app: before={before[:3]}, after={after[:3]}'
|
|
||||||
print('PASS: remote menu -> move -> right swaps the first two apps')
|
|
||||||
finally:
|
|
||||||
key(4)
|
|
||||||
assert apps()[:2] == before[:2], 'Back did not restore original order'
|
|
||||||
|
|
@ -1,80 +0,0 @@
|
||||||
"""Real network-settings and disposable-test-app uninstall checks. Run after instrumentation."""
|
|
||||||
import argparse
|
|
||||||
import re
|
|
||||||
import subprocess
|
|
||||||
import time
|
|
||||||
import xml.etree.ElementTree as ET
|
|
||||||
|
|
||||||
p = argparse.ArgumentParser()
|
|
||||||
p.add_argument('--adb', required=True)
|
|
||||||
p.add_argument('--device', required=True)
|
|
||||||
a = p.parse_args()
|
|
||||||
|
|
||||||
def adb(*args):
|
|
||||||
return subprocess.check_output([a.adb, '-s', a.device, *map(str, args)]).decode('utf-8')
|
|
||||||
|
|
||||||
def key(k):
|
|
||||||
adb('shell', 'input', 'keyevent', k)
|
|
||||||
time.sleep(.4)
|
|
||||||
|
|
||||||
def tree():
|
|
||||||
adb('shell', 'uiautomator', 'dump', '/sdcard/luma-actions.xml')
|
|
||||||
return ET.fromstring(adb('shell', 'cat', '/sdcard/luma-actions.xml'))
|
|
||||||
|
|
||||||
def tap(label, description=False):
|
|
||||||
for _ in range(8):
|
|
||||||
for n in tree().iter('node'):
|
|
||||||
value = n.get('content-desc' if description else 'text', '')
|
|
||||||
if (label in value if description else value.split('\n')[0] == label):
|
|
||||||
x, y, right, bottom = map(int, re.findall(r'\d+', n.get('bounds')))
|
|
||||||
if bottom - y < 30:
|
|
||||||
continue
|
|
||||||
adb('shell', 'input', 'tap', (x + right) // 2, (y + bottom) // 2)
|
|
||||||
time.sleep(.5)
|
|
||||||
return
|
|
||||||
adb('shell', 'input', 'swipe', 1200, 850, 1200, 400, 300)
|
|
||||||
raise AssertionError('Missing control: ' + label)
|
|
||||||
|
|
||||||
def package_present():
|
|
||||||
return 'package:tv.luma.launcher.tests' in adb(
|
|
||||||
'shell', 'pm', 'list', 'packages', '--user', user, 'tv.luma.launcher.tests').splitlines()
|
|
||||||
|
|
||||||
def uninstall_menu():
|
|
||||||
key(82)
|
|
||||||
tap('App library')
|
|
||||||
tap('Luma test app')
|
|
||||||
tap('Uninstall app')
|
|
||||||
nodes = list(tree().iter('node'))
|
|
||||||
assert any(n.get('package') == 'com.google.android.packageinstaller' or
|
|
||||||
'packageinstaller' in n.get('package', '') for n in nodes), 'No Android confirmation'
|
|
||||||
assert any('Luma test app' in n.get('text', '') for n in nodes), 'Wrong uninstall target'
|
|
||||||
|
|
||||||
user = adb('shell', 'am', 'get-current-user').strip()
|
|
||||||
adb('shell', 'am', 'start', '-W', '-n', 'tv.luma.launcher/.MainActivity')
|
|
||||||
key(4)
|
|
||||||
tap('Open network settings', True)
|
|
||||||
nodes = list(tree().iter('node'))
|
|
||||||
assert any('Network' in n.get('text', '') or 'Wi-Fi' in n.get('text', '') for n in nodes), 'Network page missing'
|
|
||||||
assert any(n.get('package') == 'com.android.tv.settings' for n in nodes), 'Not native TV settings'
|
|
||||||
print('PASS: network status opens native TV network settings', flush=True)
|
|
||||||
key(4)
|
|
||||||
adb('shell', 'am', 'start', '-W', '-n', 'tv.luma.launcher/.MainActivity')
|
|
||||||
assert package_present(), 'Install Luma-wake-tests.apk before this check'
|
|
||||||
uninstall_menu()
|
|
||||||
key(4)
|
|
||||||
assert package_present(), 'Cancel removed test app'
|
|
||||||
print('PASS: canceling Android confirmation preserves the app', flush=True)
|
|
||||||
adb('shell', 'am', 'start', '-W', '-n', 'tv.luma.launcher/.MainActivity')
|
|
||||||
uninstall_menu()
|
|
||||||
tap('OK')
|
|
||||||
for _ in range(15):
|
|
||||||
if not package_present():
|
|
||||||
break
|
|
||||||
time.sleep(.3)
|
|
||||||
assert not package_present(), 'Confirmed uninstall failed'
|
|
||||||
adb('shell', 'am', 'start', '-W', '-n', 'tv.luma.launcher/.MainActivity')
|
|
||||||
key(82)
|
|
||||||
tap('App library')
|
|
||||||
assert not any(n.get('text', '').startswith('Luma test app') for n in tree().iter('node')), 'Removed app remains in library'
|
|
||||||
key(4)
|
|
||||||
print('PASS: confirmed uninstall removes disposable app and refreshes Luma library', flush=True)
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
"""Generate the small feed committed beside the signed APK; URLs resolve inside one Git commit."""
|
"""Generate the small feed committed beside the signed APK; URLs resolve inside one Git commit."""
|
||||||
import hashlib
|
import hashlib
|
||||||
import json
|
import json
|
||||||
import os
|
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
|
@ -14,7 +13,7 @@ manifest = ET.parse(root / 'app/src/main/AndroidManifest.xml').getroot()
|
||||||
code = int(manifest.get(ns + 'versionCode'))
|
code = int(manifest.get(ns + 'versionCode'))
|
||||||
name = manifest.get(ns + 'versionName')
|
name = manifest.get(ns + 'versionName')
|
||||||
apk = root / 'output/Luma.apk'
|
apk = root / 'output/Luma.apk'
|
||||||
badging = subprocess.check_output([os.environ.get('AAPT2', str(root / '.tools/sdk/build-tools/34.0.0/aapt2')), 'dump', 'badging', str(apk)], text=True)
|
badging = subprocess.check_output([str(root / '.tools/sdk/build-tools/34.0.0/aapt2'), 'dump', 'badging', str(apk)], text=True)
|
||||||
assert f"versionCode='{code}'" in badging and f"versionName='{name}'" in badging, 'Rebuild the APK before generating its update manifest'
|
assert f"versionCode='{code}'" in badging and f"versionName='{name}'" in badging, 'Rebuild the APK before generating its update manifest'
|
||||||
gradle = (root / 'app/build.gradle').read_text()
|
gradle = (root / 'app/build.gradle').read_text()
|
||||||
assert re.search(r'versionCode\s+' + str(code) + r'\b', gradle), 'Manifest and Gradle version codes differ'
|
assert re.search(r'versionCode\s+' + str(code) + r'\b', gradle), 'Manifest and Gradle version codes differ'
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,6 @@
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="tv.luma.launcher.tests">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="tv.luma.launcher.tests">
|
||||||
<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="34" />
|
<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="34" />
|
||||||
<application android:label="Luma test app">
|
<application android:label="Luma wake regression tests" />
|
||||||
<activity android:name=".UninstallFixtureActivity" android:exported="true">
|
|
||||||
<intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LEANBACK_LAUNCHER" /></intent-filter>
|
|
||||||
</activity>
|
|
||||||
</application>
|
|
||||||
<instrumentation android:name="tv.luma.launcher.HomeActionsInstrumentation" android:targetPackage="tv.luma.launcher" android:functionalTest="true" />
|
|
||||||
<instrumentation android:name=".WakeRegressionInstrumentation" android:targetPackage="tv.luma.launcher" android:functionalTest="true" />
|
<instrumentation android:name=".WakeRegressionInstrumentation" android:targetPackage="tv.luma.launcher" android:functionalTest="true" />
|
||||||
<instrumentation android:name="tv.luma.launcher.UpdaterInstrumentation" android:targetPackage="tv.luma.launcher" android:functionalTest="true" />
|
<instrumentation android:name="tv.luma.launcher.UpdaterInstrumentation" android:targetPackage="tv.luma.launcher" android:functionalTest="true" />
|
||||||
<instrumentation android:name=".PerformanceInstrumentation" android:targetPackage="tv.luma.launcher" android:functionalTest="true" />
|
<instrumentation android:name=".PerformanceInstrumentation" android:targetPackage="tv.luma.launcher" android:functionalTest="true" />
|
||||||
|
|
|
||||||
|
|
@ -1,181 +0,0 @@
|
||||||
package tv.luma.launcher;
|
|
||||||
|
|
||||||
import android.app.*;
|
|
||||||
import android.content.*;
|
|
||||||
import android.graphics.Rect;
|
|
||||||
import android.net.NetworkCapabilities;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.*;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import java.lang.reflect.*;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/** Real menu/key dispatch regression, with layout/preferences restored in finally. */
|
|
||||||
public final class HomeActionsInstrumentation extends Instrumentation {
|
|
||||||
private Activity activity;
|
|
||||||
|
|
||||||
private Object get(Object target, String name) throws Exception {
|
|
||||||
Field f = target.getClass().getDeclaredField(name);
|
|
||||||
f.setAccessible(true);
|
|
||||||
return f.get(target);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void call(Object target, String name, Class<?> type, Object arg) {
|
|
||||||
runOnMainSync(() -> {
|
|
||||||
try {
|
|
||||||
Method m = type == null ? target.getClass().getDeclaredMethod(name)
|
|
||||||
: target.getClass().getDeclaredMethod(name, type);
|
|
||||||
m.setAccessible(true);
|
|
||||||
if (type == null) m.invoke(target); else m.invoke(target, arg);
|
|
||||||
} catch (Exception e) { throw new RuntimeException(e); }
|
|
||||||
});
|
|
||||||
waitForIdleSync();
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<String> order() throws Exception {
|
|
||||||
return new ArrayList<>(((Map<String, ?>) get(activity, "tiles")).keySet());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void key(int key) {
|
|
||||||
sendKeyDownUpSync(key);
|
|
||||||
android.os.SystemClock.sleep(180);
|
|
||||||
waitForIdleSync();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void check(boolean ok, String message) {
|
|
||||||
if (!ok) throw new AssertionError(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
private TextView text(View v, String prefix) {
|
|
||||||
if (v instanceof TextView && ((TextView) v).getText().toString().startsWith(prefix))
|
|
||||||
return (TextView) v;
|
|
||||||
if (v instanceof ViewGroup)
|
|
||||||
for (int i = 0; i < ((ViewGroup) v).getChildCount(); i++) {
|
|
||||||
TextView found = text(((ViewGroup) v).getChildAt(i), prefix);
|
|
||||||
if (found != null) return found;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void begin(String pkg) throws Exception {
|
|
||||||
// A preceding tap-based check may leave Android in touch mode. A remote arrow exits it.
|
|
||||||
key(KeyEvent.KEYCODE_DPAD_UP);
|
|
||||||
View tile = (View) ((Map<?, ?>) get(activity, "tiles")).get(pkg);
|
|
||||||
runOnMainSync(() -> { tile.requestFocus(); tile.performLongClick(); });
|
|
||||||
waitForIdleSync();
|
|
||||||
Thread.sleep(350);
|
|
||||||
Dialog dialog = (Dialog) get(activity, "currentDialog");
|
|
||||||
TextView move = text(dialog.getWindow().getDecorView(), "Move in grid");
|
|
||||||
check(move != null, "move menu missing");
|
|
||||||
runOnMainSync(move::requestFocus);
|
|
||||||
key(KeyEvent.KEYCODE_DPAD_CENTER);
|
|
||||||
waitForIdleSync();
|
|
||||||
check((boolean) get(activity, "moving"), "remote OK did not enter move mode");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void move(int key, List<String> expected, String pkg, int index) throws Exception {
|
|
||||||
int old = expected.indexOf(pkg);
|
|
||||||
Collections.swap(expected, old, index);
|
|
||||||
key(key);
|
|
||||||
waitForIdleSync();
|
|
||||||
check(order().equals(expected), "visible order did not follow arrow " + key);
|
|
||||||
check(pkg.equals(get(activity, "selected")), "moving selection lost");
|
|
||||||
check(pkg.equals(activity.getCurrentFocus().getTag()), "focus left moving app");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override public void onCreate(Bundle b) { super.onCreate(b); start(); }
|
|
||||||
|
|
||||||
@Override public void onStart() {
|
|
||||||
Bundle result = new Bundle();
|
|
||||||
StringBuilder report = new StringBuilder();
|
|
||||||
int status = Activity.RESULT_OK;
|
|
||||||
SharedPreferences prefs = getTargetContext().getSharedPreferences("luma", 0);
|
|
||||||
boolean hadOrder = prefs.contains("order");
|
|
||||||
String original = prefs.getString("order", "");
|
|
||||||
try {
|
|
||||||
activity = startActivitySync(new Intent(Intent.ACTION_MAIN)
|
|
||||||
.setComponent(new ComponentName("tv.luma.launcher", "tv.luma.launcher.MainActivity"))
|
|
||||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
|
|
||||||
Thread.sleep(2000);
|
|
||||||
List<String> initial = order(), expected = new ArrayList<>(initial);
|
|
||||||
int columns = prefs.getInt("columns", 6);
|
|
||||||
check(initial.size() > columns + 1, "not enough apps for vertical movement");
|
|
||||||
String pkg = initial.get(0);
|
|
||||||
begin(pkg);
|
|
||||||
move(KeyEvent.KEYCODE_DPAD_RIGHT, expected, pkg, 1);
|
|
||||||
move(KeyEvent.KEYCODE_DPAD_DOWN, expected, pkg, columns + 1);
|
|
||||||
move(KeyEvent.KEYCODE_DPAD_UP, expected, pkg, 1);
|
|
||||||
move(KeyEvent.KEYCODE_DPAD_LEFT, expected, pkg, 0);
|
|
||||||
move(KeyEvent.KEYCODE_DPAD_LEFT, expected, pkg, 0);
|
|
||||||
move(KeyEvent.KEYCODE_DPAD_UP, expected, pkg, 0);
|
|
||||||
move(KeyEvent.KEYCODE_DPAD_RIGHT, expected, pkg, 1);
|
|
||||||
key(KeyEvent.KEYCODE_BACK);
|
|
||||||
check(order().equals(initial), "Back did not restore order");
|
|
||||||
check(!(boolean) get(activity, "moving"), "Back did not exit move mode");
|
|
||||||
report.append("PASS: remote menu entry, all four arrows, bounds, focus, Back cancellation\n");
|
|
||||||
begin(pkg);
|
|
||||||
expected = new ArrayList<>(initial);
|
|
||||||
move(KeyEvent.KEYCODE_DPAD_DOWN, expected, pkg, columns);
|
|
||||||
key(KeyEvent.KEYCODE_DPAD_CENTER);
|
|
||||||
check(!(boolean) get(activity, "moving"), "OK did not save");
|
|
||||||
runOnMainSync(() -> { callActivityOnPause(activity); callActivityOnStop(activity);
|
|
||||||
callActivityOnStart(activity); callActivityOnResume(activity); });
|
|
||||||
Thread.sleep(1200);
|
|
||||||
check(order().equals(expected), "saved move lost on resume");
|
|
||||||
report.append("PASS: OK saves order across stop/start\n");
|
|
||||||
|
|
||||||
View network = (View) get(activity, "networkButton");
|
|
||||||
View input = (View) get(activity, "inputButton");
|
|
||||||
View settings = (View) get(activity, "settingsButton");
|
|
||||||
List<TvInputs.Source> actual = (List<TvInputs.Source>) get(activity, "inputSources");
|
|
||||||
call(activity, "applyInputSources", List.class,
|
|
||||||
Collections.singletonList(new TvInputs.Source("test", "Test input", "Connected")));
|
|
||||||
Thread.sleep(250);
|
|
||||||
Rect nr = new Rect(), ir = new Rect(), sr = new Rect();
|
|
||||||
network.getGlobalVisibleRect(nr); input.getGlobalVisibleRect(ir); settings.getGlobalVisibleRect(sr);
|
|
||||||
check(!ir.isEmpty() && !nr.isEmpty() && !sr.isEmpty(), "header buttons clipped");
|
|
||||||
check(ir.right < nr.left && nr.right < sr.left, "header buttons overlap");
|
|
||||||
runOnMainSync(input::requestFocus);
|
|
||||||
key(KeyEvent.KEYCODE_DPAD_RIGHT);
|
|
||||||
check(network.hasFocus(), "input to network focus failed");
|
|
||||||
key(KeyEvent.KEYCODE_DPAD_RIGHT);
|
|
||||||
check(settings.hasFocus(), "network to settings focus failed");
|
|
||||||
key(KeyEvent.KEYCODE_DPAD_LEFT);
|
|
||||||
check(network.hasFocus(), "settings to network focus failed");
|
|
||||||
call(activity, "applyInputSources", List.class, Collections.emptyList());
|
|
||||||
check(input.getVisibility() == View.GONE, "input not hidden without capability");
|
|
||||||
call(activity, "applyInputSources", List.class, actual);
|
|
||||||
report.append("PASS: simulated physical-input header has separate bounds and D-pad focus\n");
|
|
||||||
Object monitor = get(activity, "networkStatus");
|
|
||||||
call(monitor, "show", NetworkCapabilities.class, null);
|
|
||||||
check(network.getContentDescription().toString().startsWith("Network disconnected"), "offline status");
|
|
||||||
call(monitor, "stop", null, null);
|
|
||||||
check(get(monitor, "callback") == null, "callback retained while stopped");
|
|
||||||
call(monitor, "start", null, null);
|
|
||||||
check(get(monitor, "callback") != null, "callback not restored");
|
|
||||||
check(!network.getContentDescription().toString().startsWith("Network disconnected"),
|
|
||||||
"live network did not recover after offline state");
|
|
||||||
check(text(activity.getWindow().getDecorView(), "Personalize") == null, "duplicate footer remains");
|
|
||||||
report.append("PASS: offline presentation, live-network recovery, callback stop/restart, footer\n");
|
|
||||||
} catch (Throwable t) {
|
|
||||||
status = Activity.RESULT_CANCELED;
|
|
||||||
report.append("FAIL: ").append(t).append('\n');
|
|
||||||
} finally {
|
|
||||||
if (activity != null) {
|
|
||||||
try {
|
|
||||||
if ((boolean) get(activity, "moving")) key(KeyEvent.KEYCODE_BACK);
|
|
||||||
} catch (Exception e) { status = Activity.RESULT_CANCELED; report.append("FAIL: move cleanup ").append(e); }
|
|
||||||
}
|
|
||||||
SharedPreferences.Editor edit = prefs.edit();
|
|
||||||
if (hadOrder) edit.putString("order", original); else edit.remove("order");
|
|
||||||
if (!edit.commit()) { status = Activity.RESULT_CANCELED; report.append("FAIL: order restore\n"); }
|
|
||||||
if (activity != null) {
|
|
||||||
try {
|
|
||||||
call(activity, "renderApps", null, null);
|
|
||||||
} catch (Exception e) { status = Activity.RESULT_CANCELED; report.append("FAIL: cleanup ").append(e); }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
result.putString("stream", report.toString());
|
|
||||||
finish(status, result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
package tv.luma.launcher.tests;
|
|
||||||
|
|
||||||
/** Disposable app entry for exercising the real Android uninstall flow. */
|
|
||||||
public final class UninstallFixtureActivity extends android.app.Activity {}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue