Commit Graph

6419 Commits

Author SHA1 Message Date
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
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
Jeff Sharkey
16641365aa Merge "Rename Environment method to follow attribute." into qt-dev 2019-04-24 18:57:20 +00:00
Chris Wailes
35fdbc570b Load the default graphics driver in USAPs.
This patch causes unspecialized app processes to load the OpenGL driver
after they are forked.  The ZygoteProcess code will then take an
application's driver preference into account when selecting how to
launch it.

Test: m & boot & launch & inspect traces for driver loading
Bug: 130029351
Change-Id: If6fa02f9c387596162e75a685b04208b45a5c86b
Merged-In: If6fa02f9c387596162e75a685b04208b45a5c86b
(cherry picked from commit 301a1c46da)
2019-04-24 17:43:15 +00:00
Rubin Xu
361cea7d8f Remove unused methods from INetworkManagementService
Remove unused public methods setPermission() and clearPermission()

Bug: 114231106
Test: make

Change-Id: I7acbbd36f41bef1356a158bed075c7be330728f4
(cherry picked from commit a430eda4dd)
2019-04-24 16:17:58 +00:00
Sudheer Shanka
25f1c6ebeb Update behavior of some DownloadManager APIs.
-- Update behavior of DownloadManager.setDestinationUri(),
   DownloadManager.setDestinationInExternalPublicDir() and
   DownloadManager.addCompletedDownload() based on the latest
   storage re-design. Essentially, going forward these APIs
   will only allow downloading files into package owned dirs
   or the top-level Download dir.
-- Allow some system components to specify
   MediaColumns.OWNER_PACKAGE_NAME when inserting items into
   MediaProvider.
-- Don't copy DownloadManager.COLUMN_TITLE to MediaProvider.
   DownloadProvider and MediaProvider have different constraints
   around "title" and there isn't really a need to keep these
   in sync.
-- Sanity check file download paths hinted by apps.
-- Remove sandbox related logic in DownloadProvider.

Bug: 120879208
Bug: 128630262
Bug: 130797842

Test: manual
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
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*

Change-Id: If48bc9ecf9ed94412c6c62ce4e5e6a55fff9b789
2019-04-23 18:55:51 -07:00
Santos Cordon
623526b4b3 Add delay to power-button power-off after gesture wakeup.
Adds a small delay to avoid turning off the device if the user
hits the power button right after the device wakes up via a gesture.

Bug: 126560003
Test: Manual
Change-Id: I3116ce98f244e5660573d5fa764a77083aee7fc5
2019-04-23 11:55:29 +01:00
Jeff Sharkey
8926fc1a51 Rename Environment method to follow attribute.
We recently changed the attribute name, and the Environment method
used to test it should also change.

Bug: 130984886
Test: atest android.appsecurity.cts.ExternalStorageHostTest
Change-Id: I8ed7fa9232a646b2f2f280c4b82dbc6d3cf31426
2019-04-21 09:38:49 -06:00
Tim Van Patten
5973ec9678 Verify Bundle is not null before using it
It's possible the Bundle has not been initialized when determining if
the ANGLE dialog box should be shown, due to how early that check is
performed. This change will verify the Bundle is not null before using
it and fall back to using the Context if it is.

Bug: 130185493
Test: atest CtsAngleIntegrationHostTestCases
Test: Enable Toast Message and then atest CtsAngleIntegrationHostTestCases
Change-Id: I39f48bdf20616298c66b2bb36082149cb24e908c
(cherry picked from commit 5da6a95eab)
2019-04-19 20:31:01 +00:00
TreeHugger Robot
c87a593dee Merge "Add fallback for TEXTURE_TICK" into qt-dev 2019-04-19 05:35:02 +00:00
TreeHugger Robot
1f4e4e433d Merge "Make LocaleList.isPseudoLocale a public API" into qt-dev 2019-04-19 03:11:31 +00:00
Cody Northrop
4112ec5512 Merge "GraphicsEnvironment: Expose query to determine ANGLE use" into qt-dev 2019-04-18 19:47:07 +00:00
Maurice Lam
52f378834d Make LocaleList.isPseudoLocale a public API
Test: CTS
Bug: 130636934
Change-Id: I6a9abd8a7de358cb077d9648c62fe9c0ec482720
2019-04-16 21:31:28 +00:00
Svet Ganov
d563e937f2 Make storage a restricted permission - framework
This change makes storage a soft restricted permission. When the
permission is whitelisted for an app then hodlding it allows the
app to access the full SD card as on a P device. If howerver, the
permisison is not whitelisted for an app then holding it allows
accessing the visual/aural collections in media store while the
app would run in its own isolated storage sandbox.

This change also connects the opt in/out application attribute
to how external storage is mounted remocing temporary code. The
attribute was renamed to convey that opting in legacy mode is
not somethung that is desirable or would be available in the long
run.

White at this also fix the default state of app ops for restricted
permissions to avoid allowing ops for non requested restricted
permissions to every UID as component access could skip permission
checks by cannot skip app op checks.

bug:130327036

