Commit Graph

6006 Commits

Author SHA1 Message Date
Denny cy Lee
c5a7c29581 DeviceIdle: Support aggressive/unaggressive doze mode
Test: atest com.android.server.DeviceIdleControllerTest
Bug: 121167278
Change-Id: I3bc645a23a6a93e120f12a9a3fa5cf038fa6ca8f
2019-01-23 09:51:37 +00:00
Jeff Sharkey
8a83ae1069 Merge "Sanity check raw paths against requested volume." 2019-01-23 05:47:17 +00:00
TreeHugger Robot
e54b7b5498 Merge changes I4054d6f4,Ib14e9a93,Iafbe6d51
* changes:
  CpuStats - Do not write debug entries to dump output
  Set ThreadLocalWorkSource when delivering Alarms
  Add WorkSource.getAttributionUid()
2019-01-22 23:14:25 +00:00
TreeHugger Robot
c797867220 Merge "Update HandlerThread's javadoc" 2019-01-22 21:10:37 +00:00
Jeff Sharkey
3f64ec57dd Sanity check raw paths against requested volume.
When callers are inserting or updating raw "_data" paths, we need to
sanity check them to make sure they're not "crossing the streams"
between storage devices.  For example, it would be really broken to
insert a file on the SD card into the "internal" storage volume.

This also enforces that callers don't "cross the streams" between
multiple storage volumes on devices that support them, since
otherwise they'd end up with very confusing behavior, such as
the same underlying file being inserted into multiple databases.

Also, the "internal" storage volume should really only be used for
common media (such as ringtones), and it shouldn't be allowed to
point into private app data directories, since MODE_WORLD_READABLE
has been deprecated for many years now.

Bug: 117932814
Test: atest MediaProviderTests
Test: atest cts/tests/tests/media/src/android/media/cts/MediaScanner*
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I267eacd45bbd270b8ce9b28de9d6e209f780f31a
2019-01-22 13:55:25 -07:00
Eugene Susla
6f210eeede Update HandlerThread's javadoc
Addresses concerns in b/63382879

Fixes: 63382879
Test: proofread
Change-Id: I4aaf543df86123d46b708f35c80c04df0f737989
2019-01-22 10:40:46 -08:00
Marcin Oczeretko
5329540c39 Add WorkSource.getAttributionUid()
Bug: 119802232
Test: atest WorkSourceTest
Change-Id: Iafbe6d516b93315f58466385c2dc2031073d8573
2019-01-22 18:26:42 +00:00
Remi NGUYEN VAN
7aa9b885c3 Merge "Expose UIDs for NetworkStack permission checks" am: 3b887bdf4a am: 29515d751b
am: f10038e9ca

Change-Id: I4156471eec78511fd86a1c381d53df57b1f4ea98
2019-01-22 06:13:46 -08:00
Remi NGUYEN VAN
f10038e9ca Merge "Expose UIDs for NetworkStack permission checks" am: 3b887bdf4a
am: 29515d751b

Change-Id: Ia9bc41cebf048d536efa8aeea992fed3f583ba1b
2019-01-22 06:04:32 -08:00
Remi NGUYEN VAN
3b887bdf4a Merge "Expose UIDs for NetworkStack permission checks" 2019-01-22 13:40:57 +00:00
Remi NGUYEN VAN
b809148b9a Merge changes Ieef54d84,Ica3e88c2 am: 491f53523a am: 8e4ce11318
am: c904972acd

Change-Id: Idcc18b95951c566335431a493ed7b9d49477a4c0
2019-01-22 05:32:01 -08:00
Remi NGUYEN VAN
c904972acd Merge changes Ieef54d84,Ica3e88c2 am: 491f53523a
am: 8e4ce11318

Change-Id: I33fc6ee4cf47676dc2a4a9369dd3fc053dba34ec
2019-01-22 05:22:30 -08:00
Remi NGUYEN VAN
0d81df94cd Expose UIDs for NetworkStack permission checks
The UIDs are unlikely to change and added as public API.

