Commit Graph

902 Commits

Author SHA1 Message Date
TreeHugger Robot
52546d66d6 Merge "Remove security_v2 flag" 2018-01-29 23:25:09 +00:00
Fan Zhang
204469a908 Remove security_v2 flag
Change-Id: Ibac46b9df4b950bfdbf1adf16ae65dc9b11d0dbf
Fixes: 32953042
Test: rebuild
2018-01-29 12:03:33 -08:00
TreeHugger Robot
6fa646ab95 Merge "Reduce pss collection amount, improve logging." 2018-01-29 16:52:08 +00:00
TreeHugger Robot
b4799807b6 Merge "Remove workaround for the ByteBuffer#put issue" 2018-01-26 23:44:42 +00:00
Dianne Hackborn
e17b445b6c Reduce pss collection amount, improve logging.
Tuned rates that we collect PSS, to reduce how much we do
that heavy operation.  Added a new way to determine
whether a process has changed to a state for the
"first" time -- now this is when it has gone to that
state for the first time since it was in a lower state.
This will reduce the amount of time we consider a
process to be first to only when it has previously
gone into a higher state than it had before.

Keep track of more fine-grained information about why we
collect a PSS sample (not just internal, but for a single
process, all processes because of a mem state change, all
processes because of a poll).

Started collecting RSS in various places, so we can start
looking at that w.r.t. PSS and see about transitioning to
it is a new primary metric.

Added logging for many of the places where the system
writes its configuration files, so we can more easily
see any bad behavior going on in those areas.

Added some currently disabled code to read smaps directly
instead of using fgets().  Probably won't help, but want
tot test.

Bug: 70859548
Test: atest CtsAppTestCases
Change-Id: I400dba0f3ae9c024df51c946cfa592561028b598
2018-01-26 15:15:04 -08:00
TreeHugger Robot
618e86023f Merge "v3 APK verification: reset por signedData after verification." 2018-01-26 21:58:29 +00:00
Philip P. Moltmann
d3402ac90c Merge "Add logging to MemoryIntArray" 2018-01-26 20:49:08 +00:00
Dan Cashman
6dbf837a3a v3 APK verification: reset por signedData after verification.
During the proof-of-rotation additional attribute parsing, each
new certificate needs to be verified by the last.  When doing this
verification, the ByteBuffer position is advanced to its limit, but
it needs to be read again to extract the certificate.  Reset the
signedData ByteBuffer to its original position.

Bug: 64686581
Test: Builds, boots, v3 signed app with rotated cert installs.
Change-Id: Ie95e4c7e99e3cfb9a987638a0c641456af2f34d9
2018-01-26 08:36:31 -08:00
Victor Hsieh
2c8fbd6242 Remove workaround for the ByteBuffer#put issue
It works on ToT now.  See b/72480435 for the ART bug.

Test: install apk with verity and succeed
Bug: 72459251
Change-Id: I409b344169b3448496d26b772b520d9b148d7baf
2018-01-25 16:13:09 -08:00
Makoto Onuki
eb898f1b8a Do not throttle EXEMPT apps on battery saver
- Also keep track of # of callback calls and their duration and print them in
dumpsys. Example:

  Stats:
    UID_STATE_CHANGED: count=141, total=31.9ms, avg=0.226ms
    RUN_ANY_CHANGED: count=0, total=0.0ms, avg=0.000ms
    ALL_UNWHITELISTED: count=0, total=0.0ms, avg=0.000ms
    ALL_WHITELIST_CHANGED: count=0, total=0.0ms, avg=0.000ms
    TEMP_WHITELIST_CHANGED: count=28, total=14.9ms, avg=0.532ms
    EXEMPT_CHANGED: count=2, total=4.7ms, avg=2.370ms
    FORCE_ALL_CHANGED: count=6, total=1.1ms, avg=0.178ms
    FORCE_APP_STANDBY_FEATURE_FLAG_CHANGED: count=0, total=0.0ms, avg=0.000ms

