Commit Graph

5915 Commits

Author SHA1 Message Date
Peiyong Lin
3a1be746c0 [GUP] Hard code the name of the whitelist file.
Allowing customized whitelist filename could result in inconsistency and
fragmentations in toolings.

BUG: 120870520
Test: Build, flash and boot
Change-Id: Ibe9337b358b6a67600048f1661d73574d7bea607
2019-01-02 17:46:55 -08:00
Mathew Inwood
31755f94e1 Limit access to suspected false positives.
Members modified herein are suspected to be false positives: i.e. things
that were added to the greylist in P, but subsequent data analysis
suggests that they are not, in fact, used after all.

Add a maxTargetSdk=P to these APIs. This is lower-risk that simply
removing these things from the greylist, as none of out data sources are
perfect nor complete.

For APIs that are not supported yet by annotations, move them to
hiddenapi-greylist-max-p.txt instead which has the same effect.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: I020a9c09672ebcae64c5357abc4993e07e744687
2018-12-28 11:50:04 +00:00
Remi NGUYEN VAN
708c409598 Merge "Add NetworkStack app" am: d01eaecbd2 am: e1922923fc
am: 5673820f9b

Change-Id: Idcd7b9b6eb50a98bcee67f89b0112b91cd1b40fb
2018-12-25 17:21:18 -08:00
Remi NGUYEN VAN
5673820f9b Merge "Add NetworkStack app" am: d01eaecbd2
am: e1922923fc

Change-Id: Iebe5aa5ea7cd235b8a6e734bde0f9a14dce5acdc
2018-12-25 17:09:42 -08:00
Remi NGUYEN VAN
c094a5402c Add NetworkStack app
The app is not started yet, and does not contain any service for now.

Test: built, booted
Bug: b/112869080
Change-Id: Id5a0fd02c891100e85d86b1040e53beec3581950
2018-12-25 11:42:42 +09:00
Tim Van Patten
6a297058eb Merge "Refactor for Better Resource Management" 2018-12-20 19:28:23 +00:00
TreeHugger Robot
7fa78c545b Merge "Add StorageVolume#createOpenDocumentTreeIntent" 2018-12-20 15:49:11 +00:00
Tim Van Patten
a7577bfa7a Refactor for Better Resource Management
The GraphicsEnvironment/GraphicsEnv code is being refactored to allow
for better resource management related to open files and file
descriptors and reducing the amount of times the rules files are parsed.

This is also laying the groundwork for other modules to query if ANGLE
will be loaded or not, for example to display a dialog box to the user
when ANGLE is selected for an app.

Bug: 120910315
Test: Verify CtsAngleIntegrationHostTestCases passes.
Change-Id: Iedd4e8cd3c79c6656bc824def228213f76ef9849
2018-12-20 15:47:09 +00:00
Tim Van Patten
e8a25e3dbc Merge "Use intent-filter to enforce that only a single ANGLE APK is present" 2018-12-19 21:00:23 +00:00
TreeHugger Robot
3a84b83f27 Merge "ParcelFileDescriptor: updates for O_CLOEXEC (API >= Q)" 2018-12-19 00:49:35 +00:00
Nick Kralevich
0c48b94e61 ParcelFileDescriptor: updates for O_CLOEXEC (API >= Q)
For apps which target Q or above, add the O_CLOEXEC flags to
ParcelFileDescriptors.

O_CLOEXEC is essential for ensuring that file descriptors do not leak
across an exec() boundary. Setting O_CLOEXEC ensures that file
descriptors can't linger around unnecessarily in an exec()ed process
which doesn't use them, making more efficient use of resources.
Additionally, O_CLOEXEC is important in ensuring that untrusted
exec()ed code cannot take advantage of leaked file descriptors.

Test: Android compiles and boots
Bug: 120983106
Change-Id: Idb3eb8f0e43968396a3b3a8bddc26a8d94c55bde
2018-12-18 14:46:20 -08:00
Jeff Sharkey
0b6adaab7a Merge "Snapshot isolated storage feature flag at boot." 2018-12-18 20:23:44 +00:00
Nick Kralevich
8190c6b625 Merge "NativeHandle.java: dup() with O_CLOEXEC" am: 760e074e50 am: d5a101dd7f
am: 558bf26377

Change-Id: I0b26064af01eae55df2717b9b71bf37026b2161a
2018-12-18 12:21:08 -08:00
Nick Kralevich
558bf26377 Merge "NativeHandle.java: dup() with O_CLOEXEC" am: 760e074e50
am: d5a101dd7f

