Commit Graph

5635 Commits

Author SHA1 Message Date
Chenjie Yu
12e5e6755f use custom Parcel format to pull data
When statsd pulls data from StatsCompanionService, the data is put into
log_msg format on java side and expanded into LogEvent on cpp side.
There is a lot of dependency on log_msg and liblog to add new types.
There is pending bug to rewrite thta part of the code in statsd to
completely rid the legacy of logd and liblog. But that may not happen
soon.

Now we can support new storage type.
Also no need to specify number of fields in StatsLogEventWrapper cstr,
which is a source of bug in P.

Bug: 115775035
Test: manual test and cts test
Change-Id: Id1f0b033885da6f3bcebe043968061821db48f35
2018-09-18 16:29:52 -07:00
Mathew Inwood
db0657a4f4 Merge "Move some members to the "Q blacklist"." 2018-09-14 13:54:28 +00:00
Mathew Inwood
8c854f86a4 Move some members to the "Q blacklist".
Based on some analysis, these fields/methods are likely false positives.
Set maxTargetSdk=P so that any apps using them are required to migrate off
them in future. See the bug for more details.

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: I719b5c94e5b1f4fa562dd5d655953422958ad37e
2018-09-14 13:18:34 +01:00
Jeff Sharkey
7da7681c6b Merge "Provide paths of interest to vendors." 2018-09-13 21:19:14 +00:00
Jeff Sharkey
e0339a6f6e Merge "Support more createPackageContextAsUser() users." 2018-09-13 20:08:57 +00:00
Jeff Sharkey
70eb34a23c Provide paths of interest to vendors.
Also update docs on path translation APIs, which are now no-ops.

Bug: 112159421
Test: none
Change-Id: I0912a6adb233b39f61728642fcefb83a74fa6662
2018-09-13 12:04:38 -06:00
Jeff Sharkey
8068dfe6be Merge "Utilities for content:// Uris and file modes." 2018-09-13 15:20:59 +00:00
kopriva
2c23a6b58d docs: fixed typo am: 9b5c03973e
am: 05f984a1a8

Change-Id: I8b70d412c1d422be5cbc8e041acc3fe340617181
2018-09-13 02:41:16 -07:00
kopriva
05f984a1a8 docs: fixed typo
am: 9b5c03973e

Change-Id: I8873ab4139dd3c073584a0ffaf67611c11dea084
2018-09-13 02:31:56 -07:00
Hui Yu
fc451f44dc Check Bundle length is aligned by 4 when readFromParcel.
Otherwise throw an IllegalStateException.
Fix: 26885514
Test: Make the bundle length not aligned by 4 and observe the IllegalStateException.

Change-Id: I57f0d5babdf1b8f1074eb2f4f76b71926db8b93c
2018-09-12 14:16:54 -07:00
Jeff Sharkey
ec5f7d1625 Support more createPackageContextAsUser() users.
We created this API to make it easy to pass a given UserHandle into
all Managers obtained from a given Context, which works great for
"normal" users, but we should also support special users like ALL
and CURRENT.

Also add an AutoCloseable marker to make try-with-resources easier.

Bug: 112153259
Test: atest android.content.cts.ContextTest
Change-Id: I261dfcc5cfdfc76bda5d70181785e11c2715a558
2018-09-12 14:02:11 -06:00
Jeff Sharkey
63280e06fc Utilities for content:// Uris and file modes.
Bug: 111268862, 111960973
Test: atest cts/tests/tests/content/src/android/content/cts/ContentUrisTest.java
Test: atest frameworks/base/core/tests/coretests/src/android/os/FileUtilsTest.java
Change-Id: I94373055468d279e6553d4a038267732b9b53745
2018-09-12 12:35:52 -06:00
Mike Ma
43908f112b Merge "Avoiding potential NPE when dumping to proto." am: a52b601ef3
am: 8964390dd3

Change-Id: Ie9dc401990b4267b9bcf0469a3526db93dc438d2
2018-09-11 18:47:58 -07:00
Sudheer Shanka
61585a8094 Merge "Add javadoc for package-name arg passed during the process start." 2018-09-11 19:53:06 +00:00
Kweku Adams
ce8e43f8d2 Avoiding potential NPE when dumping to proto.
Inspired by aosp/736453. Cherry-picked from ag/4934453

