Commit Graph

915 Commits

Author SHA1 Message Date
weijuncheng
8fdcf98670 Merge "Add DENSITY_440" am: 6c40bbdc5e am: a21fa41755
am: 1d64dc96f7

Change-Id: I54a18f245ebf70d9d1670973e02a318743a4ec3c
2018-02-04 01:13:30 +00:00
Treehugger Robot
6c40bbdc5e Merge "Add DENSITY_440" 2018-02-03 00:03:57 +00:00
Victor Hsieh
2120323fb8 Fix fsverity root hash format
Only fsverity header and extension are included in fsverity hash
calculation, not salt, nor the paddings.

Test: fsverity measure ioctl returns successfully
Bug: 30972906
Change-Id: I06fd82d96dfde21d05367caad5c54257a0e4d6ab
2018-02-02 10:01:53 -08:00
David Chen
76ce2d6d04 Implements StatsManager temporary stubs.
Need to use the old API for a bit, so the temporary API will convert
the arguments for ConfigKey from String to Long and then call the
correct API from statsd.

This can be deleted in the future.

Test: Test that marlin-eng can build.
Change-Id: Iebaf2debc08c749ecaae631201e7d039b916f0ce
2018-01-31 16:52:52 -08:00
TreeHugger Robot
75ca5dff32 Merge "Remove feature flag for suggestion ui v2." 2018-01-31 21:15:18 +00:00
TreeHugger Robot
0a2ff2f64c Merge "APK Signature Scheme v3: add version number to proof-of-rotation." 2018-01-31 15:26:33 +00:00
Dan Cashman
a656b8bf9f APK Signature Scheme v3: add version number to proof-of-rotation.
The proof-of-rotation record contains a list of signing certificates
and corresponding flags.  New flags may be defined in future platform
versions, but APKs targeting P would have no knowledge of them.  Add
a version code to enable future platform versions to identify which
flags were deliberately set.  Ignore the version code for this
platform version, though, since all flags are known.

Bug: 64686581
Test: Builds, boots.
Change-Id: I765f50918f7f337100aff3ed15999b45369fc9d1
2018-01-30 16:59:31 -08:00
Doris Ling
5ac59b7c46 Remove feature flag for suggestion ui v2.
Bug: 70573674
Test: rebuild
Change-Id: I876ca6b126e55cca3a0f60020c0990261bd93bdc
2018-01-30 15:31:36 -08:00
Doris Ling
854b697f61 Remove feature flag for settings app info v2
Bug: 69384089
Test: rebuild
Change-Id: I121dea83742f28072a3275d5e02444cf5e89a0b7
2018-01-29 17:26:28 -08:00
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
weijuncheng
5185d71470 Add DENSITY_440
Add 440dpi as a supported screen density

Bug: 72424600

Test: run android.dpi.cts.ConfigurationTest#testScreenConfiguration and android.app.cts.ActivityManagerMemoryClassTest#testGetMemoryClass

Change-Id: I0dbf998ae02515a97f0d5668eeedc7098da4cca4
Signed-off-by: weijuncheng <weijuncheng@xiaomi.com>
2018-01-26 13:07:42 +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
Tobias Thierer
9223fd6b6b 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

(cherry picked from commit d57219411b)

Change-Id: Ib8736faa86d0ae5eec2c47a294f21adcf21d3dc4
Merged-In: I1cc1eb5ca9c36749bbb9a233d60036f6319bf2d3
2018-01-25 12:29:40 +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