Commit Graph

4762 Commits

Author SHA1 Message Date
Kurt Nelson
e6e0ebf187 Extensible StrictMode
go/extensible-strictmode for design doc.

Bug: 63535923
Change-Id: Ic5c48fc06d2167dc99b86e264e114a9af49f12a1
Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t
android.os.cts.StrictModeTest
2017-11-09 12:13:49 -08:00
Christine Franks
fde6ea8d29 Merge "Add DISALLOW_CONFIG_LOCALE user restriction" 2017-11-09 16:02:46 +00:00
TreeHugger Robot
1e3212ebda Merge "Battery saver preliminary changes for P." 2017-11-09 02:06:59 +00:00
Makoto Onuki
aae89531c0 Battery saver preliminary changes for P.
- Flags for force app standby for jobs and alarms, and sensors.
- Don't disable GPS when the screen is off.

Bug: 68769804
Test: manual
Change-Id: I13661498dbc25051f2be0423cb50a55e4e592dc4
2017-11-08 14:34:49 -08:00
TreeHugger Robot
42e0ab0651 Merge "Create a new user restriction to disallow user switching" 2017-11-08 20:16:22 +00:00
TreeHugger Robot
5cc7ea1ff8 Merge "Added new update engine error codes from /android/system/update_engine/common/error_code.h" 2017-11-08 09:03:07 +00:00
scypher
f5a53658b2 Added new update engine error codes from
/android/system/update_engine/common/error_code.h

Test: Exposed new constant and manually added the change to
api/system-current.txt due to b/68874686

Bug: 68380039
Change-Id: I01a8befe07d37dfa74d3544b80bde2c2cc48acdb
2017-11-07 11:25:04 -08:00
Jeff Sharkey
508cce3f4a Merge "Abort long-running benchmarks, report progress." 2017-11-07 19:23:25 +00:00
Jeff Sharkey
7e19f53f75 Abort long-running benchmarks, report progress.
A typical storage device finishes the benchmark in under 10 seconds,
but some extremely slow devices can take minutes, resulting in a
confusing UX that looks like we've frozen.  Even worse, we keep
churning through all that I/O even though we know the device will
blow past our user-warning threshold.

So periodically check if we've timed out, and also use that to report
progress up into the Settings UI.

Test: manual
Bug: 62201209, 65639764, 67055204
Change-Id: Id28e63a7ea1476d83184abab5aea737a1d193f3a
2017-11-07 09:51:53 -07:00
John Reck
0f6fae9efa Merge "Remove unneeded JNI method" 2017-11-07 16:29:08 +00:00
Jeff Sharkey
3c027e49f4 Merge "Consistent handleApplicationStrictModeViolation." 2017-11-07 06:34:03 +00:00
Benjamin Franz
ff66fa9ef2 Create a new user restriction to disallow user switching
For multi-user session implementation, we want to block the user from
going back to user 0. Therefore, we block the user switcher in the
secondary user, as well as swtiching via user section in Settings app.

Bug: 64382189
Test: Manually verify user switcher is not displayed in QuickSettings
Test: Manulaly verify not able to remove or switcher user in user
      section in Setting app
Change-Id: I84bc9e67e3fe7fccb75edf0fc49b775b902f5290
2017-11-07 11:33:18 +08:00
John Reck
d7bd919075 Remove unneeded JNI method
Test: ran PFD CTS tests
Change-Id: I9a40319595c757835f7e19a50dc0311077c9e627
2017-11-06 16:02:49 -08:00
Jeff Sharkey
da4e50f8ba Consistent handleApplicationStrictModeViolation.
Factor out the logic that calls into ActivityManager, since we have
some evidence of violations being triggering before AM has been
published.

Test: manual
Bug: 68940916
Change-Id: Ie64b1eea42393089a657a9b5ae0c4585a0c83bfa
2017-11-06 15:23:05 -07:00
Philip P. Moltmann
4c10ba499d Merge "Allow to attach jvmti agents from inside of process" am: faffb072a4 am: 491058e089
am: b567ea9dda

