Commit Graph

7701 Commits

Author SHA1 Message Date
Svet Ganov
38cd221d81 Updating platform SDK version for R
* Finalize resources
  * Update appt/aapt2 constants
  * Update R and SDK constants
  * Fix a crashloop bug

Test: build + boot

bug:150281259

Change-Id: Ie56e12336cd1fcf347ac7164f6988b0c2da77c7d
Merged-In: Ie56e12336cd1fcf347ac7164f6988b0c2da77c7d
2020-05-03 09:58:54 -07:00
Andrew Sapperstein
8fe35e5f21 Fix broken @see tags in public documentation.
These were previously being suppressed by doclava but with this change,
all failures are fixed and the suppression logic has been removed.

To fix the issues, there were a few possible changes made:
- broken reference to a public API (such as incorrect parameters): fixed
- unnecessary @link inside an @see tag: fixed
- @see referring to an @hide or @SystemApi: reference removed
- broken references to inner class constructors
 - worked around by fully qualifying the constructor

Bug: 6963924
Test: make doc-comment-check-docs
Exempt-From-Owner-Approval: cherry-picked from master
Change-Id: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
Merged-In: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
(cherry picked from commit e0624c7a40)
2020-05-01 18:25:32 +00:00
Brad Ebinger
c4815d409c Merge "Add clearAll method to RegistrantList for easier cleanup" into rvc-dev 2020-04-30 20:07:31 +00:00
Jeff Sharkey
1eb3fcfb33 Merge "Update more Parcelables to send Strings UTF-8." into rvc-dev 2020-04-29 23:55:03 +00:00
Brad Ebinger
eb4355ae4e Add clearAll method to RegistrantList for easier cleanup
Bug: 155320231
Test: atest FrameworksTelephonyTests
Change-Id: I6f1896ae163e77cff30e89a5b01b41162fc58200
2020-04-29 15:19:52 -07:00
Jeff Sharkey
1639e6b8ee Update more Parcelables to send Strings UTF-8.
An earlier CL with benchmarks has shown that sending strings as UTF-8
is 50% faster for US-ASCII strings, and still 68% faster for complex
strings referencing higher Unicode planes.  (So an improvement in
both cases!)

Since code across the OS still makes heavy assumptions about Parcel
strings typically being UTF-16, we need to carefully migrate
Parcelables by hand, which is what this CLs begins doing.

Bug: 154436100
Test: manual
Change-Id: I9a675473e0ce3a4a5c5e305dd851b40bb1560e1c
2020-04-29 14:54:44 -06:00
Martijn Coenen
1ed01451ed Merge "Add buildExternalStorageAndroidObbDirs()." into rvc-dev 2020-04-29 18:53:13 +00:00
Yifan Hong
325bbcf799 Merge "Update cleanupAppliedPayload comment." into rvc-dev 2020-04-29 00:08:37 +00:00
Yifan Hong
524d0f5c28 Update cleanupAppliedPayload comment.
ServiceSpecificException might be thrown, but it is not
actionable by the caller. Hence hide the comment.

Fixes: 151156841
Test: none
Change-Id: I07836fe2c5cc361fa81f6fc24851ad2b0721591b
(cherry picked from commit d3abb6d385)
Merged-In: I07836fe2c5cc361fa81f6fc24851ad2b0721591b
2020-04-28 14:41:50 -07:00
Martijn Coenen
806a185ba5 Add buildExternalStorageAndroidObbDirs().
For use by DownloadManager.

Bug: 153504419
Test: atest CtsDownloadManagerInstaller
Change-Id: Ifd45ad779087fb5ba3d885d8e648bc24bc8656eb
2020-04-27 14:09:01 +02:00
TreeHugger Robot
8f0b08f178 Merge "Migrate clients from Binder.waitForService to ServiceManager.waitForService" into rvc-dev 2020-04-24 21:16:54 +00:00
TreeHugger Robot
137f875360 Merge "Use waitForDeclaredService to get Lights HAL" into rvc-dev 2020-04-24 17:23:42 +00:00
Robin Lee
9e1181302a Use waitForDeclaredService to get Lights HAL
We cache the reference to the HAL and use a DeathRecipient to keep track
of whether it's still good.