Bug: 113087610
Test: Android builds
Change-Id: I9f0dae9cd5a839947c7ed150980eb30b928beef7
2018-09-11 19:21:52 +00:00
kopriva
9b5c03973e docs: fixed typo
Test: make ds-docs

Bug: 36942287

Change-Id: I6931817127a7b98a4b97e0e18cf4d654231c32f9
Exempt-From-Owner-Approval: Docs-only change
2018-09-10 14:02:58 -07:00
Tej Singh
86dc9dba06 Revert "Revert "DiskStats Westworld Migration""
This reverts commit 6188aa3294.

Reason for revert: ag/4819964 has now been submitted. undoing the roll back.
Test: revert
Test: manually verified output is the same as diskstats.

Change-Id: I9a3292f66e1e28661e1d29f3befd002073b681c1
2018-09-06 10:32:01 -07:00
Michael Wachenschwanz
379daa98dd Merge changes from topic "am-bdb0270e-8295-4ee6-be36-2709e172d48f" into oc-dev am: d32c2a4189 am: 1f5050c054 am: 4fda414ed6
am: 78a2caeb94

Change-Id: Ie28836c6080238499bc218b2fb11597235e5b7a1
2018-09-05 20:59:25 -07:00
Michael Wachenschwanz
78a2caeb94 Merge changes from topic "am-bdb0270e-8295-4ee6-be36-2709e172d48f" into oc-dev am: d32c2a4189 am: 1f5050c054
am: 4fda414ed6

Change-Id: I7c7901f0147f7577240803cc2adc4e189f1994b4
2018-09-05 20:23:16 -07:00
Michael Wachenschwanz
4fda414ed6 Merge changes from topic "am-bdb0270e-8295-4ee6-be36-2709e172d48f" into oc-dev am: d32c2a4189
am: 1f5050c054

Change-Id: Ibae3dc08eabf5b12a8f1a03ea33bd54a28e0442e
2018-09-05 19:01:27 -07:00
Sudheer Shanka
d81b1d764b Add javadoc for package-name arg passed during the process start.
This was left out of earlier change which added the package-name arg.
Also, add @NonNull/@Nullable annotations to these arguments.

Bug: 111890351
Test: manual
Change-Id: I0e496172a95bfba432efc6f7f216eb1f0e951511
2018-09-05 18:56:38 -07:00
Michael Wachenschwanz
1f5050c054 Merge changes from topic "am-bdb0270e-8295-4ee6-be36-2709e172d48f" into oc-dev
am: d32c2a4189

Change-Id: Ie2ad590368e9c10f6222d9ae65470ebb12dabac2
2018-09-05 18:46:57 -07:00
Marcin Oczeretko
f1d4563acd Merge "Collect telemetry data for System Server Loopers." 2018-09-05 19:12:45 +00:00
TreeHugger Robot
73855d4071 Merge "Avoiding potential NPE when dumping to proto." 2018-09-05 01:11:26 +00:00
Kweku Adams
15afdebe38 Avoiding potential NPE when dumping to proto.
Inspired by http://aosp/736453.

Bug: 113087610
Test: Android builds
Change-Id: I9f0dae9cd5a839947c7ed150980eb30b928beef7
2018-09-04 11:57:34 -07:00
Marcin Oczeretko
d8cc8593c0 Collect telemetry data for System Server Loopers.
Adds LooperStats and LooperStatsService which set a static
Looper.Observer to record the count of dispatched messages and
cpu/latency information. The aggregated stats are collected by
Westworld as pulled atoms.

The collection is disabled by default and requires a manual call to
enable:

adb shell cmd looper_stats enable

Test: Unit tests and tested manually that the collected data seems
reasonable.