Bug: 70565111
Test: atest $ANDROID_BUILD_TOP/frameworks/base/services/tests/servicestests/src/com/android/server/ForceAppStandbyTrackerTest.java
Test: atest CtsBatterySavingTestCases
Test: atest CtsJobSchedulerTestCases
Test: atest CtsAlarmManagerTestCases

Change-Id: Ie4983456dd60f7115a15ee25a8d1bf5c078dac74
2018-01-25 14:54:14 -08:00
Philip P. Moltmann
6d8f30bee7 Add logging to MemoryIntArray
Test: Booted and saw logging
Bug: 72415980
Change-Id: I828c74b2e703a8bd3cce9f325e5747f9243fe485
2018-01-25 13:38:38 -08:00
TreeHugger Robot
f1b720c488 Merge "Skip priv app full apk verification if has verify" 2018-01-25 17:52:25 +00:00
TreeHugger Robot
73a331f524 Merge "Statsd broadcast subscriber" 2018-01-25 06:23:36 +00:00
Victor Hsieh
d3f432c2bd Merge "Fix fsverity format" 2018-01-25 04:24:06 +00:00
Victor Hsieh
5f76124551 Skip priv app full apk verification if has verify
When ro.apk_verity.mode is on, full apk verification is only skipped if
the apk already has verity enabled in the file system, and if the apk
contains the Merkle tree root hash we need.

Since the configuration in the file system is duplicated from the apk
(including the offset and size of Signing Block and the Merkle tree),
in order to prevent offline attacker from changing it, we need to
measure the observed configuration and make sure it matches the kernel's
view.

Test: observed package manager's requeset to installd (only) for updated
      priv apps.
Bug: 30972906

Change-Id: I33531a3f6148232b777ea8bfd02f13700649e317
2018-01-24 16:30:55 -08:00
Victor Hsieh
d48e9548d5 Fix fsverity format
This change also contains a workaround that ByteBuffer#put(byte)
sometimes does not work at all.  See comments.

