Commit Graph

863 Commits

Author SHA1 Message Date
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
Victor Hsieh
4acad4c014 Support 4k chunk based signature algorithms
This change makes APK signature verifier accept the 4k-based signature
algorithms.

Test: build, install apk with such algorithm by apksig
Bug: 30972906

Change-Id: I90f32a6779f258605668e44f0d66f53e6890cfa7
2018-01-10 14:14:12 -08:00
Patrick Baumann
420d58a9d8 Move signing data into SigningDetails container
This change replaces fields from Package that relate to signing
with a single SigningDetails container. It does the same with
InstallArgs and InstallParams. This simplifies much of the code
that would have otherwise relied on synchronizing many fields and
will enable PackageManagerService to make install-time descisions
based on package data instead of forcing it to be part of package
parsing.

This is a retake of ag/3382280

Test: android.appsecurity.cts.PkgInstallSignatureVerificationTest passes.
Test: atest google/perf/boottime/boottime-test to ensure no startup regression.
Bug: 68860689
Change-Id: I0df45ce537df5552a7e60e4d727a4dcef23c2252
2018-01-09 15:12:48 -08:00
Patrick Baumann
229d2cdba3 Merge "Revert "Move signing data into SigningDetails container"" 2018-01-09 18:39:45 +00:00
Patrick Baumann
3d70a03aa9 Revert "Move signing data into SigningDetails container"
This reverts commit 47117fcd78.

Reason for revert: boot time regression (b/71718267)

Change-Id: Ice00e63a68ea3aede847c17cc3acda2d0a6b2f24
Bug: 71718267
Bug: 68860689
2018-01-09 16:17:37 +00:00
TreeHugger Robot
a2fe748e7a Merge "Duration format for tunable settings" 2018-01-09 03:19:03 +00:00
Patrick Baumann
379ae46d76 Merge "Move signing data into SigningDetails container" 2018-01-08 18:56:40 +00:00
Jeff Sharkey
6fb6774c9f Merge "Add DataUnit to clarify SI-vs-IEC units." 2018-01-08 02:08:17 +00:00
Jeff Sharkey
9f2dc0527e Add DataUnit to clarify SI-vs-IEC units.
Mirrors the design of TimeUnit and ChronoUnit which many developers
are already familiar with, making it easy to pick up and use.

Yes, this is an enum.

Bug: 70915728
Test: bit FrameworksCoreTests:android.util.DataUnitTest
Change-Id: Id0cfdac5c81ed89c3c9ece23c964acba4a4f8471
2018-01-07 19:06:01 -07:00
Fan Zhang
7374826b2f Turn on Settings security settings v2.
Bug: 32953042
Test: rebuild
Change-Id: Ia21d2947306b567dc9580c816c0261836356a281
2018-01-05 13:10:16 -08:00
Patrick Baumann
47117fcd78 Move signing data into SigningDetails container
This change replaces fields from Package that relate to signing
with a single SigningDetails container. It does the same with
InstallArgs and InstallParams. This simplifies much of the code
that would have otherwise relied on synchronizing many fields and
will enable PackageManagerService to make install-time descisions
based on package data instead of forcing it to be part of package
parsing.

Test: android.appsecurity.cts.PkgInstallSignatureVerificationTest passes.
Bug: 68860689
Change-Id: I53bc8c6908b61a54004d1b1d45637be9710ae72f
2018-01-05 09:48:49 -08:00
Amith Yamasani
761d3ff06c Duration format for tunable settings
For JobScheduler, DeviceIdle and AppStandby constants, allow
using a more compact format than milliseconds,
which are a PITA to calculate.

So instead of 18640000000... whatever, you can
use PT2H (for 2 hours), or P2D (for 2 days), etc.
Uses Duration.parse() to do the parsing. See Duration
for format.

Test: adb shell settings put global app_standby_constants
      screen_thresholds=0/PT2H/PT12H/P2D
Fixes: 71554131
Change-Id: I5141854ec7df6de266725a67f1f3e2a6e0b4c1c1
2018-01-04 09:37:13 -08:00
Yangster-mac
94e197cceb 1/ Change all "name" to id in statsD.
2/ Handle Subscription for alert.
3/ Support no_report_metric