Adds waitForService and waitForDeclaredService to the ServiceManager
Java implementation because they were missing.

Test: atest LightsManagerTest
Test: atest LightsServiceTest
Bug: 152509747
Bug: 154631113
Bug: 154627432
Bug: 154629168
Change-Id: Ife8471f3a7e47b48bb31015ddf40f1d7fef6240f
2020-04-24 16:12:27 +02:00
Paul Chang
b43fb9b839 Merge "Send intent to let calling app show UI safely without interfering the bugreport/screenshot generation." into rvc-dev 2020-04-24 08:23:21 +00:00
Robin Lee
3124f5c44e Migrate clients from Binder.waitForService to ServiceManager.waitForService
Change-Id: I749203ba09b63dd4aafd6e7df9b87b3fd7955689
Test: ApexManagerTest # (and manually flash a device)
Fix: 154629168
2020-04-23 21:05:46 +00:00
fengjinlan
6c2adc82cc Add method in Handler to remove messages with equal object
Bug: 142293357
Test: atest AudioDeviceBrokerTest

Change-Id: Ibae80f5008df54f4ac8544abb4cc5863ea3db86d
Merged-In: Ibae80f5008df54f4ac8544abb4cc5863ea3db86d
Signed-off-by: fengjinlan <fengjinlan@xiaomi.com>
2020-04-23 11:20:43 -07:00
Paul Chang
6dcc047940 Send intent to let calling app show UI safely without interfering the bugreport/screenshot generation.
- Calling app needs the intent from platform to show UI safely without interfering the bugreport/screenshot generation.
- Currently IncidentCompanionService can only send the intent to app of personal profile when there is work profile.
- But calling app may be from work profile.
- So change to use BugreportManager to send the intent to calling app.

BUG: 153809412
Test: Flash, press bugreport shortcut and confirm calling app of work profile can receive the intent.
Change-Id: I45b2b7ab8e017ba93c1e71ad53f4aa3607af9106
2020-04-23 18:14:57 +08:00
Yurii Zubrytskyi
f3d4495df9 Merge changes I227d8e0c,Ided4415a into rvc-dev
* changes:
  [incfs] Small cleanup in staging -> final dir rename
  [incfs] Use MountRegistry to import existing mounts on start
2020-04-22 18:26:15 +00:00
Yurii Zubrytskyi
930f1d10bc Merge changes I8942a2db,Ibcef3f40,I6e765563 into rvc-dev
* changes:
  [incfs] Cleanup storage creation and don't use temp directory
  [incfs] Notify IncrementalService about system startup later
  [incfs] Fix bad path::join() path preparation
2020-04-22 18:25:49 +00:00
Yurii Zubrytskyi
08a4c7f70b [incfs] Small cleanup in staging -> final dir rename
Bug: 153704006
Test: atest PackageManagerShellCommandTest \
  PackageManagerShellCommandIncrementalTest \
  IncrementalServiceTest
Change-Id: I227d8e0cba6554bf8cf58a16598f34ccbf3d21c0
2020-04-22 00:49:05 -07:00
Yurii Zubrytskyi
360bbdc720 [incfs] Cleanup storage creation and don't use temp directory
Bug: 153704006
Test: atest PackageManagerShellCommandTest \
  PackageManagerShellCommandIncrementalTest \
  IncrementalServiceTest
Change-Id: I8942a2db766cfdb7c119112cc9b58ee0287f1767
2020-04-22 00:39:44 -07:00
Jeff Sharkey
b67e70aa40 Merge changes from topic "apr19" into rvc-dev
* changes:
  Update some Parcelables to send Strings UTF-8.
  Offer to write Strings through Parcels as UTF-8.
