Commit Graph

6444 Commits

Author SHA1 Message Date
Sudheer Shanka
82f98334d6 Merge "Notify StorageManagerService when storage related app ops change." into qt-dev 2019-05-21 05:07:51 +00:00
Michael Wachenschwanz
d2111df37b Merge "Clear the Parcel before writing an exception during a transaction" into qt-dev 2019-05-20 22:23:12 +00:00
Sudheer Shanka
b1613982d0 Notify StorageManagerService when storage related app ops change.
StorageManagerService needs to trigger update of storage mountpoints
when an app gets storage access, so update AppOpsService to notify
StorageManagerService synchronously when storage related app ops change.

Also, when an app gets REQUEST_INSTALL_PACKAGES appop denied, kill the
app.

Bug: 132466536
Test: manual
Test: atest cts/hostsidetests/appsecurity/src/android/appsecurity/cts/ExternalStorageHostTest.java
Change-Id: I130dde1bcffea6c96e5d8c173055737850af6151
2019-05-20 10:57:44 -07:00
Nicolas Geoffray
94b2981853 Merge "Workaround for USAP support in jitzygote." into qt-dev 2019-05-17 12:31:12 +00:00
Nicolas Geoffray
e66a2bf226 Workaround for USAP support in jitzygote.
USAP improve app startup by ~5ms, so enable it for the
jitzygote experiment.

Bug: 119800099
Test: boots and usap processes live
Change-Id: I918d81f56cc7e9fcc8a053feadd7878108e6d590
2019-05-17 08:42:28 +00:00
Joe Onorato
fffa4098a7 Add new IncidentManager.requestAuthorization method that takes an executor.
This is @hide for Q now that we're past API freeze, and will be
@SystemApi in master.

Bug: 126700920
Bug: 126701153
Bug: 130351719
Test: bit GtsIncidentConfirmationTestCases
Test: bit GtsIncidentManagerTestCases
Change-Id: Iac6a058017a86c1927502c529e5a7f3881eb56a7
2019-05-16 11:51:54 -07:00
Michael Wachenschwanz
06041db074 Clear the Parcel before writing an exception during a transaction
This prevents any object data from being accidentally overwritten by the
exception, which could cause unexpected malformed objects to be sent
across the transaction.

Test: atest CtsOsTestCases:ParcelTest#testExceptionOverwritesObject
Fixes: 34175893
Change-Id: Iaf80a0ad711762992b8ae60f76d861c97a403013
2019-05-15 23:10:02 -07:00
Ian Pedowitz
a326dfb1e5 Merge "Revert "Revert "Android Q is API 29""" into qt-dev 2019-05-15 16:28:54 +00:00
Jeff Sharkey
9637326ea8 Merge "Explicitly request clearing of external storage." into qt-dev 2019-05-15 01:29:08 +00:00
Jeff Sharkey
3811f35ff7 Remember last time we mounted a volume.
Bug: 131751531
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: Ia5f6153aa15ea923d30085060269125e15e8e62c
2019-05-14 15:50:00 -06:00
Jeff Sharkey
3f704637b4 Explicitly request clearing of external storage.
Similar to how we target DE and CE storage areas, callers need to
specifically ask to work with EXTERNAL storage.  This is because
external storage often lives on a separate device from where internal
DE and CE data lives.

As one specific example, if we're moving an app between two
"internal" storage devices, we don't want to clean up the data
for that package on external storage, since it's not being moved.

This change also expands to all mounted external storage devices,
not just the storage backed by the incoming UUID.

Bug: 113277754
Test: atest android.appsecurity.cts.StorageHostTest
Test: atest android.appsecurity.cts.ExternalStorageHostTest
Test: atest --test-mapping frameworks/base/services/core/java/com/android/server/pm/
Change-Id: Ie125303726dd757ee45bd373f53addb35569c2f7
2019-05-14 14:55:15 -06:00
Ian Pedowitz
1912a57900 Revert "Revert "Android Q is API 29""
This reverts commit 60c71cee6e.

Reason for revert: Rolling forward for Q-Finalization