Change-Id: Ie2d729a7c46a558597d626d1ebd5227bf56b1f55
2017-11-06 21:12:50 +00:00
Philip P. Moltmann
b567ea9dda Merge "Allow to attach jvmti agents from inside of process" am: faffb072a4
am: 491058e089

Change-Id: Ib636dd1ebcee0bfbd57e12e632137561bb661d3e
2017-11-06 20:58:48 +00:00
Treehugger Robot
faffb072a4 Merge "Allow to attach jvmti agents from inside of process" 2017-11-06 20:34:34 +00:00
Neil Fuller
622597fbc5 Merge "Remove TzDataInstallReceiver" 2017-11-06 09:30:09 +00:00
Jeff Sharkey
617e1139aa Flip feature flag to enable StrictMode defaults.
Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.StrictModeTest
Bug: 68662870
Change-Id: I61178def217521ad413074ece3482f4e60428506
2017-11-03 17:36:35 -06:00
Jeff Sharkey
8918298045 Narrower StrictMode defaults.
Until now, userdebug and eng builds have tracked StrictMode
violations on all system apps, including prebuilts that we have no
control over, which results in a lot of unactionable noise.

This CL narrows the set of enabled apps to only "bundled" system
apps, which gives us a much higher chance of burning these violations
down to 0 and keeping them there.  We don't have a good proxy for an
app being "bundled", so we detect it based on being in the "android."
or "com.android." package namespace.

Clean up the entire flow of applying StrictMode defaults to make it
much more human-readable.  This resulted in us fixing a bug where
StrictMode was never actually enabled for jank-sensitive threads in
system_server!

Relax I/O checks in a few places where we know we're interacting with
procfs or sysfs.  Add internal "allow" methods that avoid object
allocation by returning raw mask.

Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.StrictModeTest
Bug: 68662870
Change-Id: I536e8934fbcdec14915fcb10995fc9704ea98b29
2017-11-03 17:36:35 -06:00
TreeHugger Robot
d906cc0901 Merge "Revert "SystemServer: spawn hwbinder threads before BatteryService"" 2017-11-03 21:23:48 +00:00
TreeHugger Robot
51c05d23b4 Merge "Fix BatteryManager.getIntProperty returns 0 as invalid value." 2017-11-03 21:11:47 +00:00
TreeHugger Robot
df66dd920f Merge "Structure StrictMode violations as Throwables" 2017-11-03 20:54:13 +00:00
Yifan Hong
b0f1352be1 Fix BatteryManager.getIntProperty returns 0 as invalid value.
Long.MIN_VALUE cast to Integer.MIN_VALUE always returns 0.

Change-Id: Ief7a1fd12a356c83a4ef3f28139c330034507dfa
Fixes: 37090343
Test: BatteryManagerTest
2017-11-03 19:26:06 +00:00
Kurt Nelson
1bb93bf77c Structure StrictMode violations as Throwables
All violations of StrictMode now inherit from one central Violation
class. This unlocks adding penaltyCallback(Violation).
Parsing strings is no longer required to infer what type of violation
something is.
Violation classes have no need to be loaded in Zygote as only developers
opt-in to this feature and will see violations.

Cross-binder thread violation perf test:
before
2872331
2574093
2481208
after
1938227
1742714
2654538

Bug: 64258734
Test: cts-tradefed run cts-dev --module CtsOsTestCases --test
android.os.cts.StrictModeTest
Change-Id: I1971feb03ff77cf297c940cacee62fadb5b8422c
2017-11-03 11:14:30 -07:00
Philip P. Moltmann
fd8ed85adb Allow to attach jvmti agents from inside of process
Test: cts-tradefed run singleCommand cts-dev -m CtsJvmtiAttachingTestCases
Bug: 65016018
Change-Id: I6d445afa288c6fec1d860150159fa05ed63cf517
2017-11-03 10:33:21 -07:00
TreeHugger Robot
404f810355 Merge "Make the battery saver knobs hidden public," 2017-11-03 00:35:39 +00:00
Yifan Hong
6f7a9e13a4 Revert "SystemServer: spawn hwbinder threads before BatteryService"
This reverts commit 889902c9f9.

Reason for revert: b41e87ae680beefd0d39a127d1ea0b2614caa5f9 fixes 
the root issue. Revert the workaround.

