Commit Graph

17 Commits

Author SHA1 Message Date
Howard Chen
e176c56f6e Use new GsiInstallParams struct
Bug: 139402092
Test: adb shell am start-activity \
            -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \
            -a android.os.image.action.START_INSTALL \
            -d file:///storage/emulated/0/Download/system.raw.gz \
            --el KEY_SYSTEM_SIZE $(du -b system.raw|cut -f1) \
            --el KEY_USERDATA_SIZE 8589934592

Change-Id: I62330ccbe3c863850b545db5e911196d22f518d7
2019-10-24 21:34:43 +00:00
Howard Chen
ae615b32cd Use Ashmem to reduce buffer copies
Use android.os.MemoryFile to allocate Ashmem and use gsid.setAshmem and
gsid.commitGsiChunkFromAshmem to submit data.

Bug: 138976291
Test: adb shell am start-activity \
    -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \
    -a android.os.image.action.START_INSTALL \
    -d file:///storage/emulated/0/Download/system.raw.gz \
    --el KEY_SYSTEM_SIZE $(du -b system.raw|cut -f1) \
    --el KEY_USERDATA_SIZE 8589934592

Change-Id: I6df718a8cc3f4e5835c9d20d0bf5bf8bb0daee22
Merged-In: I6df718a8cc3f4e5835c9d20d0bf5bf8bb0daee22
2019-09-09 18:14:48 +08:00
Howard Chen
c44ee158b9 Clean up usage on deprecated GSID methods
change: Add a oneShot argument to setEnable

remove: commit() and replace it with enableGsi

rename: removeGsiInstall -> removeGsi
rename: disableGsiInstall -> disableGsi

Bug: 138969329
Test: adb shell am start-activity \
    -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \
    -a android.os.image.action.START_INSTALL \
    -d file:///storage/emulated/0/Download/system.raw.gz \
    --el KEY_SYSTEM_SIZE $(du -b system.raw|cut -f1) \
    --el KEY_USERDATA_SIZE 8589934592

Change-Id: I680013c8b1181599f0b858222bd92e31c5f085fd
Merged-In: I680013c8b1181599f0b858222bd92e31c5f085fd
2019-09-09 18:14:29 +08:00
Colin Cross
20bc2bf3f6 Convert more of frameworks/base/packages to Android.bp
See build/soong/README.md for more information.

Bug: 122332340
Test: m DynamicSystemInstallationService InputDevices MtpDocumentsProvider SimAppDialog
Change-Id: I851b819030a1da6091f5d6125a228bb01a99011b
2019-07-24 16:06:52 -07:00
Po-Chien Hsueh
22c1f9ac9f Reduce parcel size to avoid binder transaction failure
Reduce buffer size to 8192 to avoid binder transaction failures.
According to our previous tests. Reducing the buffer size to 8K
doesn't show negative impact on performance.

Bug: 132923636
Test: Successfully install a DSU
Change-Id: Ibe51ab748b4f6c1d3c3ac8286519380ea8afc184
2019-05-21 01:17:30 +00:00
Po-Chien Hsueh
7687aaac1d Check if DSU is in use before feature flag
We are using a feature flag to protect DSU and the device. But when
a Dynamic System is in use, feature flag is set as false by default.

This CL makes DSU bypass feature flag and start GSI service on boot
completed, check if the device is currently running a Dynamic System,
then, stop GSI service if the device isn't.

Bug: 132575851
Test: restart into DSU, check if the "In Use" notification is shown.
Change-Id: I9dabf9bc1716ef18d513278415c6544a5467d510
2019-05-21 01:16:33 +00:00
Po-Chien Hsueh
dfd69d770c Add KEY_ENABLE_WHEN_COMPLETED for testing
Per design, we ask user's confirmation before enabling DSU when
install completed. To simplify the process of testing, this CL adds
a paramenter (intent key) "KEY_ENABLE_WHEN_COMPLETED". If the key is
set, the installation service will not ask user before enabling DSU.

Bug: 131866826
Test: adb shell am start-activity -n com.android.dynsystem/com.android.dynsystem.VerificationActivity
      -a android.os.image.action.START_INSTALL
      -d file:///storage/emulated/0/Download/system.raw.gz
      --el KEY_SYSTEM_SIZE 893841408
      --el KEY_USERDATA_SIZE 8589934592
      --ez KEY_ENABLE_WHEN_COMPLETED true

Change-Id: Id38c4c0525199594f6bd6704b5a575d4a42b7b61
2019-05-15 02:46:19 +00:00
Po-Chien Hsueh
02778f5712 Rename folder dynandroid to dynsystem
We previously renamed DynamicAndroid to DynamicSystem. Package name
was also changed to com.android.dynsystem. But the folder name was
unchanged. This CL fixes the inconsistency.