2020-04-21 22:59:40 +00:00
Jeff Sharkey
d387e79ae1 Offer to write Strings through Parcels as UTF-8.
Recently while investigating some Binder limits, I discovered that
we're still sending Strings across Binder as UTF-16, which is very
wasteful for two reasons:

1. The majority of data flowing through APIs like PackageManager is
already limited to US-ASCII, and by sending UTF-16 we're wasting
half of our transactions on null-byte overhead.

2. Internally ART is already "compressing" simple strings by storing
them as US-ASCII instead of UTF-16, meaning every time we want to
write a simple string to Binder, we're forced to first inflate it
to UTF-16.

This change first updates Parcel.cpp to accept char* UTF-8 strings,
similar to how it accepts char16_t* for UTF-16.  It then offers
both UTF-8 and UTF-16 variants to Parcel.java via JNI.  We also
update the String8 handling to behave identical to String16.

This change adds benchmarking to show that these new methods are
about 50% faster for US-ASCII strings, and about 68% faster for
complex strings that reference higher Unicode planes.  (So an
improvement in both cases!)

Bug: 154436100
Test: atest FrameworksCoreTests:ParcelTest
Test: make core-libart conscrypt okhttp bouncycastle vogar caliper && vogar --mode app_process --benchmark frameworks/base/core/tests/benchmarks/src/android/os/ParcelStringBenchmark.java
Change-Id: I22a11d3497486d922ec8e14c85df66ca096b8f2a
2020-04-21 09:38:36 -06:00
Martijn Coenen
29d6a24fbf Merge "Don't update quota for non-emulated volumes." into rvc-dev 2020-04-21 12:22:48 +00:00
Martijn Coenen
1b981a3aea Don't update quota for non-emulated volumes.
Since they don't support quota. Also, don't throw an exception if we
can't find a volume for the passed-in path, but warn instead: the volume
may be unstable and have disappeared by the time we do this.

Bug: 152618535
Test: boot emulated image; verify no crashes when inserting media on
      public storage
Change-Id: I0e6b8f5c9f9f35b80b7bd5f6255a70e210a30474
2020-04-21 12:51:47 +02:00
TreeHugger Robot
896cdcca42 Merge "Apply intensity settings to composed vibration effects" into rvc-dev 2020-04-20 18:11:30 +00:00
Lais Andrade
bf7a301ab0 Apply intensity settings to composed vibration effects
Use the existing maxAmplitude and gamma adjustment values to apply the
relative scaling of default vibration intensity settings and user
settings on top of the PrimitiveEffect#scale value.

As a consequence, the relative scaled amplitude of a OneShot or Waveform
vibration effect should match the scaled PrimitiveEffect#scale value.

Fix: 154089649
Test: atest FrameworksCoreTests:VibrationEffectTest
Change-Id: I3ca0042a42675289a2ed8110c9dc3798055ebf4a
2020-04-20 15:02:15 +00:00
Jerry Chang
e63ae2f84f Mark more directory getter APIs @TestApi
To have a way to verify behavior of more directories, mark more
directory getter APIs @TestApi.

Bug: 148664742
Test: atest SysConfigTest#testStageWhitelist
Change-Id: I2d22412935b24ec4c33d8d1b3a7fbb7df4a08841
2020-04-17 14:50:48 +08:00
TreeHugger Robot
a93686c403 Merge "bypass anti-malware verification" into rvc-dev 2020-04-15 20:13:43 +00:00
Todd Kennedy
75dd0e649a bypass anti-malware verification
For incremental installations only, we skip the verification
request broadcast and instead always send a verified broadcast
with the root hash.

Bug: 151240337
Test: Manual. Install APK normally and see the verifier request broadcast is sent
Test: Manual. Install APK incrementally and see verifier request broadcast is not sent, and verified broadcast is sent with root hash
Change-Id: I2599472818b63ea172d2d412741e5540c8a52176
2020-04-15 10:33:19 -07:00
Varun Shah
acb5634dc4 Add new atoms to track user journeys, such as user switches.
Define new atoms to better log and understand various user journeys,
such as user switches, user starts, and user creation.