Change-Id: I2f5dfaee8bda17b1d6aeb8418b4a64084b6a6b56
Test: multiple boots
Bug: 68785531
Bug: 68765551
2017-11-02 20:58:11 +00:00
Charles He
0648ae024e Merge "TokenWatcher: fix bug in repeated calls to acquire()." am: dfe472ecae am: c214d506d4
am: 4e701561d3

Change-Id: Ic6130156ebfe79b731b331ccf2dbb487839d831c
2017-11-02 11:11:26 +00:00
Charles He
4e701561d3 Merge "TokenWatcher: fix bug in repeated calls to acquire()." am: dfe472ecae
am: c214d506d4

Change-Id: I0760ba5c839af8a9dd4b9161dbbad16eacdb3550
2017-11-02 10:58:30 +00:00
Charles He
dfe472ecae Merge "TokenWatcher: fix bug in repeated calls to acquire()." 2017-11-02 10:36:01 +00:00
Narayan Kamath
daca7ce5e7 Merge "SystemServer: Get rid of some unused config.* knobs." 2017-11-02 10:22:20 +00:00
David Chen
c8a4324855 Adds pulling for network bytes for statsd.
Adds atoms to collect network bytes transmitted and received via wifi
and mobile data. We need to get the list of correct ifaces from
BatteryStats since NetworkStatsService only tracks the mobile ifaces.
We split the atoms so that we can also capture metrics sliced on
foreground and background since they are available from the kernel.
Also adds an atom for the Kernel Wakelocks.

Test: Manually tested with adb shell cmd stats pull-source after
modifying the StatsPullerManager.cpp

Change-Id: I9467afad799c6d97560e868f8625fefae5c2b5e1
2017-11-02 00:41:51 -07:00
TreeHugger Robot
57780d4460 Merge "SystemServer: spawn hwbinder threads before BatteryService" 2017-11-02 05:27:27 +00:00
Yifan Hong
889902c9f9 SystemServer: spawn hwbinder threads before BatteryService
BatteryService is the first service that uses a hwbinder
call, so we need to spawn the threads for BatteryService to receive
callbacks prior to starting BatteryService.

Test: boot test
Test: manually sleep in SensorDeviceUtils, still boots

Bug: 68765551
Bug: 68217725

Change-Id: Iadd88897d4cf9e0e37af706452c15318115f2149
2017-11-02 04:34:08 +00:00
Yifan Hong
7dbaf8998d Merge "Allow equality checking and hash for HIDL interface proxies." am: 762f27c6a2 am: 0134fd1577
am: ddfee6b154

Change-Id: I70c7fb09397cf9b483ed648f1516158c6c431475
2017-11-02 04:12:09 +00:00
Yifan Hong
ddfee6b154 Merge "Allow equality checking and hash for HIDL interface proxies." am: 762f27c6a2
am: 0134fd1577

Change-Id: I9b7b2b45967506469309353eb09c49738805b213
2017-11-02 04:01:07 +00:00
Treehugger Robot
762f27c6a2 Merge "Allow equality checking and hash for HIDL interface proxies." 2017-11-02 03:39:42 +00:00
Yifan Hong
73b6c27a6b Allow equality checking and hash for HIDL interface proxies.
IFoo.Proxy.equals() -> HidlSupport.equals() ->
IHwInterface.asBinder().equals() -> HwRemoteBinder.equals().
IFoo.Stub.equals() -> default Object.equals()

Notice that IHwInterface.asBinder() returns mRemote(of type
HwRemoteBinder) for proxies and itself (of type HwBinder) for stubs.
If IFoo.Stub.asBinder() had not return "this", its equals()
should also be overridden.

Bug: 68727931
Test: hidl_test_java

Change-Id: I916983d7bc739747145e2ebb6830226310fd4980
2017-11-01 18:30:04 -07:00
Chenjie Yu
b3dda41a5a reretry ValueMetric implementation and pulling mechanism
Note:
This is for value metric. The default operations is sum the diffs.
The test uses kernel wake lock, which also needs dimension by kernel
wake lock name.

The test is a bit cumbersome as it needs StatsCompanionService to do
the alarm, which is not exact alarm.