Test: m
Bug: 112869080
Change-Id: I5477093a4c8593dd9ada7587b86c65352e628c34
2019-01-22 20:44:06 +09:00
Lorenzo Colitti
a27da72cd1 Expose ServiceSpecificException as @SystemApi.
This class is useful as a system API because:

- It is one of the few exceptions that is natively Parcelable.
- It is directly supported by native code without using JNI,
  using Status::fromServiceSpecificError.
- Unlike other natively parcelable exceptions, it contains both
  an error message and an error code.

Test: m
Bug: 112869080
Change-Id: Ica3e88c2b6877e429a61b053d75f69b9f19fc74a
2019-01-22 18:44:12 +09:00
Sudheer Shanka
7461df211d Merge "Create a new MOUNT_EXTERNAL_LEGACY storage mode." 2019-01-19 18:04:40 +00:00
Nandana Dutt
e0546e6b12 Merge "Pass in calling UID and package to dumpstate" am: bc6e433ae4 am: ae97716377
am: ec3ce57698

Change-Id: I70d120ed5666322fa75646c05c12a6dfd51ed1f3
2019-01-19 06:24:23 -08:00
Nandana Dutt
ec3ce57698 Merge "Pass in calling UID and package to dumpstate" am: bc6e433ae4
am: ae97716377

Change-Id: Ie1126fb68184c7789fe969b008ee1550d4424809
2019-01-19 06:11:19 -08:00
Sudheer Shanka
0b6da5362d Create a new MOUNT_EXTERNAL_LEGACY storage mode.
Apps that are already installed on the device before isolated_storage
feature is enabled will be granted MOUNT_EXTERNAL_LEGACY mode. In this
mode, /mnt/runtime/write will be mounted at /storage giving them same
level of access as in P.

A new mount directory /mnt/runtime/full is also created which will be
used for mounting at /storage for apps started with MOUNT_EXTERNAL_FULL
mode. This will allow apps with WRITE_MEDIA_STORAGE permission to
read/write anywhere on the secondary devices without needing to bypass
sdcardfs.

Bug: 121277410
Test: manual
Test: atest android.appsecurity.cts.ExternalStorageHostTest
Change-Id: I4ec73276d7c586ae4afc482580d1eb8ee03d5be1
2019-01-18 18:48:55 -08:00
TreeHugger Robot
d839beae5b Merge "Make security warning on contains() more obvious." 2019-01-18 22:33:42 +00:00
TreeHugger Robot
b128866274 Merge "Prepare setresuid()/setresgid() seccomp filter in AppZygote." 2019-01-18 22:10:09 +00:00
Alan Stokes
2a7f8e6a32 Make security warning on contains() more obvious.
The dire warning about canonicalising paths before calling
FileUtils#contains was present on two overloads but not the
third. Added it there to try to make it harder to miss.

Test: Builds.
Change-Id: I983fe86e57ff3f7052f4f5d55f2bbd9e5740429a
2019-01-18 17:07:07 +00:00
Martijn Coenen
86f08a5190 Prepare setresuid()/setresgid() seccomp filter in AppZygote.
The application zygote can run untrusted user code; since it also
has the capability to change the uid/gid of the process, we need
to ensure that any changes to the uid and/or gid stay within the
range that we have allocated for this application zygote.

For application zygotes, we install the app_zygote seccomp
filter instead of the regular app filter; the only difference
between this filter and the app one is that it allows
setuid/setgid calls.

To further limit this, pass down the allocated UID range to the
Zygote itself, which in turn installs an additional seccomp
filter that restricts setuid/setgid calls to this range.

The actual calls into seccomp are commented out until the seccomp
changes are merged; to avoid catastrophe, this will leave the
regular app filter for the app_zygote, which is more restrictive
and doesn't allow setuid at all.

Bug: 111434506
Test: atest CtsSeccompHostTestCases passes
Change-Id: I112419629f5ee4774ccbf77e2b1cfa5ddcf77e73
2019-01-18 16:37:09 +01:00
Yifan Hong
e331390d1f Merge "Add VintfObject / VintfRuntimeInfo methods to TestApi." 2019-01-17 23:44:46 +00:00
Yifan Hong
5857870774 Add VintfObject / VintfRuntimeInfo methods to TestApi.
Add methods used by VintfDeviceInfo, a CTS test, to TestApi.
Also remove them from greylist.