Bug: 131429032
Bug: 129975435
Change-Id: Idd812d93b767d8a672b9ada58c8bcc2441395847
2019-05-12 19:44:42 +00:00
Joe Onorato
cab1db11ee Fix another copy and paste of the copy and paste error.
Bug: 123955906
Test: bit GtsIncidentConfirmationTestCases:*
Change-Id: I251a0295fbd64e8abea2a42af9cc23fb2c39bc63
2019-05-10 10:29:27 -07:00
Yiwei Zhang
b137faed01 Merge "GpuStats: send a hint of activity launch to GraphicsEnvironment" into qt-dev 2019-05-09 23:45:47 +00:00
TreeHugger Robot
1fca828af3 Merge "Remove hasIsolatedStorage() related logic from PackageParser." into qt-dev 2019-05-09 20:44:26 +00:00
Sudheer Shanka
803c052816 Merge "Remove storage sandboxes related code." into qt-dev 2019-05-09 20:38:16 +00:00
Hai Zhang
e7e00bdaca Remove hasIsolatedStorage() related logic from PackageParser.
The ACCESS_MEDIA_LOCATION and WRITE_OBB permissions will always be
available.

Bug: 112545973
Fixes: 132226317
Test: presubmit
Change-Id: Ie61eba427b48f347438522bc11cfa748ad5ba1f1
2019-05-09 11:29:50 -07:00
Sudheer Shanka
64501e5126 Remove storage sandboxes related code.
Bug: 131115422
Test: manual
Test: atest --test-mapping packages/providers/MediaProvider
Test: atest cts/hostsidetests/appsecurity/src/android/appsecurity/cts/ExternalStorageHostTest.java
Test: atest DownloadProviderTests
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/app/DownloadManagerLegacyTest/src/android/app/cts/DownloadManagerLegacyTest.java
Test: atest cts/tests/app/DownloadManagerApi28Test/src/android/app/cts/DownloadManagerApi28Test.java
Change-Id: Ib8a10d3a9097c1dc4132a71782d622e9e3c3747d
Merged-In: Ib8a10d3a9097c1dc4132a71782d622e9e3c3747d
2019-05-09 17:47:30 +00:00
Yiwei Zhang
e54faf5818 GpuStats: send a hint of activity launch to GraphicsEnvironment
USAP preloads the driver in usap pool, and those processes in the pool
are not bound with any applications. Previously we send GpuStats based
on the completion of driver loading. So with usap enabled, we won't be
able to receive stats for system built-in driver.

If we send the stats when all the existing stats fields are filled,
there will be tons of selinux violations, because those non app
processes are trying to send the stats as well.

So we end up sending the stats based on the hint of activity launch.

Bug: 131866357
Test: dumpsys gpu with enable/disable usap and check the selinux
Change-Id: I32fcc15aeba2f2e89ba6dd9deae2c27187d2071e
2019-05-08 18:43:11 -07:00
TreeHugger Robot
ea5576ef7e Merge "ANGLE: Reorder debug package check" into qt-dev 2019-05-08 19:46:13 +00:00
TreeHugger Robot
94459e7815 Merge "GpuStats: Plumb Vulkan api version" into qt-dev 2019-05-07 18:19:36 +00:00
Yiwei Zhang
27a2743685 GpuStats: Plumb Vulkan api version
This change plumbs the advertised Vulkan api version into GraphicsEnv.
GLES api version and CPU Vulkan api version will be appended when statd
pulls GpuStatsGlobalInfo from GpuStats to save app launch overhead.

Bug: 131866357
Test: build, flash and boot
Change-Id: I7faa924eccc81499cd4f1fd54803e3a62bd3153a
2019-05-06 17:51:00 -07:00
Cody Northrop
41149c3031 ANGLE: Reorder debug package check
As originally coded, debug ANGLE packages could only be used
if ANGLE was properly installed, such that a single answer
was received from ANGLE_FOR_ANDROID.  Since ANGLE is only
required on new Q devices, debug packages could not be loaded
on devices that upgraded from P.

This CL changes the ordering such that debug packages are
detected before checking for propertly installed ANGLE package.

Bug: 132076614
Test: Manually test app with and without debug package
Test: atest CtsAngleIntegrationHostTestCases

Change-Id: I88f0417c7e74c2c20d087f2137eeb78879143ce5
2019-05-06 13:57:43 -06:00
TreeHugger Robot
cc1159a166 Merge "Add Locale#script to Configuration proto." into qt-dev 2019-05-06 18:29:30 +00:00
TreeHugger Robot
085528db5e Merge changes from topic "screenshot-fd-optional-qt-dev" into qt-dev
* changes:
  Use dev/null instead of tmp file
  Notify the caller about I/O error
  Pass valid file descriptor to binder
2019-05-03 15:12:16 +00:00
Abhijeet Kaur
bc3df9f356 Use dev/null instead of tmp file
Use dev/null fd (instead of using fd from temporary file) when
screenshot fd is passed as null, as file deletion does not need
to be handled for dev/null.

