Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 061267ee authored by Tao Bao's avatar Tao Bao
Browse files

updater_sample: Build SystemUpdaterSample as non-privileged app by default.

Prior to the change, SystemUpdaterSample was built as privileged app.
It must be installed along with the matching privapp-permissions
whitelist change (as noted in updater_sample/README.md), otherwise would
block device booting if installed unintentionally (e.g. with `mm` or
`mmma`).

This CL avoids putting the device in a bad state due to a sample app.

Fixes: 135703777
Test: `lunch aosp_taimen-userdebug && m -j installclean &&
          mmma -j bootable/recovery && m -j`
      Flash on device and boot successfully.
Test: Run the tests per instructions in updater_sample/README.md.
Change-Id: Ib8b587c77570f05f7db748fad84744fa45016aab
parent 9b76970e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -55,6 +55,9 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/nativetest/recovery_component_
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/nativetest64/recovery_component_test)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/testcases/recovery_component_test)

$(call add-clean-step, find $(OUT_DIR) -type f -name "SystemUpdaterSample*" -print0 | xargs -0 rm -f)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/priv-app/SystemUpdaterSample)

# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
+0 −1
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@
android_app {
    name: "SystemUpdaterSample",
    sdk_version: "system_current",
    privileged: true,

    srcs: ["src/**/*.java"],

+4 −2
Original line number Diff line number Diff line
@@ -191,6 +191,8 @@ privileged system app, so it's granted the required permissions to access
    </privapp-permissions>
   ```
   to `frameworks/base/data/etc/privapp-permissions-platform.xml`
4. Add `privileged: true` to SystemUpdaterSample
   [building rule](https://android.googlesource.com/platform/bootable/recovery/+/refs/heads/master/updater_sample/Android.bp).
5. Build sample app `make -j SystemUpdaterSample`.
6. Build Android `make -j`
7. [Flash the device](https://source.android.com/setup/build/running)
@@ -229,9 +231,9 @@ The commands are expected to be run from `$ANDROID_BUILD_TOP`.

1. Build `make -j SystemUpdaterSample` and `make -j SystemUpdaterSampleTests`.
2. Install app
   `adb install $OUT/system/priv-app/SystemUpdaterSample/SystemUpdaterSample.apk`
   `adb install $OUT/system/app/SystemUpdaterSample/SystemUpdaterSample.apk`
3. Install tests
   `adb install $OUT/testcases/SystemUpdaterSampleTests/SystemUpdaterSampleTests.apk`
   `adb install $OUT/testcases/SystemUpdaterSampleTests/arm64/SystemUpdaterSampleTests.apk`
4. Run tests
   `adb shell am instrument -w com.example.android.systemupdatersample.tests/android.support.test.runner.AndroidJUnitRunner`
5. Run a test file