Change-Id: If4b615a9a2d35d4f9c294bffa470fe6aed90a9f6
2018-12-18 11:46:53 -08:00
Ken Chen
21afd86c39 Merge "Remove 'hasDns' parameter" am: 3176e8be7a am: c7af83f4ff
am: d8dec0ca80

Change-Id: Id10bcc14ad837b8a358e8be70f36a6cfc94620ab
2018-12-18 11:08:50 -08:00
Ken Chen
d8dec0ca80 Merge "Remove 'hasDns' parameter" am: 3176e8be7a
am: c7af83f4ff

Change-Id: I43080dc7922ab6b8b1c61f7a2542dd8cead45bc5
2018-12-18 10:50:11 -08:00
Treehugger Robot
760e074e50 Merge "NativeHandle.java: dup() with O_CLOEXEC" 2018-12-18 18:36:35 +00:00
Jeff Sharkey
342b4bf3c7 Snapshot isolated storage feature flag at boot.
The currently requested feature flag value may lag behind what's
actually active for the current boot, so take a snapshot of the value
that's being used for the current boot.

Bug: 121195267
Test: manual
Change-Id: I969f1d9d385e7610b366df41d2c7728a596d114c
2018-12-18 11:34:39 -07:00
Amin Shaikh
305e87e6d9 Add StorageVolume#createOpenDocumentTreeIntent
Change-Id: I6894bad24fa7757dee1028a31ba0b07701baa7b3
Fixes: 119519300
Test: manually using ApiDemos Content > Storage > Documents
2018-12-18 11:44:13 -05:00
Ken Chen
3176e8be7a Merge "Remove 'hasDns' parameter" 2018-12-18 11:17:27 +00:00
Nick Kralevich
1de009645c NativeHandle.java: dup() with O_CLOEXEC
Don't use Os.dup(), as it creates file handles which leak across exec()
boundaries. Instead, use fcntl(F_DUPFD_CLOEXEC);

O_CLOEXEC is essential for ensuring that file descriptors do not leak
across an exec() boundary. Setting O_CLOEXEC ensures that file
descriptors can't linger around unnecessarily in an exec()ed process
which doesn't use them, making more efficient use of resources.
Additionally, O_CLOEXEC is important in ensuring that untrusted
exec()ed code cannot take advantage of leaked file descriptors.

Test: Android compiles and boots
Bug: 120983106
Change-Id: I99a66834cc6b9bb25e1b4daf75384ec6a91ae9e2
2018-12-17 14:48:35 -08:00
Nick Kralevich
52671a787b FileUtils.java: Don't treat open access modes as flags
O_RDONLY, O_WRONLY, and O_RDWR are not flags. Rather, they are the
integer values 0, 1, and 2, respectively.

  #define O_RDONLY 00000000
  #define O_WRONLY 00000001
  #define O_RDWR 00000002

Quoting "man 2 open"

  * File access mode *

  Unlike  the  other  values  that  can  be  specified in flags,
  the access mode values O_RDONLY, O_WRONLY, and O_RDWR do not
  specify individual bits.  Rather, they define the low order
  two bits of flags, and are defined respectively as 0, 1, and
  2. In other words, the combination O_RDONLY | O_WRONLY is a
  logical error, and certainly does not have the same meaning
  as O_RDWR.

  Linux reserves the special, nonstandard access mode 3
  (binary 11) in flags to mean: check for read and write
  permission on the file and return a file descriptor that
  can't be used for reading or writing. This nonstandard access
  mode is used by some Linux drivers to return a file
  descriptor that is to be used only for device-specific
  ioctl(2) operations.

Rather than treat these values like flags, use O_ACCMODE to extract the
values and then perform the comparisons.

Introduced in 63280e06fc.

Test: android compiles and boots.
Change-Id: I4d3185e835615ffba3a7854d3d58351e124599d0
2018-12-17 13:24:46 -08:00
Tim Van Patten
5e3e2ae828 Use intent-filter to enforce that only a single ANGLE APK is present
In order to support multiple ANGLE builds (Google-signed,
AOSP unsigned, OEM-signed), we will use intent-filter to
indicate that ANGLE is installed.   During CTS testing,
we will verify that only a single ANGLE is installed and
provides the necessary functionality.

Bug: 120487920
Test: Verify ANGLE CTS hostside tests pass.
Change-Id: If3491475e776e26b3656c377d2b28c0c8bb66da2
2018-12-17 16:29:55 +00:00
Jeff Sharkey
b0c363b21e Local and remote isolated storage feature flags.
Moving forward as we start enabling isolated storage in various
dogfood groups, we'll need to maintain separate values for the
feature flag for both "local" and "remote" opinions.  Any strongly
expressed local opinion will always take precidence over any remote
opinion.