Test: saw correct debugging output of struct in dmesg.
Bug: 30972906
Bug: 72459251
Change-Id: I54553a8f20b8ef01c81c648f9aa588d28ab5eea5
2018-01-24 16:20:53 -08:00
Tobias Thierer
5e5c8d7768 Merge "Deprecate android.util.Mutable*." 2018-01-24 23:19:33 +00:00
Bookatz
c697797d43 Statsd broadcast subscriber
Allows a uid that uploads a statsd config to additionally
register a BroadcastSubscriber with statsd. If statsd
detects an anomaly (according to the config's Alert),
statsd can inform a BroadcastSubscriber provided in the config.
The config uses a subscriberId (just an int) to identify the
BroadcastSubscriber. It then uses StatsManager.setBroadcastSubscriber
to associate that subscriberId with a given PendingIntent.
Then, when the anomaly is detected, statsd sends a broadcast
using that PendingIntent, alerting whoever was specified by
the config/setBroadcastSubscriber.

Bug: 70356901
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.alert.BroadcastSubscriberTests
Change-Id: I4d9ea9a6c8a85e61fadfd99c1513c55abbadd5e9
2018-01-24 13:08:19 -08:00
Daniel Nishi
1da5ab0183 Merge "Add a new setting for Bluetooth on while driving." 2018-01-24 18:22:15 +00:00
TreeHugger Robot
00be19795d Merge "Implement verity header and extension generation" 2018-01-24 17:52:17 +00:00
Tobias Thierer
d57219411b Deprecate android.util.Mutable*.
Since http://r.android.com/565744 , these classes do not appear
in the signature of any other Android API. There are no plans to
make them part of any future API signatures.

They do not provide useful abstractions because:
 - They lack encapsulation and functionality (value is nonfinal;
   lack of equals/hashCode and toString).
 - It's trivial for apps to implement similar types for their
   internal use.

Only three of these eight classes (Mutable{Int,Long,Boolean}) are
used internally in Android; most of these usages could be written
better with named, more specific classes.

Therefore these classes do not pull their own weight on the API
surface of android.util.

This CL deprecates all eight classes in preparation for removing
them from the Android API surface at some point in the future, and
to allow the unused classes to be removed entirely.

Bug: 71546998
Test: Treehugger

Change-Id: I1cc1eb5ca9c36749bbb9a233d60036f6319bf2d3
2018-01-24 14:48:30 +00:00
Victor Hsieh
3051d78225 Implement verity header and extension generation
Test: build
Bug: 30972906
Change-Id: I3eff98231525fc248a7df2fb9b74a4c3b9f708b7
2018-01-24 00:06:22 -08:00
TreeHugger Robot
449e7d62a5 Merge "Implement activity --proto --processes" 2018-01-24 07:21:35 +00:00
TreeHugger Robot
59c31de1e5 Merge "Turn on battery settings feature by default" 2018-01-24 03:10:27 +00:00
TreeHugger Robot
064f16638b Merge "Add API to expose signing certificate proof-of-rotation." 2018-01-24 03:00:27 +00:00
Yi Jin
148d7f4291 Implement activity --proto --processes
Bug: 66729158
Test: out/host/linux-x86/bin/incident_report -w amprocesses
Change-Id: Iae043203bca954bfc4aadad0460cc56621e9ba05
2018-01-23 16:49:58 -08:00
TreeHugger Robot
4ec3efce54 Merge "Add proof-of-rotation information to PackageParser.SigningDetails" 2018-01-23 23:19:59 +00:00
jackqdyulei
b98408cb9c Turn on battery settings feature by default
Bug: 69867246
Test: Manual
Change-Id: Ifc8bc4b5ea5e0a00784d9dbde042ed70dd853de4
2018-01-23 10:22:16 -08:00
Daniel Nishi
7976412772 Add a new setting for Bluetooth on while driving.
This also adds a feature flag to read to see if the feature is enabled
on a given device.

Bug: 66679618
Test: Used in Settings Robotest
Change-Id: Idb892aa78f244d026a8d4b7dc104d47e0f611085
2018-01-23 09:35:02 -08:00
Daniel Cashman
5cdda3425c Add API to expose signing certificate proof-of-rotation.
With the addition of APK Signature Scheme v3, the platform now can
support key rotation by using the proof-of-rotation provided by the
new scheme.  Create a new API which allows checking of the entire
provided history of an APK's signing certificates, not just the
current signer.  This should allow for changes of APK signing
certificates without fear of losing access to resources that would
have been provided under the old signing certificate.

Change getPackageInfo(GET_SIGNATURES) to return the oldest signing
certificate in the chain so that apps which do programmatic checks,
but are not updated to use the new API, still get the same information
they would have gotten had there been no rotation.

Bug: 64686581
Test: Builds, boots.
Change-Id: I8982fd4cce60f5d85a6180d157a6e2a661b1a6d7
2018-01-23 09:10:13 -08:00
TreeHugger Robot
426deb4da7 Merge "Add flag for a V2 of the About Phone page." 2018-01-23 07:04:29 +00:00
Daniel Cashman
77029c5b16 Add proof-of-rotation information to PackageParser.SigningDetails
APK Signature Scheme v3 enables APK signing key rotation by allowing
an APK to embed a proof-of-rotation structure linking past signing
certificates to the current one.  This information needs to be exposed
to the system before it can be used to make authorization decisions.

Bug: 64686581
Test: Builds and boots.
Change-Id: I49961f92fcec141d73b36197147d5d8fa64c149e
2018-01-22 14:58:43 -08:00
Joachim Sauer
ee90161a61 Turn on new time zone picker flag by default.
Changes the default value of the settings_zone_picker_v2 to true to
allow more wide spread testing of the new zone picker.

Bug: 62255208
Test: manual
Change-Id: I6755a527ffa38835c126e4598be37b1d7035d0df
2018-01-22 15:52:26 +00:00
TreeHugger Robot
3a29ce00bd Merge "ApkSignatureVerifier: expose verity interfaces" 2018-01-19 23:33:07 +00:00
TreeHugger Robot
9c68323763 Merge "Fix buffer overflow when the last chunk is 4kb" 2018-01-19 23:08:15 +00:00
Victor Hsieh
b62a64e078 Fix buffer overflow when the last chunk is 4kb
Test: adb install GtsNetStatsTestCases.apk  # works only w/ the patch
Bug: 72189232
Bug: 30972906
Change-Id: I9f01279d783dd5adf31cfda4abd452240ad25ca3
2018-01-19 12:47:09 -08:00
Jeff Sharkey
399ea8325b Add DataUnit to clarify SI-vs-IEC units.
Improve docs and propose it as public API.

Test: builds, boots
Bug: 70915728
Change-Id: I9b55601e9eb8c069eeccd5f8f5e64fb34e336fd2
2018-01-19 09:56:53 +09:00
Victor Hsieh
07bc80c51b ApkSignatureVerifier: expose verity interfaces
Test: the verity install request goes through to installd
Bug: 30972906
Change-Id: I3683d6483880291200cd963b7aa4da81c8097724
2018-01-18 12:15:40 -08:00
Daniel Nishi
9ecc54565d Add flag for a V2 of the About Phone page.
Bug: 63819909
Test: Manual
Change-Id: I370434d2ce2831674708197df38049a81fc55481
2018-01-17 15:07:26 -08:00
TreeHugger Robot
27277a795f Merge "Add feature flag for suggestions UI v2." 2018-01-17 22:45:45 +00:00
David Chen
5914fa0002 Adds old API to StatsManager (temporary need).
We changed the API to use long-based config keys instead of strings,
but we have some code that depends on the old API. Let's add them
back temporarily. The old API (that does nothing now) will be
deleted next month.

Test: N/A. Just to prevent build failures.
Bug: 69522276
Change-Id: Ibc51622371d4f3ced3e9b2f66a862dea1ac1c63c
2018-01-16 18:39:05 -08:00
Fan Zhang
55c4e3dcb2 Remove search_v2 flag
Change-Id: I606111f510d2d44276aac2e71fdc5e87b0e2babe
Fixes: 69851037
Test: rebuild
2018-01-16 13:16:55 -08:00
Neil Fuller
8e69452978 Merge "Remove code no longer used by telephony" 2018-01-16 08:39:16 +00:00
Neil Fuller
11351b655b Remove code no longer used by telephony
This code was previously used by telephony
but was removed by frameworks/opt/telephony
commit a0f09cee0f6328ea104b9ef965a387b4a4652e8a

Bug: 63743683
Test: make droid
Change-Id: I83deffc2aadc098e1c976bf164a752e19b96c77a
2018-01-15 17:02:07 +00:00
Doris Ling
c5c9b7ffac Turn on app info v2 feature.
Bug: 69384089
Test: rebuild
Change-Id: I362de6232fa0cc790f4884e2fec9715342882167
2018-01-12 16:02:27 -08:00
Doris Ling
c359dfaece Add feature flag for suggestions UI v2.
Bug: 70573674
Test: rebuild
Change-Id: Ie05b381553b3e3bdfe31c503690bf8b283fbcead
2018-01-12 15:26:19 -08:00
Joachim Sauer
79131f7a22 Merge "Add default value for new time zone picker flag." 2018-01-12 11:25:32 +00:00
TreeHugger Robot
a665af32cb Merge "Move signing data into SigningDetails container" 2018-01-11 19:01:13 +00:00
Joachim Sauer
0c0ccc62d4 Add default value for new time zone picker flag.
Add a feature flag for the new time zone picker, disabled by default.

Bug: 62255208
Test: make
Change-Id: I9dc2fd7d86f832e3b395d2fedc87b3fb64424c43
2018-01-11 17:12:16 +00:00
TreeHugger Robot
d384145892 Merge "Support 4k chunk based signature algorithms" 2018-01-11 02:43:26 +00:00