Bug: 126613281
Test: make and run the service with 'adb shell am'
Change-Id: Ib462aec1603a16179c8392b6d51a00d0855d9421
2019-04-22 03:15:25 +00:00
Po-Chien Hsueh
ea0a579127 String review follow-up
Rename "Android On Tap" to "Dynamic System Updates".
And, some string changes to follow review suggestions.

Bug: 129100345
Bug: 129330026
Test: make the package
Change-Id: I440e5beaa3831814d2f7f1063be16d073c5f2c38
2019-04-19 10:46:48 +08:00
Po-Chien Hsueh
67697394a2 stopSelf() if there is no installed system image
On BOOT_COMPLETED, the installation checks if there is an installed
system image and shows a notification if there is.

However, if there isn't. The installation should stop itself.

Bug: 128960337
Test: boot and adb shell ps
Change-Id: I422e308020cd5ec127ea265079926c1b74547d4b
2019-04-10 16:19:53 +08:00
Po-Chien Hsueh
9a1627f521 DynamicSystem string review followup
Some changes to follow string review suggestions:
- Simplify some messages.
- Replace 'Reboot' with 'Restart'.
- Notification action button order: 'Restart' button on the right.

Bug: 129100345
Test: verified with test app
Change-Id: I1ee97b0adbf74add68d3561fc647dc4923ee7237
2019-04-09 14:26:38 +08:00
Po-Chien Hsueh
91508ea20d Use setEnable() when there is an installed image
We can now use setEnable() to tell GsiService that we would like
run in DynamicSystem on the next restart, if there is a system
image installed.

Bug: 124613126
Test: Tap the button and setEnabe() is invoked.
Change-Id: I74312af0c87548981ecb4e1ac9a1f3814304a4d5
2019-04-03 07:54:54 +00:00
Po-Chien Hsueh
4167b42f89 Use FeatureFlagPersistent to guard DynamicSystem
Check persistent feature flag 'settings_dynamic_system' before
invoking the installation service. User can still use gsi_tool if
the device is unlocked.

Bug: 119647479
Test: Verified with 'adb shell am' and test app.
Change-Id: If2265d877bc7eedf9b7a107bba04d2e95cf1b89a
2019-04-03 10:29:31 +08:00
Po-Chien Hsueh
6762e2b661 Add a permission, INSTALL_DYNAMIC_SYSTEM
We already have a permission, MANAGE_DYNAMIC_SYSTEM, whose protection
level is signature. Only platform applications holding it can interact
directly with DynamicSystemService, a wrapper of native GsiService. In
our design, DynamicSystemInstallationService is the sole platform app
holding it.

Then we need another permission for non-platform but privileged apps.
This new permission doesn't give apps access to DynamicSystemService,
but only to system API DynamicSystemClient. DynamicSystemClient works
with underneath DynamicSystemInstallationService and allows privileged
apps to install DynamicSystem images and get status updates in our
designed manner.


Bug: 128982216
Test: verified using DynamicSystemClient.
Change-Id: I3e67322511e3ab08db87bfad40d8c3d3cf6fdfe5
2019-03-25 15:55:39 +00:00
Po-Chien Hsueh
c51cf0f76a Send URL using Uri instead of String
Per API review, send the system image file path to the installation
service using Uri.

Bug: 126613281
Test: adb shell am start-activity -d URL
Change-Id: Ib46d3604c16a981b4ae1a571afa96ffdda7a7262
2019-03-21 17:26:20 +08:00
Po-Chien Hsueh
a5bd084a44 Pass exception detail to API user
Per API review, DynamicSystem installation service will also pass
exceptions to users of DynamicSystemClient.

Bug: 126613281
Test: build and run, verified with test app.
Change-Id: I413d6137837eaa968f59550f110da34cea66d4d4
2019-03-21 17:26:09 +08:00
Po-Chien Hsueh
4e908c24ca API review followup: DynamicAndroidClient
Some API changes per API reivew:
- Move DynamicAndroidClient and ~Manager to android.os.image.
- Rename them to DynamicSystemClient and ~Manager.
- Rename permission MANAGE_DYNAMIC_ANDROID to MANAGE_DYNAMIC_SYSTEM
- Corresponding changes in the installation service.
- Corresponding changes in privapp-permissions-platform.xml.
- Add missing annotations.
- Change setOnStatusChangedListener's parameters order.
- Improve documentations.
- Re-generate api/system-current.txt.

Bug: 126613281
Test: adb shell am
Change-Id: Ia920e9ccf6de1dbbd38c52910cb72cb81b9b5b32
2019-03-21 17:25:59 +08:00