Any changes to these feature flags means that we need to invalidate
any PackageManager parsed APKs, since PackageParser changes it's
output depending on the flag state.  Since other feature flags are
likely to need this type of invalidation in the future, define the
PackageManager cache using a SHA-1 hash of a collection of values
that should invalidate the cache.

Bug: 112545973
Test: atest android.os.SystemPropertiesTest
Change-Id: Ifafcdf15e40e694eb4126e06981aeb82df51da33
2018-12-15 18:07:01 -07:00
Inseob Kim
ccc7473fb5 Schematize vold system properties
am: 0a91222c83

Change-Id: I3462d493bf88d7a435573659af9d8fa2062723b0
2018-12-13 16:14:18 -08:00
TreeHugger Robot
21a878c08c Merge "BatteryStats: NETWORK_TYPE_NR support" 2018-12-14 00:10:49 +00:00
Inseob Kim
0a91222c83 Schematize vold system properties
Properties accessed across partitions are now schematized and will
become APIs to make explicit interfaces among partitions.

Bug: 117924132
Test: m -j
Change-Id: I8e04f643197b6c8a60cc38c6979e41c5de3469f5
Merged-In: Iedfd3c1dda665006ea5410ee787c3ca447ac7db1
(cherry picked from commit c1246e6c36)
2018-12-13 15:35:34 -08:00
Andrew Solovay
d788835735 Merge "docs: Fixing malformed @links" into pi-dev am: 39f74d5732
am: b2ad787a44

Change-Id: I6064f1fdeb3e55ccca760de6c3bb42c1a4621298
2018-12-13 11:34:21 -08:00
Andrew Solovay
b2ad787a44 Merge "docs: Fixing malformed @links" into pi-dev
am: 39f74d5732

Change-Id: Iaf4fefbba3e1e76b348923ba9501107b2439ac1a
2018-12-13 09:35:03 -08:00
Jeff Sharkey
95268aeb69 Merge "Create a new mount mode for installer packages." 2018-12-13 16:16:44 +00:00
Olivier Gaillard
f2aff2c42c Merge "Make work source APIs visible to system apps." 2018-12-13 09:04:25 +00:00
Sudheer Shanka
3a0df3bc33 Create a new mount mode for installer packages.
New external storage mount mode for installers so
that they can access obb dirs of all apps.

Bug: 111789719
Test: atest android.appsecurity.cts#testExternalStorageObbGifts
Change-Id: Ifab3c0702a431d542a6a3ae82ca8b67d9fcd7506
2018-12-12 22:53:46 -08:00
Treehugger Robot
a32f898720 Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master" 2018-12-13 05:45:20 +00:00
Bookatz
df6baff603 BatteryStats: NETWORK_TYPE_NR support
NETWORK_TYPE_NR was added in ag/5629764.
This cl adds this new type to the human-readable dump output and ensures
that new network types won't crash the dumpsys (instead they'll print
ERROR).

Bug: 120778989
Test: android.dumpsys.cts.BatteryStatsDumpsysTest#testBatterystatsOutput
Change-Id: I9a6b966ca961bde37eadd924ce3ba0166a943ff8
2018-12-12 19:38:11 -08:00
TreeHugger Robot
5efe0430ef Merge "Use Bundle to access Global.Settings values" 2018-12-13 02:37:04 +00:00
Andrew Solovay
8a788f4094 docs: Fixing malformed @links
Several @link javadoc directives were malformed, resulting in the
Javadoc code being output to the HTML.

Staged to:

http://go/dac-stage/reference/android/app/Activity
http://go/dac-stage/reference/android/app/RemoteInput
http://go/dac-stage/android/os/UserManager

Bug: 120743732
Test: make ds-docs
Change-Id: I2c00c7e1e3adcff696e6d000206aeeaea61e7ecd
Exempt-From-Owner-Approval: Doc-only change
2018-12-12 16:36:14 -08:00
Tim Van Patten
ff9476be4c Use Bundle to access Global.Settings values
While making the Developer Options changes, the app startup time was
increased due to reading the Global.Settings values incorrectly. As Cody
had already determined, we need to use the Bundle.getString() values,
rather than reading them from the Context. This change re-introduces
that fix.

Based on b/120784945, I'm looking at the 'bindApplication' values that's
output from the following test:

$ atest -it google/perf/app-startup/benchmark-app-hermetic/cold-dropcache-test --verbose

Without this fix:
  bindApplication: 22.67
  bindApplication: 21.47
  bindApplication: 19.40

