Commit Graph

980 Commits

Author SHA1 Message Date
Victor Hsieh
8d1553b9b1 Verify best signature algorithms of all signers
The previous implementation does not verify signature algorithms of all
signers.  It's possible that the attacker can take an old apk (with
digest and signature of old algorithm) and add their own signer block
with new/P digest and signature.  In this case, the old implementation
only verifies the attacker's signature, thus the attacker can change apk
content easily.

The solution here is to verify digests of all best signature algorithms
by all signers.

It is expected to increase verification time, if the apk does have
multiple signers with different type of digests.

Test: apks still install
Bug: 78359754
Change-Id: I607edf219c25a2a7adfa27a21a94e9bfefbb6cec
Merged-In: I607edf219c25a2a7adfa27a21a94e9bfefbb6cec
(cherry picked from commit 2f2ced93e3)
2018-04-23 19:22:28 +00:00
Caxton Chan
116e05cbba Merge "Enable feature flag for audio output switcher." into pi-dev 2018-04-16 19:24:31 +00:00
Michael Wright
585ff988bb Convert the BrightnessController to a log scale control.
Currently, the BrightnessController's UI is a linear scale control on
top of a linear backlight control, but humans perceive brightness on a
roughly logarithmic scale. By moving to a non-linear control, we both
give users more fine-grained control over the brightness of the display
as well as a UI that works more intuitively.

Test: manual
Bug: 73810208
Change-Id: I67090ad7c4ced0420314458473c9124cb9c61906
2018-04-16 14:47:33 +01:00
ryanywlin
651d0335c1 Enable feature flag for audio output switcher.
Bug: 74130772
Test: Build
Change-Id: I04d0276681488c73c62b1f9ab6114c948bb50482
2018-04-12 02:13:51 +00:00
Jeff Sharkey
0a5570d49d APIs to disable data usage notifications.
Certain carriers have requested the ability to disable the warning,
limit, and rapid data usage notifications shown by the OS, so give
them that ability on a per-subId basis.  (The notifications are still
enabled by default.)

Unhide NOT_CONGESTED to match setSubscriptionOverrideCongested().

Fix bug in getPrimarySubscriptionPlanLocked() to find the first
currently active plan; the first non-recurring plan may be no longer
active.  Fix bug in SubscriptionPlan which allowed invalid negative
or zero-length Period objects.

Bug: 77851691, 77506882, 77662747
Test: atest com.android.server.NetworkPolicyManagerServiceTest
Test: atest android.telephony.cts.SubscriptionManagerTest
Exempt-From-Owner-Approval: SDK deadline, responding to API feedback
Change-Id: Ib6e6dbadd5022937c3f0661ab4b66aa617f0b5af
2018-04-11 22:07:40 +00:00
Jeff Sharkey
0fc6d03b62 API council requested tweaks to SubscriptionPlan.
Return new shiny Range<> object instead of Pair<>.  Tell developers
what permission to check on refresh broadcast.  Describe what
exceptions might be thrown, and that an empty list is okay.

Allow creation of plans with richer Period object, instead of forcing
them into rigid week or day options.

Protect SubscriptionPlan broadcast.

Test: atest android.util.RecurrenceRuleTest
Test: atest com.android.server.NetworkPolicyManagerServiceTest
Bug: 74945820
Change-Id: I7e555798e0cfaa214ca93d9df627c6443fc5d986
2018-04-04 16:06:27 -06:00
TreeHugger Robot
d05c00fbb6 Merge "Require signing cert history certs to be unique." into pi-dev 2018-03-30 23:35:54 +00:00
TreeHugger Robot
01a0288ca1 Merge "Fix fs-verity per fs-verity spec change" into pi-dev 2018-03-30 18:43:24 +00:00
Daniel Cashman
10d19e9808 Require signing cert history certs to be unique.
Bug: 73943012
Test: android.appsecurity.cts.PkgInstallSignatureVerificationTest
Change-Id: Id7e91c60f1619ef793d73a9dd736debf7ad2ae0c
(cherry picked from commit ef05408bcd)
2018-03-30 15:13:42 +00:00
TreeHugger Robot
dea705ba59 Merge "Remove feature flag for battery settings" into pi-dev 2018-03-27 20:23:23 +00:00
Lei Yu
4c4efd09de Remove feature flag for battery settings
Bug: 76027338
Test: Build
Change-Id: Ie15e7b05d81e93a9db0569a3e7c00faf9c9a60e3
2018-03-26 14:50:42 -07:00
Jeff Sharkey
eb738c1c50 API council requested tweaks to DataUnit.
Test: none
Bug: 71584606
Change-Id: Ic516dd7645e150586d7dd2e389e7663a32924ecc
2018-03-26 13:37:20 -06:00
Victor Hsieh
cccad1971e Fix fs-verity per fs-verity spec change
- Reorder and adjust fields per fs-verity format change.
- Since header + tree is no longer full page size, pass the length with
  shared memory (which is full pages).