Test: Take interactive bugreport (which does not need screenshot)
manually using shell (which calls bugreport API)
Bug: 128981582
Merged-In: I1719899e6cf3bffe1a96849691c051ff4f3a05ec
Change-Id: I1719899e6cf3bffe1a96849691c051ff4f3a05ec
2019-05-03 15:00:46 +01:00
Abhijeet Kaur
7ba06189f3 Notify the caller about I/O error
Call onError for caller of BugreportManager.start() if any io error
occurs during runtime.

Bug: 128981582
Test: Tested manually by throwing IO exception in the code when
bugreport is being generated, onError of the callback successfully
called.
Merged-In: I9033d85d392b926041fc26a86806a370752d062d
Change-Id: I9033d85d392b926041fc26a86806a370752d062d
2019-05-03 15:00:12 +01:00
Abhijeet Kaur
5e5b6b0150 Pass valid file descriptor to binder
screenshotFd needs to be optional in Bugreport API. For some bugreports
such as wifi,telephony, interactive etc taking a screenshot is not
required.

Initially, the API was sending invalid file descriptor to the Binder, but
that binder transaction could not be completed as Binder validates the
file descriptor to be valid and not-null.

Adding a tmp.png screenshot file to pass to bugreport API call. In a
separate CL in frameworks/native, added check that the bugreports that
don't require screenshots would not use this file descriptor value.

Bug: 128981582
Test: Tested by taking bugreports using Bugreport API in shell
Merged-In: I3233f5753506ae159c9fa591742e6b99e361039b
Change-Id: I3233f5753506ae159c9fa591742e6b99e361039b
2019-05-03 14:42:27 +01:00
Varun Shah
95fabaf389 Add Locale#script to Configuration proto.
Read/Write Locale#script along with language, country, and variant
for the Configuration proto.

Bug: 131507134
Test: atest UsageStatsDatabaseTest
Test: atest LocaleListTest [unit-test, cts, gts]
Change-Id: I09b7d3b2e6c6d339cbb75bf19f89251b777bbbe6
2019-05-02 11:56:50 -07:00
Andrei-Valentin Onea
7739542d2d Merge "DO NOT MERGE Fix setting hidden api usage log sample rate" into qt-dev 2019-05-02 15:59:13 +00:00
Ian Pedowitz
40a8e99740 Merge "Revert "RESTRICT AUTOMERGE Android Q is API 29"" into qt-dev 2019-05-02 00:59:09 +00:00
Ian Pedowitz
60c71cee6e Revert "RESTRICT AUTOMERGE Android Q is API 29"
This reverts commit 8a3d1f96e1.

Reason for revert: QT SDK Finalization. Will be merged again on/after May 13th

Bug: 131429032
Bug: 129975435
Change-Id: I7a48ef6a057a97ebd9903b7e934a7d95ec97f00e
2019-05-02 00:55:51 +00:00
Ian Pedowitz
917936172f Merge changes from topic "QT-SDK-Finalization" into qt-dev
* changes:
  RESTRICT AUTOMERGE Android Q is API 29
  RESTRICT AUTOMERGE Removing deprecated APIs added to Q
2019-05-02 00:53:29 +00:00
Joe Onorato
9276afa112 Merge "Fix crash in Permission Controller approving bug reports (incident reports were working fine)" into qt-dev 2019-05-01 21:33:34 +00:00
Suprabh Shukla
8a3d1f96e1 RESTRICT AUTOMERGE Android Q is API 29
Time may be eternal, Captain, but our patience is not. It's time to put
an end to your trek through the stars.

Test: Builds, boots.

Bug: 131429032
Bug: 129975435
Change-Id: Ia2367124afb642dac0fb365e4fa096db1c648adb
2019-05-01 14:11:18 -07:00
Daniel Rosenberg
a47236b5b6 Merge "Fix misplaced return in RescueParty" into qt-dev 2019-05-01 19:38:54 +00:00
Andrei Onea
b019c7eea3 DO NOT MERGE Fix setting hidden api usage log sample rate
This fix addresses two related issues: one with the
DeviceConfig.onPropertiesChangedListener, and another with
HiddenApiUsageLogger.setHiddenApiAccessLogSampleRates.
In both cases, setting one of the sample rates
(hidden_api_access_log_sampling_rate or
hidden_api_access_statslog_sampling_rate) unsets the other. This is due
to them being sent sequentially instead of simultaneously.
Additionally, out of an abundance of caution, mirror the behaviour in
attemptConnectionToPrimaryZygote and attemptConnectionToSecondaryZygote
for the statslog sample rate. This was overlooked in a previous change.