With this fix:
  bindApplication: 16.67
  bindApplication: 16.33
  bindApplication: 16.67

Based on the above values, this appears to recover the missing time.

Bug: 120784945
Test: Verify app startup time is reduced.
Test: Verify ANGLE can still be enabled/disabled with the
Global.Settings values.
Test: Verify CtsAngleIntegrationHostTestCases passes.

Change-Id: I0435702c3708c8566e94673dd3a2a40eb8253052
2018-12-12 12:15:29 -07:00
Adrian Roos
d4f9f9f666 Merge "API: Clean up redundant and ineffective usages of SystemApi and TestApi" am: af0e1c2fa5
am: 963172ac83

Change-Id: I2251db66ef73d5b69c84b4e83f2788d2bc953eda
2018-12-12 08:44:43 -08:00
Adrian Roos
963172ac83 Merge "API: Clean up redundant and ineffective usages of SystemApi and TestApi"
am: af0e1c2fa5

Change-Id: I016cacee1e1de6c7a8269fc3605ed25716598d9e
2018-12-12 08:33:17 -08:00
Adrian Roos
6115769c16 API: Clean up redundant and ineffective usages of SystemApi and TestApi
Everything that is marked SystemApi or TestApi, but not @hide is still
part of the public SDK, it is therefore not sound to have that combination.

In the future, specifing such a combination will be considered an error
to prevent inadvertently exposing SystemApi and TestApi as public API.

Bug: 115333477
Change-Id: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Merged-In: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Test: METALAVA_PREPEND_ARGS="--error UnhiddenSystemApi" m checkapi
Exempt-From-Owner-Approval: API cleanup
2018-12-12 15:02:26 +01:00
Adrian Roos
e77ff79fdb Merge "API: Clean up redundant and ineffective usages of SystemApi and TestApi" 2018-12-12 13:43:34 +00:00
Olivier Gaillard
6dfdcf4334 Make work source APIs visible to system apps.
- Adds @SystemApi to the work source apis. Work source will help us to
better understand who is responsible for resources usage (starting with
cpu usage)
- Adds @SystemApi to the transact listener to allow system apps to
intercept outgoing transactions in order to the set work source.

Bug: 111534779
Test: n/a - just adding annotations
Change-Id: Ie86696228bb9df57f640b978a1d78439c99626d3
2018-12-12 10:29:05 +00:00
Lorenzo Colitti
9dfc3c1b45 Merge changes from topic "netd-event-listener-aidl" am: 481251a0c2 am: 379029671a
am: 94cffb3a6c

Change-Id: I2b30cac46eb96e3a0425088f516176ce5ac4fd28
2018-12-11 23:13:42 -08:00
Lorenzo Colitti
94cffb3a6c Merge changes from topic "netd-event-listener-aidl" am: 481251a0c2
am: 379029671a

Change-Id: Ib7997a04d767635952c72c41096d6d500edf2c49
2018-12-11 23:04:16 -08:00
Lorenzo Colitti
379029671a Merge changes from topic "netd-event-listener-aidl"
am: 481251a0c2

Change-Id: I6ee2f333c2d68c8542070f48ffac83d38e36d217
2018-12-11 22:55:00 -08:00
Lorenzo Colitti
481251a0c2 Merge changes from topic "netd-event-listener-aidl"
* changes:
  Depend on the stable AIDL version of the netd metrics interface.
  Delete INetworkManagementService#getNetdService.
2018-12-12 06:17:25 +00:00
Jeff Sharkey
4b773c909a Merge "Calculate MediaColumns.HASH when demanded." 2018-12-11 22:55:14 +00:00
Xin Li
15b123ef45 DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master
Bug: 120502534
Change-Id: Idc8bfb6d97a869b76cfb87ca1a494201baf9e8bd
2018-12-11 14:13:44 -08:00
TreeHugger Robot
b73bb94aeb Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into stage-aosp-master" into stage-aosp-master 2018-12-11 21:49:22 +00:00
Adrian Roos
66f859135b API: Clean up redundant and ineffective usages of SystemApi and TestApi
Everything that is marked SystemApi or TestApi, but not @hide is still
part of the public SDK, it is therefore not sound to have that combination.

In the future, specifing such a combination will be considered an error
to prevent inadvertently exposing SystemApi and TestApi as public API.

Bug: 115333477
Change-Id: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Test: METALAVA_PREPEND_ARGS="--error UnhiddenSystemApi" m checkapi
Exempt-From-Owner-Approval: API cleanup
2018-12-11 20:38:02 +01:00