Bug: 69522276
Test: all statsd unit tests passed.
Change-Id: I851b235f2d149b8602b0cad632d5bf541962f40a
2018-01-03 15:34:00 -08:00
TreeHugger Robot
eee29f6457 Merge "Remove settings suggestion v2 feature flag." 2018-01-03 19:31:34 +00:00
Dan Cashman
cd4cb81fba APK Signature Scheme v3: require Proof-of-rotation and signing certs to match.
Though not yet used, the Proof-of-rotation certificates are intended to be
used by the platform as equivalent to signing certificates, i.e. the presence
of a certificate in a Proof-of-rotation record should grant equivalent
capabilities as if the APK were signed by that certificate.  For this to work,
each certificate needs to be signed by the previous one indicating a transfer
of trust all the way to the signing certificate of the APK.  There is no case
in which the last certificate in the Proof-of-rotation record should not be
the one used to sign the APK, so enforce this during verification.

Bug: 64686581
Change-Id: Ia1b25a917a878fb378c8557b25a2bbfdd9da7d3d
Test: Builds, boots, passes
      android.appsecurity.cts.PkgInstallSignatureVerificationTest
2018-01-02 15:51:07 -08:00
Fan Zhang
c3aa560443 Remove settings suggestion v2 feature flag.
Change-Id: I0ef95324a643079484147caa5ecfff42d811aaff
Fixes: 68719093
Test: rebuild
2018-01-02 12:38:14 -08:00
Daniel Cashman
67096e08a7 Add APK Signature Scheme v3.
Add ApkSignatureSchemeV3Verifier to enable APKs to be signed with
the new signature scheme.  Update the ApkSignatureVerifier to process
the results, but only pass on what's needed for the existing interface.

In the process, move the ApkSignatureSchemeV2 code into a common
area for use by any scheme that makes use of the APK Signature Block.

The primary purpose of APK Signature Scheme v3 is to enable applications
to rotate their signing key.  This is accomplished by augmenting APK
Signature Scheme v2 to also include a new Proof-of-rotation struct, which
is fundamentally a singly linked list where each of the APK's signing
certificates is included in order, along with a signature over the next
certificate.  Thus, each certificate contains proof that the private key
corresponding to the previous one blessed it.  This provides evidence to
the platform that the new signing certificate should be as trusted as
the previously trusted one.  This structure also includes some flags for
each certificate to indicate to the platform how the APK itself would
like to interract/trust the old certificates.

Bug: 64686581
Test: Builds, boots, passes
      android.appsecurity.cts.PkgInstallSignatureVerificationTest
Change-Id: I0f98ff13950af78f5d9b269f80d13af8891f7a2d
2018-01-02 07:28:49 -08:00
Jake Wharton
c26b093ce5 Merge "Expose removeAt(int) for parity with other sparse collections." 2017-12-24 05:32:13 +00:00
TreeHugger Robot
d1dc3524f6 Merge "Add feature flag for security settings v2." 2017-12-22 21:49:35 +00:00
Fan Zhang
d2b4419ebd Add feature flag for security settings v2.
Bug:  32953042
Test: rebuild
Change-Id: Iabfd4705f01cf8a1ca1a3374de3d5a31850ae681
2017-12-22 10:03:00 -08:00
Jake Wharton
d77bce88d4 Expose removeAt(int) for parity with other sparse collections.
Bug: 70934959
Test: none
Change-Id: Ic26a9fba610d6361247e0485803b52569fbf4a38
2017-12-21 18:25:25 -05:00
Fan Zhang
3b8a596f05 Merge "Enable settings search v2 experiement" 2017-12-21 17:29:32 +00:00
Dan Cashman
636ea5e888 Add plsCertsNoVerifyOnlyCerts to ApkSignatureVerifier.
There are currently two conceptual operations performed by PackageParser
while parsing APKs: collecting certificates and verifying them.
ApkSignatureVerifier relies on the systemDir flag to indicate whether or
not it should do a full verification of a package, but this only applies
when verifying V1 (jar signed) APKs.  This distinction should be explicitly
made.  This creates cleaner code and also saves time when verifying V2
signed systemDir APKs.

Bug: 64686581
Test: Builds, boots, passes
android.appsecurity.cts.PkgInstallSignatureVerificationTest.

Change-Id: Ie8a0f8cad3dd8f70da791f2f1f4516e84e2ae4d0
2017-12-20 16:02:51 -08:00
Fan Zhang
b0a15b6d18 Enable settings search v2 experiement
Test: FeatureFlagUtilsTest
Change-Id: I6008cdbf4e0ba2e0351e5859dd178fe7a5a83200
2017-12-20 11:07:49 -08:00
TreeHugger Robot
c9d65a29ed Merge "Returns signing version from ApkSignatureVerifier" 2017-12-18 20:58:13 +00:00
Patrick Baumann
9ff55740c2 Returns signing version from ApkSignatureVerifier
This is a first step at a larger goal of moving instant app
verifications from parsing logic into install logic.