Bug: 119217680
Test: m
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t \
            android.cts.statsd.atom.UidAtomTests#testHiddenApiUsed

Change-Id: I8a5534403269a2339fcabc8f847199ab837ae71b
2019-05-01 19:04:00 +01:00
Daniel Rosenberg
c046c8ee74 Fix misplaced return in RescueParty
"Make RescueParty not wipe if checkpointing" contained an incorrect
return statement, causing the last level of RescueParty to not execute
if checkpointing is not active. This fixes that error

Test: setprop persist.sys.enable_rescue 1
      Set device to not commit checkpoints
      adb shell setprop debug.crash_sysui 1
      adb shell stop
      adb shell start
      Rescue Party causes wipe prompt
Bug: 131721345
Change-Id: I9376020355b80a4e830e6884b92ade9ad11dc8ee
2019-04-30 20:10:23 -07:00
Joe Onorato
7694146d74 Fix crash in Permission Controller approving bug reports (incident reports were working fine)
Bug: 123955906
Test: atest GtsIncidentConfirmationTestCases
Change-Id: I13eb0679f71c1b6470856fd612bc914b1c61c04c
2019-04-30 18:43:48 -07:00
Howard Chen
fff50fe62b Remove the Build.VERSION_CODES.P0
The Build.VERSION_CODES.P0 was the stub for a potential new API level
after P. Now it's Q thus the usage for P0 field is not valid any more.
This CL also fixed the android.os.cts.BuildTest test failure for
cf_x86_phone-userdebug

Bug: 131601118
Test: presubmit test on ag/7204147
Change-Id: Iee474e95a35e051e6a3f4f96da5d82387d33d013
2019-04-30 14:35:29 +08:00
Jeff Sharkey
296152392f Merge "Block write access to media for non-owners." into qt-dev 2019-04-29 13:49:27 +00:00
Jeff Sharkey
c4bf993c51 Block write access to media for non-owners.
The new security model in Q requires that apps can't directly write
to media they don't own.  They can still gain write access using
RecoverableSecurityException.

Bug: 130367350
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: I1fea108aeee63caa2579187be73ba2f27f2bb932
2019-04-28 12:52:43 -06:00
Jeff Sharkey
05dc2a5744 Merge "Make it clear that legacy storage is deprecated." into qt-dev 2019-04-28 18:02:55 +00:00
Jeff Sharkey
e3644411a0 Avoid triggering StrictMode for storage notifs.
Bug: 130129028
Test: none
Exempt-From-Owner-Approval: trivial bugfix
Change-Id: Ia9d9da589ee1f4d95a27bf327235f950f65c69a0
2019-04-28 17:03:47 +00:00
Jeff Sharkey
488162bfef Make it clear that legacy storage is deprecated.
Bug: 131469880
Test: none
Change-Id: I52e009c1ebfc59958d04e5b33a6f4228cdecfcf4
2019-04-28 13:43:52 +00:00
Lorenzo Colitti
bc2aa3472f Make DNS cache lifecycle management explicit
1. ConnectivityService calls netd binder to create/destroy network directly.
2. Call dnsresolver binder to create/destroy cache after create/destroy network.
3. Remove unused network create/destroy methods in NetworkManagementService.

Bug: 129453995
Test: atest FrameworksNetTests

Merged-In: I388e208143c38b89bcbb0589de393250024d59aa
(cherry picked from commit 204ca13e63)

Change-Id: I4d3dfd9305b60a724aa2dc38448948d8e710c932
2019-04-26 02:13:59 +00:00
Chris Wailes
aee02f6ffe Adds additional sanitization for Zygote command arguments.
Previously we were only insuring that the arguments provided to the
Zygote didn't contain any newlines.  This adds additional checks for
carriage returns and standalone integer arguments to protect against
malicious argument and packet injection respectively.

Bug: 130164289
Test: m & flash & boot & check logs
Change-Id: I4055c50d52db0047c02c11096710fd07b429660c
Merged-In: I4055c50d52db0047c02c11096710fd07b429660c
(cherry picked from commit c99198249f)
2019-04-25 21:03:09 +00:00
TreeHugger Robot
31a92c9c0f Merge "Remove unused methods from INetworkManagementService" into qt-dev 2019-04-25 09:09:48 +00:00
Sudheer Shanka
cbfe50d70c Merge "Update behavior of some DownloadManager APIs." into qt-dev 2019-04-25 00:51:59 +00:00
Christian Wailes
88ee294504 Merge "Load the default graphics driver in USAPs." into qt-dev 2019-04-24 21:18:14 +00:00