Change-Id: I7162fbca4e324f62887f95df3405205cbe4416ca
2018-09-03 16:06:06 +01:00
Android Build Merger (Role)
7cf42221c6 [automerger] Verify number of Map entries written to Parcel am: 057a01d1f3 am: d6947f1cbf am: 628cbe5c53 am: 433e4173ec am: 686897ddd9
Change-Id: I07c1d68a0c5d8da6ec81c717dff97d33dba86a16
2018-08-30 20:46:20 +00:00
Android Build Merger (Role)
686897ddd9 [automerger] Verify number of Map entries written to Parcel am: 057a01d1f3 am: d6947f1cbf am: 628cbe5c53 am: 433e4173ec
Change-Id: I8375f1c1a860f5021efc5873e94b452a44d6c145
2018-08-30 20:46:12 +00:00
Android Build Merger (Role)
628cbe5c53 [automerger] Verify number of Map entries written to Parcel am: 057a01d1f3 am: d6947f1cbf
Change-Id: Idaab5395d9e0970fe57b017bcba10f8757ffe3c7
2018-08-30 20:45:59 +00:00
Android Build Merger (Role)
d6947f1cbf [automerger] Verify number of Map entries written to Parcel am: 057a01d1f3
Change-Id: Idb2572b46c48fe2f3e4b99c5cb4372dcfe6b20ce
2018-08-30 20:45:51 +00:00
Michael Wachenschwanz
057a01d1f3 Verify number of Map entries written to Parcel
Make sure the number of entries written by Parcel#writeMapInternal
matches the size written. If a mismatch were allowed, an exploitable
scenario could occur where the data read from the Parcel would not
match the data written.

Fixes: 112859604
Test: cts-tradefed run cts -m CtsOsTestCases -t android.os.cts.ParcelTest

Change-Id: I325d08a8b66b6e80fe76501359c41b6656848607
Merged-In: I325d08a8b66b6e80fe76501359c41b6656848607
2018-08-30 13:40:44 -07:00
Philip P. Moltmann
4e615e6986 Factor some RestrictedLockUtils out of SettingLib
Also make the new lib only use system-apis.

This allows mainline module to use the new
RestrictedLockUtilsSettingLib.

Unfortunately the whole RestrictedLockUtils would have caused to much
new system-api. Hence it was split into RestrictedLockUtils and
RestrictedLockUtilsInternal. This caused a lot of trivial code changes.

Bug: 110953302
Test: Built
Change-Id: I693b3bf56f3be71f0790776e3aad5694717786ef
2018-08-30 11:59:29 -07:00
Mathew Inwood
a0c5ec60b3 Merge "Add @UnsupportedAppUsage annotations" am: 9137ecafbd
am: 2e5fdd0051

Change-Id: I217e9d2fbad18653d33a5a775047a5b0ffaba55d
2018-08-30 09:10:27 -07:00
Mathew Inwood
98e9ad1645 Add @UnsupportedAppUsage annotations
For all remaining unannotated code.

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I67c8b71ea535ebffb10bf577948bd4ccb8ca069d
2018-08-30 13:38:42 +01:00
Mathew Inwood
71da3a1fe4 Add @UnsupportedAppUsage annotations
For all remaining unannotated code.

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I32861fa341a08f11a9c50c07a1ef7404dadf6bb6
Merged-In: I67c8b71ea535ebffb10bf577948bd4ccb8ca069d
2018-08-30 13:38:01 +01:00
dwchen
057e5fe10d Merge "Fixes possible issue with no-op creator." into pi-dev am: f5411070a8
am: df80c8d7cc

Change-Id: Ifd6bf40dae3f49caa078b7cbce89b740395d6128
2018-08-29 15:45:20 -07:00
dwchen
df80c8d7cc Merge "Fixes possible issue with no-op creator." into pi-dev
am: f5411070a8

Change-Id: I29e126cdf7b4929a5ffd1fadafb3b93fc5ee8ca0
2018-08-29 15:35:43 -07:00
Michael Wachenschwanz
0ce807abd5 Merge "Verify number of Map entries written to Parcel" 2018-08-29 18:15:31 +00:00
Tej Singh
f156ea7353 Merge "Revert "DiskStats Westworld Migration"" 2018-08-29 17:15:17 +00:00
Tej Singh
6188aa3294 Revert "DiskStats Westworld Migration"
This reverts commit f154cf0189.

Reason for revert: Temporary rollback to allow ag/4819964 to go into pi-dev (and into master).

Change-Id: I607ec64aa9da3b0b1adf49bd361f9ed4927dba05
2018-08-29 00:21:07 +00:00
Jeff Sharkey
202a16ec96 Merge "More robust MTP-to-MIME-type mappings." 2018-08-28 20:51:37 +00:00
Jeff Sharkey
6324854fa0 Merge "Q." am: 20cc0ef048
am: 4c9108ca39

