Commit Graph

5992 Commits

Author SHA1 Message Date
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
Nathan Harold
360e25280c Merge changes from topic "cellinfocallback-error"
* changes:
  Add an onError() method to CellInfoCallback
  Add AIDL for ParcelableException
2019-01-14 17:50:39 +00:00
Kweku Adams
21909c112b Merge "Moving BatterySaverPolicy into batterysaver directory." 2019-01-11 19:41:14 +00:00
Svetoslav Ganov
9a788837ef Merge "Historical app ops." 2019-01-11 18:48:55 +00:00
Nandana Dutt
5adab037d7 Merge "Add a privileged API for capturing and consuming bugreports" am: c2b8bc0a7d
am: 98eef9a909

Change-Id: Ic2cc853f1566bdb5796c233538792cb0618ef1bc
2019-01-11 07:46:45 -08:00
Alexey Kuzmin
b0e7c48c8b Merge "Split ring and notification vibration settings" 2019-01-11 13:51:16 +00:00
Nandana Dutt
3386fb7172 Add a privileged API for capturing and consuming bugreports
The API is mostly implemented; except for hooking up the listener
and handling an already running bugreport.

BugreportManager is the handle to the new API exposed to apps.

Generating bugreports requires root privileges. To limit the footprint
of the root access, the actual bugreport generation in Dumpstate binary,
is accessed as a oneshot service and dies after it finishes
running.

System server accesses Dumpstate via a binder interface since it does
not have root privileges.

Starting a oneshot service is done via setting a system property, which
needs to be done from system server. BugreportManagerService is the
new system server service that does this. BugreportManager calls into
BugreportManagerService via a binder interface, since the former is in
the app's process.

Both app to system server as well as system server to native service
calls are via implementations of IDumpstate binder interface.

Bug: 111441001
Test: builds. Flashed & verified it boots.
Test: wrote a test client (not included) and verified invoking
startBugreport works.

Change-Id: I4abeb753388c055c36ae0dd916af1ec8d40b7bf0
Merged-In: I4abeb753388c055c36ae0dd916af1ec8d40b7bf0
2019-01-11 13:29:09 +00:00
TreeHugger Robot
cbdbc4d9c6 Merge "Add a privileged API for capturing and consuming bugreports" 2019-01-11 12:37:33 +00:00
Svet Ganov
8455ba2341 Historical app ops.
This change is the main check in for the historical app op feature.
The idea is to store a historical data about past app op rejections,
accesses, and durations per op for any UID state indefinitely.

Keeping all operations on record is not practical as app ops are
very frequently performed. To address this we are storing aggregated
data as snapshots where we store for every UID and its packages
how many times each op was accessed, rejected, lasted as an aggregate.

To allow history scaling indefinitely we are taking a logarithmic
approach with only the most recent state stored in memory and all
preceding state stored on disk. State on disk is stored in separate
files where each preceding file, i.e. for an older period, would
cover X times longer period with X number of snapshots covering
X times longer period. Initially X is ten but can be tweaked. For
example, the first file could contain data for ten days with daily
snapshots, while the file for older period would have data
for a hundred days with snapshots every ten days, etc.

The implementation is optimized for fast history update and no impact
on system runtime performance and minimizing memory footprint. We
are lazily persisting state to disk on a dedicated thread as this is
slow. We are also reading the relevant historical files on a query
as this is very rare as opposed to state updates.

The base snapshot interval, i.e. snapshot time span, in the initial
iteration and the logarithmic step are configurable. These can be
changed dynamically and the history would be rewriten to take this
into account.

Test: atest CtsAppOpsTestCases

bug:111061782

Change-Id: I55c32c79911ba12b2ace58d2a782b8df1e6bff60
2019-01-10 19:31:31 -08:00
TreeHugger Robot
d9e60a633d Merge "Add missing @NonNull" 2019-01-10 17:41:29 +00:00
Nandana Dutt
d11850cd44 Add a privileged API for capturing and consuming bugreports
The API is mostly implemented; except for hooking up the listener
and handling an already running bugreport.

BugreportManager is the handle to the new API exposed to apps.

Generating bugreports requires root privileges. To limit the footprint
of the root access, the actual bugreport generation in Dumpstate binary,
is accessed as a oneshot service and dies after it finishes
running.

System server accesses Dumpstate via a binder interface since it does
not have root privileges.

Starting a oneshot service is done via setting a system property, which
needs to be done from system server. BugreportManagerService is the
new system server service that does this. BugreportManager calls into
BugreportManagerService via a binder interface, since the former is in
the app's process.

Both app to system server as well as system server to native service
calls are via implementations of IDumpstate binder interface.

Bug: 111441001
Test: builds. Flashed & verified it boots.
Test: wrote a test client (not included) and verified invoking
startBugreport works.

Change-Id: I4abeb753388c055c36ae0dd916af1ec8d40b7bf0
2019-01-10 17:33:58 +00:00
Alexey Kuzmin
ccdaebb5f7 Split ring and notification vibration settings
Synchronize settings between sound and accessibility menus

Bug: 116172311
Test: See accessibility vibration settings - ring and notification
settings sould be separate. Try changing vibration settings in sound and
accessibility menus - the settings should stay in sync.

Change-Id: Ia0276dfdd0efafe211c14cda140831b57f8c42b1
2019-01-10 16:36:48 +00:00
Martijn Coenen
dbf6abc357 Make some Process constants @TestApi.
Bug: 111434506
Test: atest CtsSeccompHostTestCases builds
Change-Id: If4b9bff1e72d7b1299ac5f5a283b0ab7d504ab03
2019-01-10 10:53:14 +01:00
Yiwei Zhang
4a626ac7b4 GUP: Add a global property for genreal preference
This change also fixes typos and adds some missing comments

Bug: 119221883
Test: Build, flash and boot, verify with prototype
Change-Id: Ida976c4fb3d4af5ffc1d9b977f00fa9c7239a434
2019-01-10 10:25:01 +08:00
Yiwei Zhang
0c9ccbe456 Merge "GUP: Update global property for the new dev opt" 2019-01-10 00:33:39 +00:00