The UserLifecycleJourneyReported atom defines a user's journey and
holds a user's information such as their user id, user type, and flags
associated with the user. This atom includes a session-id which is used
to link to the UserLifecycleEventOccurred atom which keeps track of
lifycycle events that occur throughout a user's journey. As more user
journeys are defined, there could be more Events added in the future.

Note: the JourneyReported atom can currently be logged more than once
per user journey since there is no record of the user's ongoing journey.
This will be updated in a future CL.

Bug: 146505521
Bug: 150788910
Test: statsd_testdrive 264 265
Change-Id: Iff3847be64d718fb2ec17e58c33d47f7fa4b627a
2020-04-14 11:25:07 -07:00
Yurii Zubrytskyi
da208016d6 [incfs] Make native library extraction async
IncrementalService can create the library files beforehand, but
delay filling in their data. As it takes quite a while in
general (over a second in cases when the phone is busy), it's
better to run the unzipping and filling in a separate thread
and only make sure it finishes before the whole installation
process is complete.
This speeds up the megacity.apk installation by ~250-300ms,
1000-1100ms -> 750-800ms

Bug: 153513507
Test: adb install megacity.apk

Change-Id: Ia44f7e45b9e0abaebdfb6fe5352f9dcf29ab4ece
2020-04-10 12:30:49 -07:00
Nikita Ioffe
57300d9057 Introduce static @hide PowerManager.isRebootingUserspaceSupportedImpl()
This method consolidates logic of testing whenever rebooting userspace
is supported in a place that can be used both from
PowerMager.isRebootingUserspaceSupported() API and from
PowerManagerService.reboot() implementation.

Consequently, this makes `adb shell svc power reboot userspace` also
benefit from that check, and fail userspace reboot on devices that don't
support it.

Also tweaked logic of ignoring RemoteException to take into account
userspace reboot.

Test: adb root
Test: adb shell setprop init.userspace_reboot.is_supported 0
Test: adb shell svc power reboot userspace & verified error message
Test: adb shell setprop init.userspace_reboot.is_supported 1
Test: adb shell svc power reboot userspace & verified no error message
Test: atest PowerManagerTest
Test: atest CtsUserspaceRebootHostSideTestCases
Bug: 152803929
Change-Id: I2d3a8e0ae1320c408a838c5c5fdf4cd977b167b3
2020-04-09 14:07:22 +01:00
TreeHugger Robot
afef06a0f6 Merge "Revert "Revert "Do not mount whitelisted package in storage data and obb dirs""" into rvc-dev 2020-04-08 14:48:39 +00:00
Alex Buynytskyy
f415679228 Change the way how we call setStorageParams.
Now it's unified with callback FS connector - we are passing the
callback pointer directly to dataloader. This restricts access only
to methods we want and only by someone we want.

Bug: b/153468113
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: Ib557ebbe7c6c5ce92140eb20534a3626b3ac96d3
2020-04-07 14:42:50 -07:00
Fiona Campbell
adbe11f6ac Merge "Make PowerManagerService use float for brightness" into rvc-dev 2020-04-07 09:36:09 +00:00
Fiona Campbell
29dce0f0a9 Make PowerManagerService use float for brightness
Change the override brightness values to use float instead of an int in
PowerManagerService.

Bug: 150671605

Test: WmTests:RootWindowContainerTests
FrameworksServicesTests:PowerManagerServiceTest
CtsOsTestCases:android.os.cts.PowerManagerTest
FrameworksCoreTests:android.os.PowerManagerTest