Bug: 111610941
Test: builds

Change-Id: Ieccf8c9225132fd604d7df0fc7e9976f63f9077c
2019-01-17 12:11:04 -08:00
Nandana Dutt
161a44616c Pass in calling UID and package to dumpstate
BUG: 111441001
Test: builds
Change-Id: Ib623f6d4f50b81f331131cf3fda92fe2526dd6c7
2019-01-17 16:15:27 +00:00
Tim Van Patten
df1f806cdd Merge "Enhance Logging When Skipping Loading Temp Rules" 2019-01-17 15:49:55 +00:00
Yiwei Zhang
c631eeadd6 Merge "GUP: Add a global property for genreal preference" 2019-01-17 02:02:44 +00:00
Nandana Dutt
2a7be974fc Merge "BugreportAPI : Connect listener to binder callbacks" am: 4fefbddead am: 7b5f8817ce
am: 3a26a0bd5d

Change-Id: Iad0274d6ae8bf76475f1852a1d202a9df83c661d
2019-01-16 08:59:55 -08:00
Nandana Dutt
3a26a0bd5d Merge "BugreportAPI : Connect listener to binder callbacks" am: 4fefbddead
am: 7b5f8817ce

Change-Id: I5e296f6780569fe838e388962e1d0e2affd50aad
2019-01-16 08:44:27 -08:00
Treehugger Robot
4fefbddead Merge "BugreportAPI : Connect listener to binder callbacks" 2019-01-16 16:24:15 +00:00
Lorenzo Colitti
3d375dbd97 Merge changes Iec53a9fd,Iac4cfe70 am: 29afcf0eb0 am: b0c74fb227
am: 333a70ebe5

Change-Id: Ie225d000aeafb4a0b1e3910967c619fd932f239f
2019-01-16 02:03:06 -08:00
Lorenzo Colitti
333a70ebe5 Merge changes Iec53a9fd,Iac4cfe70 am: 29afcf0eb0
am: b0c74fb227

Change-Id: I56af4e9a82f66e507d2360822af27a39e0fcb238
2019-01-16 01:51:38 -08:00
Lorenzo Colitti
29afcf0eb0 Merge changes Iec53a9fd,Iac4cfe70
* changes:
  Test parceling empty LinkProperties.
  Delete the clatd functions from NetworkManagementService.
2019-01-16 09:28:06 +00:00
Narayan Kamath
69b09b0b7b Merge "Build: Add PREVIEW_SDK_FINGERPRINT." 2019-01-16 09:14:47 +00:00
Steven Moreland
93b988e6ba Merge "HIDL stuff to TestApi." am: bc79587a85
am: e6883edf8a

Change-Id: I31b92b9c23f54d889bee4bc2d2d370b5ad3af303
2019-01-15 13:41:59 -08:00
Steven Moreland
bc79587a85 Merge "HIDL stuff to TestApi." 2019-01-15 21:15:34 +00:00
TreeHugger Robot
d08f18b455 Merge "Make some Process constants @TestApi." 2019-01-15 16:08:07 +00:00
Tim Van Patten
3df6643ad7 Enhance Logging When Skipping Loading Temp Rules
We only want to load a temporary rules file for processing if the
current app is debuggable or if adb is running as root.   The logic to
do this is a bit less than straightforward to read and we don't
currently log the values to help make it clearer (though we know they were
both 'false' to return early).   This change helps make the code a bit
easier to read and adds some logging that helps make reading the logs a
little easier too.

Bug: 122612037
Test: atest CtsAngleIntegrationHostTestCases
Change-Id: I38baf02ebdb847f9423a80a1093385903eda1686
2019-01-15 08:45:33 -07:00
Nandana Dutt
331f2e988e Merge "Add the new dumpstate listener methods to implementations" am: 55c2344bc5 am: 4524abd318
am: 0296c0cf26