Change-Id: I6b1a9798e89ae68ce55229576a6eac84773356ce
2018-08-28 12:56:57 -07:00
Jeff Sharkey
3d80a7d36a Merge "Clean/destroy app shared storage via installd." 2018-08-28 19:37:19 +00:00
Jeff Sharkey
91e3cd4c6c More robust MTP-to-MIME-type mappings.
Recently in I830717428e72ac37c5ecd1f23d915aa878ef3744, we greatly
improved the underlying file-extension-to-MIME-type mappings defined
in libcore and used across the OS.

Instead of maintaining divergent mappings here in MediaFile, this
change delegates all file extension logic down to libcore, and
standardizes all MediaScanner internals on using MIME types.  To
register new file types in the future:

1. Add the MIME-to-extension registration in libcore.
2. Add the MIME-to-MTP mapping here in MediaFile.

This change also ensures that unknown MIME types are surfaced
across MTP, using constants like FORMAT_UNDEFINED_AUDIO for audio/*
until an explicit format is defined.

We now surface WMA/WMV file formats, even if the device can't
natively play them back, since we still want to offer the ability
for users to copy them around, and the user may have a third-party
app capable of playing them.

Keeps @UnsupportedAppUsage intact for now.

Bug: 111268862, 112162449
Test: atest frameworks/base/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaFileTest.java
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I2f6a5411bc215f776f00e0f9a4b7d825b10b377d
2018-08-28 13:02:35 -06:00
Sudheer Shanka
8e7cf05d27 Merge "Remove DefaultContainerService usage in StorageManagerService." 2018-08-28 18:01:24 +00:00
Jeff Sharkey
5c877634ae Q.
Clean cherry-pick of ag/4057716.

Bug: 77588754
Test: builds, boots
Change-Id: Ib1d993fe2949f480a350acfa7e2b3cfdc7abd257
Merged-In: Ib1d993fe2949f480a350acfa7e2b3cfdc7abd257
2018-08-28 17:51:35 +00:00
Sudheer Shanka
25469aacb8 Remove DefaultContainerService usage in StorageManagerService.
StorageManagerService uses DefaultContainerService to obtain ObbInfo
for files passed through mountObb() transaction. This change moves this
logic to client side and so ObbInfo will be passed as part of mountObb()
transaction.

Bug: 111838160
Test: atest src/android/os/storage/cts/StorageManagerTest.java
Test: atest core/tests/coretests/src/android/os/storage/StorageManagerIntegrationTest.java
Test: atest services/tests/servicestests/src/com/android/server/MountServiceTests.java
Change-Id: I29aee3aa54a45057df96aae289888161a3e3af71
2018-08-27 15:50:59 -07:00
Jeff Sharkey
4e7a765855 Clean/destroy app shared storage via installd.
In P we moved destroying per-user shared storage into installd,
where it can iterate quickly over large sets of files.  This change
now moves cleaning/destroying of per-app shared storage data down into
installd, letting us greatly simplify the logic in PMS to no longer
require spinning up DefaultContainerService.  This also fixes an
obscure bug where DCS (which always runs as USER_SYSTEM) wasn't able
to clear shared storage for secondary users.

This also gives us the ability to target specific storage devices
by UUID, such as when the user has migrated their primary shared
storage to an adopted device.

We no longer distinguish between keeping or deleting OBB files
during various operations, since upcoming changes in the Q release
will mean OBB files are no longer shared between users, and they'll
now live inside a sandbox that will be fully cleared when the user
clears data.  (Going forward, apps should be using splits instead
of OBBs, so they're effectively deprecated.)

Uses newer "const" feature of AIDL to ensure constant values remain
consistent between native and Java code.

Bug: 111854851, 111838160
Test: atest android.appsecurity.cts.StorageHostTest#testCache
Change-Id: Ib90be155718a768da76110fbfcf010a471b37378
2018-08-27 20:42:47 +00:00
Tej Singh
008ecd3de0 Merge "DiskStats Westworld Migration" 2018-08-27 18:58:06 +00:00
Dianne Hackborn
8c76d91bd2 Throttle requests to ActivityManager.getProcessMemoryInfo().
This is very expensive and needs to run in the system process, we
don't want apps abusing it.

Also don't allow apps to get information about anything but their
own process, unless they have the appropriate privileged permissions.

Bug: 112537519
Test: manual
Change-Id: I01997d6f888341e8eb2afe6a69545dd5be013744
2018-08-26 18:19:07 -07:00