The internal state of a slice of bucket would look something like this:

4:ipc0000005e_727_android.hardwar
0      0
4:SensorService_wakelock
40      64
4:ipc0000005c_727_android.hardwar
...

Test: manual test on device.
Change-Id: I2ed0ac7d3c5fcba8b7611d46f38a38ffd8bdc92a
2017-11-01 15:58:45 -07:00
Makoto Onuki
2eccd02628 Make the battery saver knobs hidden public,
so other components (system UI, settings, etc) can use them.

Bug: 68769804
Test: Build & presubmit
Change-Id: I30fe78e49d2187bee7c7aeba735cd9c26fc332a5
2017-11-01 14:49:10 -07:00
Narayan Kamath
63cc787fa8 Merge "Debug: Remove obsolete InstructionCount code." am: f5a8edeaf0 am: 47659c3351
am: 39343bf215

Change-Id: I79f3b2ec2a2ef449703867dea4dced63ab1b63ad
2017-11-01 21:17:51 +00:00
Narayan Kamath
39343bf215 Merge "Debug: Remove obsolete InstructionCount code." am: f5a8edeaf0
am: 47659c3351

Change-Id: I1d4b929ead3af4ef3f9d28de2a3e905d124e718c
2017-11-01 20:56:50 +00:00
Neil Fuller
bc729befa4 Remove TzDataInstallReceiver
The functionality has been replaced by the RulesManagerService.

Bug: 65536493
Test: make droid / boot device
Change-Id: I3e3807aff0ad7d367048671a902807a2303dc608
2017-11-01 14:19:33 +00:00
Narayan Kamath
19541e84b1 Debug: Remove obsolete InstructionCount code.
Support for instruction counting has been removed from ART
and the VMDebug APIs in question throw UnsupportedOperationException
unconditionally.

Test: make

Change-Id: Ibcaa160f755a5708bc6fbef3a783acfc26f0ba90
2017-11-01 13:24:47 +00:00
Charles He
cdef147ac3 TokenWatcher: fix bug in repeated calls to acquire().
The javadoc of TokenWatcher promised to implement repeated calls to
acquire() with the same token as a no-op, but this wasn't the case.

When acquire() is called repeatedly with the same token, its associated
DeathRecipient object is replaced by a new one. The old DeathRecipient
can therefore be destroyed. This is problematic because the finalizer of
this DeathRecipient implementation calls release() on the same token,
resulting in the token being released unexpectedly.

In this CL we properly implement the documented no-op behavior.

Bug: 68368071
Test: (First, cherry-pick to internal master)
Test: cts-tradefed run cts-dev -m OsTest -t android.os.cts.TokenWatcherTest
Test: CTS verifier > Managed provisioning > Device owner tests
      > LockTask UI

Change-Id: Idfad7c88075a510ea1f8527b5a8620121a5dd7bb
2017-11-01 09:43:14 +00:00
Andreas Huber
21d2c3ebbd Merge "Adds APIs to extract/import arrays of primitive Java types out of/into a HwBlob." am: a546c38130 am: 33569ca480
am: 4b5806cea6

Change-Id: I202635b9b7c0800eadfe0923e29c94d2dd39dcb5
2017-11-01 01:51:25 +00:00
Steven Moreland
3014116f07 Merge "Reland "HIDL Java getService now the same as C++."" am: c1616f6820 am: 0c6f0240b2
am: be0f18fe3d

Change-Id: If15ebb8582478ebcc8d45a2ace0c8f2825932dc9
2017-11-01 01:19:01 +00:00
Andreas Huber
4b5806cea6 Merge "Adds APIs to extract/import arrays of primitive Java types out of/into a HwBlob." am: a546c38130
am: 33569ca480

Change-Id: Ic3048cf4539b112027089726b529e3c0838c40f4
2017-11-01 00:03:34 +00:00
Steven Moreland
be0f18fe3d Merge "Reland "HIDL Java getService now the same as C++."" am: c1616f6820
am: 0c6f0240b2

Change-Id: I35ee525aaa1563cc6d8fde5dac1e38e04803bb38
2017-10-31 23:40:34 +00:00