atest CtsPermission2TestCases
atest CtsPermissionTestCases
atest CtsAppOpsTestCases
atest atest CtsAppSecurityHostTestCases:android.appsecurity.cts.ExternalStorageHostTest
atest CtsAppSecurityHostTestCases:android.appsecurity.cts.PermissionsHostTest

Change-Id: Ibb23cbb6a5c66d9c3823cc13562a1b903b391ffd
2019-04-16 12:34:49 -07:00
Cody Northrop
12d320a501 GraphicsEnvironment: Expose query to determine ANGLE use
Move the early logic that decides whether ANGLE should be used
to a static public function that can be queried elsewhere
without setting up the environment further.

Bug: 130029351
Test: atest CtsAngleIntegrationHostTestCases

Change-Id: I908233d46631ec91dca714bff3f8fd9341160c9e
2019-04-16 11:48:29 -06:00
Nandana Dutt
8a69e0b393 Merge "Expose bugreporting service name" into qt-dev 2019-04-12 10:48:44 +00:00
Peiyong Lin
8f0e1cddbf Merge "[GraphicsEnvironment] Expose API to query whether an app should use game driver." into qt-dev 2019-04-11 23:21:29 +00:00
Nandana Dutt
d7e8d5a108 Expose bugreporting service name
Also add @TestApi so GTS tests can be written.

BUG: 123578274
Test: builds
Change-Id: Ia43edb8aecbdd7138468a92692a2e0bd72379bdf
2019-04-11 16:57:39 +00:00
Cody Northrop
3432b6df37 Merge "GPU Debug Layers: Allow multiple layer apps" into qt-dev 2019-04-10 21:38:31 +00:00
Nicolas Geoffray
5e05627687 Merge "Disable USAP when running in jitzygote mode." into qt-dev 2019-04-10 21:23:08 +00:00
Peiyong Lin
9eee3f956e [GraphicsEnvironment] Expose API to query whether an app should use game driver.
Game Driver and ANGLE require to disable graphics driver preloading, which
results in app launch time regression. Given that in early stage, only a few
applications will use them, we would like to make sure Zygote prefork comes
with a preloaded graphics driver, such that applications that don't go through
ANGLE or Game Driver can directly use Zygote prefork without having to load the
driver.

BUG: 130029351
Test: Verify with testing applications.
Change-Id: I8097f0f7a908be9967b08afb01dc0ce5ff7b3413
2019-04-10 13:23:13 -07:00
Alexey Kuzmin
a2112a3095 Add fallback for TEXTURE_TICK
TEXTURE_TICK vibration effect should fallback to TICK effect if not
supported by HAL (and, if necessary, fallback further to TICK effect
fallback)
Bug: 129275029
Test: atest VibrationEffectTest
Test: adb cmd vibrator prebaked 21 on a phone which does not support
TEXTURE_TICK - you should feel the device vibrates

Change-Id: I788b0835312e2b2ab590c26ef2f9961fe542cf77
(cherry picked from commit bebf04aaaf)
2019-04-10 17:49:55 +00:00
Cody Northrop
f959f6b5aa GPU Debug Layers: Allow multiple layer apps
This allows applications to specify both a GLES layer app and a
Vulkan layer app, so both APIs can be debugged at the same time.

To specify multiple debug layer apps, colon separate them just
like the layers:

  adb shell settings put global gpu_debug_layer_app app1:app2:appN

Bug: 110883880
Test: atest CtsGpuToolsHostTestCases
Change-Id: I5f721b7d9de59577adb6cc03e909ff99ca79d75e
2019-04-10 11:02:28 -06:00
Jeff Sharkey
586d3c013a Split VOLUME_EXTERNAL and VOLUME_PRIMARY.
To let developers focus on specific concrete storage devices in Q,
we need a volume name that can be used to point at the primary
external storage device.  We had been using VOLUME_EXTERNAL for that,
but we've heard that certain apps are making deep assumptions that
media item IDs are globally unique across all volumes.

Thus these changes merge all volumes back into a single underlying
database, and VOLUME_EXTERNAL works with all of the currently
attached volumes.  The new VOLUME_PRIMARY name can be used to focus
on the primary storage device when desired.

When developers try inserting items directly into VOLUME_EXTERNAL,
we gracefully assume they meant VOLUME_PRIMARY.

Bug: 128451765
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: I682ff6e9aaab4f5315a46c9825313a438548c7e6
2019-04-10 09:35:14 -06:00
Nicolas Geoffray
fd00e94dd1 Disable USAP when running in jitzygote mode.
The feature needs to be tweaked for it, and currently
regresses app startup.

Test: build jitzygote config, check there is no usap processes
Bug: 119800099
Change-Id: Ic33c539636f206da72d6d0cc51219e8d2dfe23dc
2019-04-10 14:58:17 +01:00
TreeHugger Robot
41b582936f Merge "Don't use noteop for preflight checks" into qt-dev 2019-04-09 20:29:24 +00:00
Chad Brubaker
45810afbea Don't use noteop for preflight checks
Test: apps don't show as accessing location on start
Fixes: 130187488
Change-Id: Iacd7edbadab64f43229b5d6f8056bb076c4f280c
2019-04-09 11:18:28 -07:00