- Fix offset and padding of patch extension.
- It is now required to issue the measure ioctl (via
  assertFsverityRootHashMatches) right after fs-verity is enabled.

Test: adb install a new priv app, saw fs-verity log in dmesg. Read the
      whole file successfully.
Bug: 30972906
Change-Id: I480ae2b5debaf76ef24dadf2d79d1903c7967f03
2018-03-23 22:16:09 -07:00
Kurt Marcinkiewicz
991b971acb Merge "Allow specifying a network for SNTP time sync" into pi-dev 2018-03-23 18:02:19 +00:00
Kurt Marcinkiewicz
dfdd82e84f Allow specifying a network for SNTP time sync
Permits syncing over a specific network instead of the default for
the process. This was causing an issue with Android Wear devices
paired with iOS where the default network is bluetooth
(see b/32663274).

This CL is in support of ag/3776564

Bug: 32663274

Test: adb shell am instrument -e class android.net.SntpClientTest -w \
com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner

Change-Id: Ic9fc169cf75457810d4992121d85d7642e350b90
2018-03-22 13:43:25 -07:00
Jan Nordqvist
5c4a42d532 Enable new data usage settings features.
Bug: 70950124

Test: manual
Test: make RunSettingsRoboTests
Change-Id: I0d2942bf8b8e13ebefd7df899a6ecfc6595d1780
2018-03-21 15:09:04 -07:00
Eugene Susla
18e7fc1114 [DO NOT MERGE] Eliminate duplicate layers in A11yService#getWindows()
Fixes: 73904014
Test: using TestBack, ensure the attached bug is fixed
Change-Id: I097ca47563420d658cea083a3b6f8d5e7d02991c
(cherry picked from commit 8f0124190a)
2018-03-20 19:39:06 +00:00
David Chen
c1a3a0d780 Small fixes to StatsManager API.
Adds some annotations, deletes an unused API method, and adds some
comments.

Test: Flashed onto marlin-eng and verified there are no crashes.
Bug: 72562867
Change-Id: I6c93ee4aeeacf6842795256c76551cfb1c28888d
2018-03-19 10:26:51 -07:00
Chenjie Yu
33a6141cd2 Fix uid for AppBreadcrumbReported for 3p app
Bug: 74897773
Test: gts test
Change-Id: I79ef4efaf37ead570a2fe0d96e2c394a79a20a93
2018-03-15 18:06:06 +00:00
Annie Meng
7d3033b11f DO NOT MERGE Create a key value settings observer for backup parameters
Extracts an abstract class to observe changes in backup parameter settings that
are stored as a comma-separated key value list. This class is
responsible for registering and unregistering a content observer on the
setting and updating local references to the parameters.

Refactor BackupManagerConstants and LocalTransportParameters to use this
implementation. This will also be used for the new backup timeout
setting.

Bug: 74346317
Test: 1) m -j RunFrameworksServicesRoboTests ROBOTEST_FILTER=BackupManagerConstantsTest
2) gts-tradefed run commandAndExit gts-dev -m GtsBackupHostTestCases -t com.google.android.gts.backup.TransportFlagsHostSideTest

Change-Id: Id4c50fbcf7479c925515887e3fa70e166dd9955c
2018-03-13 18:47:46 +00:00
Victor Hsieh
4ba1eeaa0e Verify the content length in the verity digest
When generating digest for verity, for the last incomplete 4k chunk, the
data is padded with 0s.  This implies that we can not tell from the
digest whether the file contains 0 or not, or how many 0s.