Change-Id: I97e97e1500dac7f8beb112812d1347fa420afbf7
2020-04-06 19:28:55 +01:00
Abhijeet Kaur
a32954ec22 Merge "Remove a TODO as no work needs to be done" into rvc-dev 2020-04-06 12:36:11 +00:00
Abhijeet Kaur
fd83d9dbb7 Remove a TODO as no work needs to be done
Bug: 150672994
Test: builds
Change-Id: I90fcbfb8d52e6883c12c7a76765767eaed370afe
2020-04-06 10:34:28 +01:00
TreeHugger Robot
2c1f53ad6f Merge "Disable the freezer while we're collecting binder interface descriptors." into rvc-dev 2020-04-03 22:41:52 +00:00
Nikita Ioffe
d8c1e77cf8 Merge "Make init.userspace_reboot.is_supported a rw property" into rvc-dev 2020-04-02 15:20:34 +00:00
Ricky Wai
af8bcbd46f Revert "Revert "Do not mount whitelisted package in storage data and obb dirs""
This reverts commit 7929c5dced.

Reason for revert: DeviceBootTest works now.
Fixed a bug in ProcessList to handle inode==0 case.

Test: atest DeviceBootTest
Bug: 151218156

Change-Id: I9c0066471e613ac7550cd55205653d84486af062
2020-04-02 13:10:33 +00:00
Alex Buynytskyy
50e0244012 Merge changes from topic "LOADER_USAGE_STATS" into rvc-dev
* changes:
  Checking LOADER_USAGE_STATS before enabling read logs.
  Revert "Update the current API dump"
2020-04-02 00:36:26 +00:00
Alex Buynytskyy
5e860ba105 Checking LOADER_USAGE_STATS before enabling read logs.
Bug: b/152633648
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: Ic747a51b97b785c627c95bddecc6834ef602ff30
2020-04-02 00:31:41 +00:00
Nikita Ioffe
5c99905f44 Make init.userspace_reboot.is_supported a rw property
General recommendation is to avoid read-only properties, and instead control
"read-onlines" by only allowing init/vendor_init to set the property.

Since ro.init.userspace_reboot.is_supported was added in this release, and
nobody outside of the platform is querying it directly, it should be fine to
simply rename it.

Test: adb shell getprop init.userspace_reboot.is_supported
Test: atest CtsUserspaceRebootHostSideTestCases
Bug: 152803929
Change-Id: I31b9ac7f2c92ce82664a0266aea62faa2bdd365f
Merged-In: I31b9ac7f2c92ce82664a0266aea62faa2bdd365f
(cherry picked from commit 24e2259e5d)
2020-04-01 18:26:19 +01:00
Martijn Coenen
956c1333a4 Disable the freezer while we're collecting binder interface descriptors.
These are synchronous calls out from system_server to many processes;
make sure we don't get hung up on them.

Bug: 152294322
Test: N/A
Change-Id: Ie6f9da6c7f5df346cc28e0968f70a898bcd52adf
2020-04-01 16:37:51 +02:00
TreeHugger Robot
63ff5bb6f1 Merge "PMS: Add shell command to toggle FIXED_PERFORMANCE" into rvc-dev 2020-03-31 20:38:47 +00:00
Mike Ma
1b75683d4f Remove registerSection API with optional Executor
This patch addresses an issue from API review:
registerSection cannot have an optional Executor

registerSection is an unreleased API in R, therefore can be hard
removed.

Fixes: 148867197
Test: Build
Change-Id: Icdb8b97f7fa3f1880aa3039dbbe82f8331a45202
2020-03-30 17:13:39 -07:00
Nikita Ioffe
810c90c70e Merge "pm install-commit supports waiting for staged session to be ready" into rvc-dev 2020-03-28 18:35:50 +00:00
Nikita Ioffe
13973e1d89 pm install-commit supports waiting for staged session to be ready
This change allows callers of adb install-multi-package to benefit from
--wait flag which will wait for the pre-installed verification of staged
sessions.

Test: atest PackageManagerShellCommandTest
Test: adb install-multi-package tzdata.apex shim.apex
Bug: 147694315
Change-Id: Ia356c4dff635ec230eb505fb400913c76ec84042
2020-03-28 12:39:29 +00:00