Commit Graph

5644 Commits

Author SHA1 Message Date
Jeffrey Vander Stoep
60871d841d Merge "Add ConnectivityManager.getConnectionOwnerUid()" am: f8529dc891 am: 6729107f22
am: 904252f7a3

Change-Id: I8b8f6e74abc47f94231f3b9a1ab0db1ad0903a10
2018-09-21 15:36:28 -07:00
Jeffrey Vander Stoep
904252f7a3 Merge "Add ConnectivityManager.getConnectionOwnerUid()" am: f8529dc891
am: 6729107f22

Change-Id: I4ec4b9a8954deec001841566e0722caa1a3fa248
2018-09-21 14:48:32 -07:00
Tianjie Xu
58e024b33e Merge "Remove the metrics report in recovery system" am: aff3248507 am: 8deaf75cfd
am: acae1964ed

Change-Id: I9b61608bb34fd5658dcb2893296a04cdf4a98006
2018-09-21 14:12:30 -07:00
Jeffrey Vander Stoep
f8529dc891 Merge "Add ConnectivityManager.getConnectionOwnerUid()" 2018-09-21 21:04:20 +00:00
Jeff Vander Stoep
0ac2c0945b Add ConnectivityManager.getConnectionOwnerUid()
Allow VPN apps to lookup the UID owner of a network connection.

Requires specifying the:
 - IP address and port for both the source and destination of a TCP
   connection.
 - IP address and port for either source and destination or just
   source for a UDP connection.
Only TCP and UDP protocols are supported. Only connections for UIDs
that apply to the calling VPN app will be resolved. This is intended
to replace direct app access to /proc/net/{tcp,tcp6,udp,udp6}.

The implementation uses netlink inet_diag sockets[1] to perform
the lookup on TCP sockets as well as UDP sockets when supported
(kernel has CONFIG_INET_UDP_DIAG=y).

[1] http://man7.org/linux/man-pages/man7/sock_diag.7.html

Bug: 9496886
Bug: 109758967
Test: atest HostsideVpnTests
Test: atest InetDiagSocketTest on Taimen with CONFIG_INET_UDP_DIAG
    and on Sailfish without CONFIG_INET_UDP_DIAG.
Change-Id: I2bbc7072dd091e2e653dadf6dc05024c04180f34
2018-09-21 06:16:09 +00:00
Tianjie Xu
acae1964ed Merge "Remove the metrics report in recovery system" am: aff3248507
am: 8deaf75cfd

Change-Id: Id480a047be0799d6afc7cda472b6d4e00b48ec48
2018-09-20 23:01:09 -07:00
Tianjie Xu
aff3248507 Merge "Remove the metrics report in recovery system" 2018-09-20 17:39:36 +00:00
Marcin Oczeretko
ec7587283f Add work source uid collection to LooperStats
Add ThreadLocalWorkSourceUid and Message.workSourceUid
which will store the UID which caused, directly or
indirectly, the Message to be enqueued.

This was needed because using Binder.getCallingUid() does
not give us enough data since quite a few Binder services
call Binder.clearCallingIdentity() when processing the
call.

Test: UT and manual
Change-Id: I35af3a9ca5193477070990b41ff5d9c52f420069
2018-09-20 10:52:08 +01:00
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
Tianjie Xu
d12e150f7a Remove the metrics report in recovery system
Move the report for non-A/B metrics to the native code in
recovery-persist. We will also handle the report of sideload
status for all devices there.

Bug: 114278989
Test: check the metrics report from recovery-persist.
Change-Id: I856f2f301a9d42979d0b207294cdf5d51d7e1e3f
2018-09-07 17:05:43 -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