Since the verity hash is used by the kernel, the definition cannot be
change.  Instead, the actual hashed content length is appended to the
original digest and is verified before used.

Also uprev algorithm IDs.

Test: use new apksigner to sign an apk, apk can be installed on device
Bug: 30972906
Change-Id: I382af6e4090c7dc3f92d5acb5ac5d02d1f496992
2018-03-07 13:28:32 -08:00
Annie Meng
292d895fb2 Merge "Validate restore of NetworkPolicy settings" into pi-dev 2018-03-07 17:07:51 +00:00
Doris Ling
1af6f81488 Add feature flag for audio output switcher.
Bug: 74130772
Test: rebuild
Change-Id: I06224975550ab4017d1546b182af083a36c0eacc
2018-03-06 15:17:10 -08:00
Annie Meng
47f5c9c55f Validate restore of NetworkPolicy settings
We want to catch potential exceptions that occur when restoring
NetworkPolicy settings. Here, a DateTimeException can be thrown when
we try to read the recurrence rule from the backup data and cannot
parse a timezone.

We also add GTS tests to validate that these catches persist and that
we don't crash when given unexpected backup data to restore.

Bug: 73942796
Test: gts-tradefed run gts -m GtsBackupHostTestCases -t com.google.android.gts.backup.NetworkPolicyRestoreHostSideTest
Change-Id: I6f6ea09d2fff60b8d704c6160234e6f032321103
(cherry picked from commit 853097ca2c)
2018-03-06 13:47:24 +00:00
Maurice Lam
805ea225b9 Merge "Revert "Small fixes to StatsManager API."" 2018-02-28 07:20:36 +00:00
Maurice Lam
c0df1f2354 Revert "Small fixes to StatsManager API."
This reverts commit 16dcd33abd.

Reason for revert: b/73975175

Bug: 73975175
Change-Id: I5bcccde100900b1370c2e43b8bcfc7d1697e5c72
2018-02-28 04:17:25 +00:00
TreeHugger Robot
e6370474a7 Merge "Remove connected devices feature flag" 2018-02-28 00:42:28 +00:00
Tony Mak
2016c0f4f6 Merge "Blue work profile badge - Blue is the new orange" 2018-02-28 00:31:44 +00:00
TreeHugger Robot
ecd5c4a8f7 Merge "Small fixes to StatsManager API." 2018-02-27 22:39:15 +00:00
Jerry Zhang
eefa467e1e Remove connected devices feature flag
Bug: 72829348
Test: passes
Change-Id: If97b4eefeb1f550a78c9117a232e5bdb21789709
2018-02-27 21:40:11 +00:00
Tony Mak
e21a1d0893 Blue work profile badge - Blue is the new orange
1. We are tinting the case rather than the circle
2. Use blue instead of orange

Test: Checked the following places
1. Notification badge
2. Launcher icon
3. Widget preview
4. Share sheet
5. Recents
6. Settings -> Google
7. Cross profile switching
8. Customized shared sheet

BUG: 73815682

Change-Id: I869aa3a041644faf772810c9ab1c3d8e0f745451
2018-02-23 18:03:49 +00:00
David Chen
16dcd33abd Small fixes to StatsManager API.
Adds some annotations, deletes an unused API method, and adds some
comments.

Test: Test that make succeeds.
Bug: 72562867
Change-Id: I6c93ee4aeeacf6842795256c76551cfb1c28888d
2018-02-22 12:56:33 -08:00
TreeHugger Robot
bf65339444 Merge "Remove flags in fs-verity header" 2018-02-21 22:54:44 +00:00
TreeHugger Robot
f66699314c Merge "Use structural equality for A11yNodeInfo#mChildNodeIds" 2018-02-21 20:59:21 +00:00
Narayan Kamath
81945916f1 Merge "Remove uses of libcore.util.Objects.hashCode / equals." 2018-02-21 09:34:42 +00:00
TreeHugger Robot
11d039a1b8 Merge "Only emit debug logging when requested." 2018-02-21 05:42:14 +00:00
Victor Hsieh
91f6eb325e Remove flags in fs-verity header
The flag of "has extension" has been removed since there is a field of
"extension count" in the header.

This changes the on-disk format, but is currently fine because the
feature is not enabled yet.