Change-Id: I87243f66fb70de378d962ba5c180ca0a4c5e541b
2019-01-15 06:49:57 -08:00
Nandana Dutt
0296c0cf26 Merge "Add the new dumpstate listener methods to implementations" am: 55c2344bc5
am: 4524abd318

Change-Id: Icbfe6a1f810d61ae4ba92a8c2894b5e8a0d6a992
2019-01-15 06:36:21 -08:00
Nandana Dutt
55c2344bc5 Merge "Add the new dumpstate listener methods to implementations" 2019-01-15 14:12:28 +00:00
Narayan Kamath
b081e07980 Build: Add PREVIEW_SDK_FINGERPRINT.
Based on ro.build.version.preview_sdk_fingerprint, which is
generated by the build system based on the contents of the
public / system API fingerprint. This value helps implement
finer grained targeting of packages to preview releases.

Test: atest BuildTest; manual
Bug: 120439642

Change-Id: Ib2c28d96ea0fa2ed9a6be4c05580c164e39cdd9f
2019-01-15 13:41:18 +00:00
Nandana Dutt
c8c77bc043 BugreportAPI : Connect listener to binder callbacks
BUG: 111441001
Test: builds
Test: interactive bugreport still works
Change-Id: Ie3f2328f558bb2de1dec2908c6ab13f5a17df115
2019-01-15 12:51:42 +00:00
Lorenzo Colitti
9307ca2ba1 Delete the clatd functions from NetworkManagementService.
Make Nat464Xlat talk to netd directly instead of through
NetworkManagementService. The methods in NetworkmanagementService
don't really provide any value: since the only thing they do is
call into netd, we might as well have the callers talk to netd
directly,

In order to do this, pass INetworkManagementService and INetd to
the NetworkAgentInfo constructor, and update callers appropriately.

Bug: 65674744
Test: builds, boots
Test: atest FrameworksNetTests
Change-Id: Iac4cfe709c6279e4d9682b6754963e533707bd12
2019-01-15 11:13:07 +09:00
Steven Moreland
cbba4c7a49 HIDL stuff to TestApi.
Since the CTS test for android.os is build with test_current.

Bug: 78650449
Test: android.os.cts
Change-Id: If784f4949af931c6c4efc284f1d16414705fe2d4
2019-01-14 14:37:12 -08:00
Steven Moreland
14b9eb6b95 HIDL stuff to TestApi.
Since the CTS test for android.os is build with test_current.

Bug: 78650449
Test: android.os.cts
Change-Id: If784f4949af931c6c4efc284f1d16414705fe2d4
Merged-In: If784f4949af931c6c4efc284f1d16414705fe2d4
2019-01-14 22:36:09 +00:00
Nathan Harold
f54c392021 Add AIDL for ParcelableException am: d2715b7c70 am: 910a4c60ab
am: ef9221ee72

Change-Id: I9929f8d4891a1ee43eeb29f62a1741ae8c565587
2019-01-14 12:12:21 -08:00
Nathan Harold
ef9221ee72 Add AIDL for ParcelableException am: d2715b7c70
am: 910a4c60ab

Change-Id: I63931c149c87d1fb2161ca88379777ddc38f3348
2019-01-14 11:25:14 -08:00
Nathan Harold
910a4c60ab Add AIDL for ParcelableException
am: d2715b7c70

Change-Id: Ifeefb542f0d6fdcc3960401239552a6f0af85336
2019-01-14 10:31:33 -08:00
Nandana Dutt
432f8c7b86 Add the new dumpstate listener methods to implementations
Add dummy implementations for status, error and finished callbacks.
Next step: wire these up end-to-end; change Shell's listener to be
BugreportManager.BugreportListener, and make it communicate with the
native service explicitly through the new system api.

BUG: 111441001
Test: Verified progress in interactive bugreport still works
Change-Id: Iad0bb7b23b04f6bc7e3b31e5071df42409c78684
2019-01-14 17:55:27 +00:00