Test: manual - install v1 and v2 instant app and static lib
Test: android.appsecurity.cts.PkgInstallSignatureVerificationTest passes.
Change-Id: Iab50b91a6fb8ef014b573bb9f733d30c1aa6022f
Bug: 68860689
2017-12-18 09:58:22 -08:00
TreeHugger Robot
6831a2646f Merge "Adds API for apps to push events to statsd." 2017-12-16 00:03:53 +00:00
jackqdyulei
65fe45522f Turn on connected device by default
Bug: 69926683
Test: Build
Change-Id: Ia3389f459e7c9c6de3f549c60470bf12660d7a87
2017-12-15 10:59:15 -08:00
David Chen
0a368b2c39 Adds API for apps to push events to statsd.
This API allows app to construct custom metrics based on labels
chosen by the app developers. Also added some buttons to manually
test this functionality in the dogfood app.

Test: Verified that Android can be built and tested with custom app.
Bug: 69522276
Change-Id: Ifb7abea4c1d62fb435a9cb6f32df12bc2234d82f
2017-12-14 16:19:29 -08:00
Dan Cashman
e92f8428dd Refactor PackageParser.collectCerts() to hide signature scheme.
PackageParser shoudln't really need to know the gory details of APK
verification, it should just get back the blobs it needs to do its
job.  Move the package verification into its own class which is
*almost* exclusively responsible for verifying app signatures. This
is in preparation for adding APK signature scheme v3, which will add
yet another way to do this.

Bug: 64686581
Test: Builds 'n' boots without issue.
Test: android.appsecurity.cts.PkgInstallSignatureVerificationTest passes.
Change-Id: Ieb76b2353bd44ffdb83e7b894e5ad720d1697dc7
2017-12-13 12:20:21 -08:00
jackqdyulei
ee0e2e9d23 Add default value for battery app list flag
Bug: 3331576
Test: Build
Change-Id: I3396802c03cf2120f5d1ff5ab9120b7d8949d943
2017-12-08 09:45:23 -08:00
TreeHugger Robot
32db7edec3 Merge "Make a static list of flags." 2017-12-08 05:50:59 +00:00
Fan Zhang
3080636f88 Make a static list of flags.
Bug: 36222960
Test: atest
Change-Id: I356a0c9826fd9f5a9e5520227be4e5cb4d3e04c1
2017-12-07 12:54:11 -08:00
Chris Wren
4170751a68 add integer array values to KeyValueListParser
Test: atest NotificationSnoozeTest KeyValueListParserTest AlwaysOnDisplayPolicyTest
Change-Id: Ia26cd38258c2cf83558a9a39a6b1c2ec6dedfcb1
2017-12-07 01:06:31 -05:00
TreeHugger Robot
1523386d85 Merge "PooledLambda" 2017-12-05 20:38:25 +00:00
Eugene Susla
2f5ee71ec8 PooledLambda
This introduces PooledLambda - a way of obtaining lambdas without the
allocations overhead.

See PooledLambda javadoc for a guide and PooledLambdaSample for code samples
of useful usages.

Test: ensure samples of PooledLambdaSample work as described.
Change-Id: I46f8ad27bc1de07e19f6e39f89d2cafe4238497a
2017-12-05 10:46:59 -08:00
David Chen
2e8f380737 Adds new API to retrieve statsd metadata.
This API can be used by clients to gather stats about statsd, eg.
memory usage, number of metrics/matchers, etc. This data can be used
to debug if devices are not providing expected metrics. The metadata
will be for all configurations, but will not contain the actual
collected metrics since those might have privacy implications.

Test: Tests that statsd and Android still build.
Bug: 69522276
Change-Id: I8e0fedc142f5deed7be6e6309f9444e67d8369ce
2017-12-04 10:23:28 -08:00
TreeHugger Robot
4573e9b880 Merge "Converts exceptions to log messages in StatsManager." 2017-11-18 04:36:47 +00:00
David Chen
c562bfb68f Converts exceptions to log messages in StatsManager.
We log if the statsd is not available instead of throwing an
exception. This helps prevent a crash when calling this API since
statsd is not a system service and can potentially be down.

Test: Not applicable.

Change-Id: I776efede4a01c751924fa9a8abd0eec0c4c1306b
2017-11-17 17:46:58 -08:00
TreeHugger Robot
52418b56f0 Merge "Implement Activity Manager Dumpsys --service option" 2017-11-17 23:24:04 +00:00