Test: build
Bug: 30972906
Change-Id: Ibf00070e678835842c1508fb1afe3dca38a77381
2018-02-20 16:26:36 -08:00
Victor Hsieh
3a0032f30f Change verity hash algorithm to pad the last chunk
As the result, all existing cases takes complete chunk for hashing.

Also bump to version number.

Test: without also bumping the version, apk with 0x401 hash won't install
Test: apk with 0x411 hash installs
Bug: 30972906
Change-Id: I48c15c886ac6eab4512f1b2b9744b07e746c6211
2018-02-20 15:34:46 -08:00
Jeff Sharkey
4e0d30757e Only emit debug logging when requested.
Test: builds, boots
Bug: 72556865
Change-Id: I69d5d760221ef907eeea38490f56243f0a3b9dcb
2018-02-20 13:36:23 -07:00
Narayan Kamath
607223f3b7 Remove uses of libcore.util.Objects.hashCode / equals.
Use public API in java.util.Objects instead.

Test: make
Change-Id: I413280f254743a2efa2640a2194693aeb5980605
2018-02-19 14:12:01 +00:00
Eugene Susla
9669e3af65 Use structural equality for A11yNodeInfo#mChildNodeIds
This reintroduces I508df9e4346e304b8ae56cc38b17e9a940d941f1
with the addition of missing nullchecks

A11yNodeInfo#writeToParcel relied on LongArray#equals to avoid
storing it if it's the default value, but because the equality
is be by reference, it would store it every time.
This fixes that.

Test: a11y cts
Change-Id: I8fadffb2508d819ae9a9db8c4298e8941a349627
Fixes: 72460870
2018-02-15 13:45:22 -08:00
Artem Iglikov
74d8796def Merge "Revert "Use structural equality for A11yNodeInfo#mChildNodeIds"" 2018-02-15 12:10:28 +00:00
Artem Iglikov
b45e0b099f Revert "Use structural equality for A11yNodeInfo#mChildNodeIds"
This reverts commit df99184a81.

Reason for revert: Crashes settings - b/73440274

Bug: 73440274
Change-Id: I529874a6110e04d6b5b7723906a03330cd637d1d
2018-02-15 09:12:58 +00:00
TreeHugger Robot
4a9bde8482 Merge "Add owner files for feature flag utils" 2018-02-15 06:11:47 +00:00
TreeHugger Robot
a9e97b0d9e Merge "Couple fixes for M11nGestureHandler" 2018-02-15 06:06:52 +00:00
TreeHugger Robot
107ca33d40 Merge "Use structural equality for A11yNodeInfo#mChildNodeIds" 2018-02-15 03:09:45 +00:00
Eugene Susla
5210e9447c Couple fixes for M11nGestureHandler
1. Added missing defensive copy for a MotionEvent that is posted
asynchronously with delay, and thus might get recycled
2. Fixed transitioning to viewport dragging on 3tap/shortcut+swipe

Test: manually ensure the fix is working
Bug: 73359125
Change-Id: Iae8cd3a83512ee363abe9f0b5702287d7616c092
2018-02-14 17:44:28 -08:00
Fan Zhang
81b68cd55e Add owner files for feature flag utils
Test: rebuild
Change-Id: I23a5724ed3a37350ecbe8fc77861db2b886846cb
2018-02-14 15:17:27 -08:00
Eugene Susla
df99184a81 Use structural equality for A11yNodeInfo#mChildNodeIds
A11yNodeInfo#writeToParcel relied on LongArray#equals to avoid
storing it if it's the default value, but because the equality
is be by reference, it would store it every time.
This fixes that.

Test: a11y cts
Fixes: 72460870
Change-Id: I508df9e4346e304b8ae56cc38b17e9a940d941f1
2018-02-14 19:34:32 +00:00
David Chen
0b5c90cd8c Updates statsd atoms.proto with small changes.
Renames the apphook atom to be more descriptive. Renames time
suffixes to match more clear convention (ms and msec are ambiguous).

Adds a field to CPU active time that's required for the metrics
to be usable.

Test: Test that statsd can still build.
Change-Id: I94866510738db994e8d757260f30e599ba995dbd
2018-02-13 16:17:25 -08:00