Commit Graph

5973 Commits

Author SHA1 Message Date
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
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
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
0c9ccbe456 Merge "GUP: Update global property for the new dev opt" 2019-01-10 00:33:39 +00:00
Jakub Pawlowski
4a89978068 Merge "Revert "Enable ANGLE-for-Android rule processing again"" 2019-01-10 00:32:15 +00:00
Jakub Pawlowski
c3174593a2 Revert "Enable ANGLE-for-Android rule processing again"
This reverts commit e674a54078.

Reason for revert: b/122509524 Random bluetooth crash observed in QP1A.190108.001

Change-Id: I089e30665edf70275d4190bac0577329b4f016a9
2019-01-10 00:24:34 +00:00
Kweku Adams
7fb72a4a83 Moving BatterySaverPolicy into batterysaver directory.
This should make adding new methods that shouldn't be public easier.

Bug: 119261320
Test: atest com.android.server.power.PowerManagerServiceTest
and com.android.server.power.batterysaver.BatterySaverPolicyTest
and com.android.server.power.batterysaver.BatterySaverStateMachineTest

Change-Id: I8fdba4257be3d5602a738d2fffd55385775c3f81
2019-01-09 14:38:52 -08:00
John Reck
13f08e69b7 Add missing @NonNull
Change-Id: I343dd13a7f8518959c7b75162c5cebc5f933ae6f
Fixes: 122549813
Test: n/a
2019-01-09 11:16:28 -08:00
Nikita Ioffe
0800858b02 Merge "Add Binder.getCallingUidOrThrow method" 2019-01-09 16:07:56 +00:00
Nikita Ioffe
a929cf01cf Add Binder.getCallingUidOrThrow method
Binder.getCallingUidOrThrow is a pure java method which uses
Binder.isHandlingTransaction @CriticalNative method.

Binder.isHandlingTransaction itself is not exposed a public API.

Bug: 62253865
Fix: 62253865
Test: Added a testcase to BinderTest.java to verify ISE is thrown
Change-Id: I93a1b6c24a4747b8b70c32d291b4706b6159a3d0
2019-01-09 13:15:56 +00:00
TreeHugger Robot
75d4db712d Merge "Add systrace tag for RRO" 2019-01-08 22:33:55 +00:00
Alex Kershaw
cb577bca43 Merge "Map error code 51 to an incorrect OS error." 2019-01-08 16:32:23 +00:00
TreeHugger Robot
b7343581aa Merge "Enable ANGLE-for-Android rule processing again" 2019-01-08 00:44:43 +00:00
Martijn Coenen
01e719bebb Allocate isolated UID ranges for app zygote and its children.
Introduce a new range of app-zygote isolated UIDs, [90000..98999].
For each app that uses an application Zygote, allocate a range of
100 isolated UIDs. The application Zygote for an app will get a
UID out of that range, and all other children that are forked
from that zygote will get a UID from the same range.

Bug:  111434506
Test: app Zygote and its children run in the new range of
      isolated UIDs (with SELinux disabled). New set of
      tests for UID allocators pass.

Change-Id: I7a6883a5ddb95683932c93ea77f4e52d8f37fa4f
2019-01-07 09:10:31 +00:00
Martijn Coenen
7e6fa6727c Initial support for application Zygote.
When an application has requested isolated services to be spawned
from an app zygote, we need to spawn the app zygote itself, and then
ask it to fork an isolated service.

The application zygote currently only creates the class loader, and
doesn't do much else. We keep track of the isolated services that
use the app zygote, and when the last isolated service goes away,
we stop the app zygote itself (after a timeout).

The app zygote itself runs with the app's UID and under the app
seccomp filter. That last one is too restricted, so this currently
only works with SELinux disabled.

Future CLs will add an application callback for preloading.

Test: start multiple isolated services with useAppZygote="true",
      verify app_zygote starts, services start as a child of
      app_zygote. Stopping all services stops app_zygote as well.

Bug: 111434506

Change-Id: I10ee1d4bd148c9298974d434fbc5e5eccbec16cb
2019-01-07 09:10:31 +00:00
Jeff Sharkey
a1767a290a Grant/revoke legacy "Storage" permissions.
The new isolated storage model we're building in Q introduces new
strongly-typed media permissions which replace the broad "Storage"
runtime permission.

That legacy "Storage" permission is marked as being "removed", and
it also splits into the new media permissions, but apps are confused
when they request the "Storage" permission, which no longer appears
as granted when the user accepts the new split media permissions.

After discussing with the permissions team, the best short-term
solution is to add special-case logic that grants the legacy
permissions when *any* of the new media permissions have also been
granted.  Only when the user revokes *all* of the new media
permissions is the legacy permission then revoked.  (MediaProvider
is already internally filtering the relevant content based on what
new media permissions the caller holds.)

Bug: 121227859
Test: manual
Change-Id: Ic87f7f93a816e91f7189509386255a260378c255
2019-01-05 12:59:06 -07:00
Ian Elliott
e674a54078 Enable ANGLE-for-Android rule processing again
Test: Manual testing of various programs
Test: cts-tradefed run singleCommand cts -m CtsAngleIntegrationHostTestCases
Bug: b/121153494
Change-Id: Ie6065da7a5365d825639fa6c2fcc8a7b1b33ff50
2019-01-04 14:10:19 -07:00
Junyu Lai
864ead76b1 Merge "Ignore ipv6 tx traffic on clat uid." am: bd73798585 am: cb53e78f56
am: 3c6bc9b14d

Change-Id: I1ac85ac863026ea99117c5b0115bcc0c9144fb7b
2019-01-04 08:47:41 -08:00
Junyu Lai
3c6bc9b14d Merge "Ignore ipv6 tx traffic on clat uid." am: bd73798585
am: cb53e78f56

Change-Id: I0f289ce46462f494adb99628bd504cafb584eeeb
2019-01-04 08:30:44 -08:00
Alex Kershaw
7bcb2fa2dc Map error code 51 to an incorrect OS error.
Error code 51 is given when trying to downgrade a device, so this is
required to fix our broken CTS test and give an accurate error code to
the admin.

Change-Id: I436fb7a605dc47dc5388c78c67d7db08ffcf867a
Fixes: 120896091
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.DeviceOwnerTest#testInstallUpdate
2019-01-04 15:18:46 +00:00
Dario Freni
2b9930d0b7 Merge "Write staged sessions to /data/staging." 2019-01-04 10:20:23 +00:00
Junyu Lai
bd73798585 Merge "Ignore ipv6 tx traffic on clat uid." 2019-01-04 09:29:10 +00:00
Yiwei Zhang
51015a756b GUP: Update global property for the new dev opt
We updated the development opt in mechanism for GUP. Now we have
GUP_DEV_OPT_IN_APPS for applications selected to use GUP and
GUP_DEV_OPT_OUT_APPS for applications selected not to use GUP.

Bug: 119221883
Test: Build, flash and boot, verify with prototype
Change-Id: I52869ecf9e411a8dbdc1146f00c82023ba41bebf
2019-01-04 11:01:19 +08:00