Commit Graph

6078 Commits

Author SHA1 Message Date
Zimuzo Ezeozue
ed6a17b24a Merge "Allow non-mainline package rollbacks" 2019-02-05 13:59:42 +00:00
Zimuzo
9e57ecb5c4 Allow non-mainline package rollbacks
If3aaf8f2c454f45b9d79c9dae5a21d356e4cf029 prevented rolling back
packages that were not part of a mainline update. This made it
difficult to test and the auto PackageWatchdog test was ignored in the
meantime. We are now allowing non-mainling package rollbacks and
re-enabling the test.

I8dd7e6d1e144251830108c58f4a752c411d7295b introduced a refactoring bug
when rolling back packages, the module metadata provider was rolled
back instead. This was not caught because the test was ignored.

Test: atest RollbackTest
Bug: 120598832

Change-Id: I8fcc9492a05f0b3788ba4762ad3e3e5ac086d43b
2019-02-05 10:40:46 +00:00
Richard Uhler
b002577d72 Create dummy apex files for testing Rollbacks.
Bug: 112431924
Test: RollbackTest builds

Change-Id: I50404ca06710ca0173cb5717ca88b77f6b46cd2e
2019-02-05 10:05:52 +00:00
TreeHugger Robot
f0513785ed Merge "Revert "Convert RollbackTest Android.mk to an Android.bp."" 2019-02-04 18:05:32 +00:00
Richard Uhler
4937fadf67 Revert "Convert RollbackTest Android.mk to an Android.bp."
This reverts commit 0145c883e0.

Reason for revert: Causes the RollbackTest apps to be installed to the system partition, which breaks the rollback tests.
Bug: 123695037

Change-Id: I3ee89ecb370144c67fe88bb389abafdda59dc502
2019-02-04 12:51:58 +00:00
TreeHugger Robot
92f6c4c539 Merge "Make method private to fix checkstyle error." 2019-02-04 11:05:34 +00:00
junyulai
e413528700 [KA02] internal cleanup and refactor for SocketKeepalive
In previous change, the new SocketKeepalive API was exported.
But internally, old PacketKeepalive names and structures are
still used.

This change rename them properly for code consistency and also
refactor KeepalivePacketData to support different types of
KeepalivePacketData.

(clean cherry-pick from aosp/860394)

Bug: 114151147
Test: 1. atest FrameworksNetTests
      2. atest FrameworksWifiTests
      3. atest FrameworksTelephonyTests

Change-Id: Ia9917d12987e91e87e34ffb3f126e7bc7c9c187e
2019-02-04 04:06:22 +00:00
Zimuzo
71d931e9c8 Refactor PackageWatchdog to use VersionedPackage
We now pass a VersionedPackage argument instead of passing separate
method arguments for packageName and versionCode.

Test: atest PackageWatchdogtest
Bug: 120598832
Change-Id: I8dd7e6d1e144251830108c58f4a752c411d7295b
2019-02-01 13:43:09 +00:00
TreeHugger Robot
65ac428ef0 Merge "Add statsd logging for RollbackHealthObserver events" 2019-01-31 23:09:50 +00:00
TreeHugger Robot
c664ade8be Merge "Migrate away from temporary androidx.design_design target." 2019-01-31 22:47:34 +00:00
TreeHugger Robot
7d3adab5e9 Merge "Change foregroundServiceType from enum to flags" 2019-01-31 22:11:41 +00:00
Zimuzo
03eeb13794 Add statsd logging for RollbackHealthObserver events
Use new rollback status codes in RollbackPackageHealthObserver

Test: Builds ok
Bug: 120598832
Change-Id: If3aaf8f2c454f45b9d79c9dae5a21d356e4cf029
2019-01-31 21:19:02 +00:00
Hui Yu
2d4207f8c1 Change foregroundServiceType from enum to flags
1. Now the value of manifest attribute foregroundServiceType can
be multiple flags ORed together.
2. Add a overloaded version of Service.startForeground() with an
additional parameter foregroundServiceType. The flags in parameter
foregroundServiceType must be a subset of flags specified in manifest
attribute foregroundServiceType, otherwise a IllegalArgumentException is
thrown.
3. Add a field foregroundServiceType in ServiceRecord, it is the types
that have been started on this foreground sevice.

Bug: 111453223
Test: atest frameworks/base/tests/FrameworkPerf

Change-Id: I7eb68f696e6bf75720fe9c9388a6c23a529677f7
2019-01-31 11:50:18 -08:00
John Reck
0cd6c779f1 Merge "Have position listener only call when interesting" 2019-01-31 19:33:44 +00:00
TreeHugger Robot
40a0a3ef74 Merge "Fix error message on Flicker's launchSplitActivity test" 2019-01-31 15:37:04 +00:00
Richard Uhler
4b80033434 Make method private to fix checkstyle error.
Checkstyle wants all public methods to have javadocs. Rather than add
javadocs for this method, mark it private, which is more appropriate.

Bug: 112431924
Test: atest RollbackTest
Change-Id: I438d16b0e4164482ba5f6527aecd50c65ce41418
2019-01-31 15:29:04 +00:00
Richard Uhler
39e2a4394e Merge "Convert RollbackTest Android.mk to an Android.bp." 2019-01-31 09:26:22 +00:00
Mark Chien
c85d681cec Merge "Add get last entitlement value callback API" am: 4163ff7928 am: 524fbd619e
am: a31f85f6dc

Change-Id: If67c8d092dd2c40f95cbe423bc694aa349039541
2019-01-30 23:59:01 -08:00
Mark Chien
a31f85f6dc Merge "Add get last entitlement value callback API" am: 4163ff7928
am: 524fbd619e

Change-Id: I42892bdacaa41f9cea7e653f0bb9b5497192e5f6
2019-01-30 23:49:43 -08:00
Mark Chien
4163ff7928 Merge "Add get last entitlement value callback API" 2019-01-31 07:23:31 +00:00
Aurimas Liutikas
d113f94efd Migrate away from temporary androidx.design_design target.
androidx.design_design was a target created temporarily while
the com.google.android.material_material was being added.
This migrated to the final material design class packages.

Test: make -j UiBench JankBench
Change-Id: I86540efbe706049fd05938eec0634ba63971b45a
2019-01-30 22:12:34 -08:00
markchien
f273127880 Add get last entitlement value callback API
The callback would be used to notify entitlement value. If the
cache value indicates entitlement succeeded, it just fire
callback with cache value instead of run entitlement check.

Bug: 120887283
Test: atest FrameworksNetTests
Change-Id: I8afe928423bd75c54c61533a50a5c0814922ceb1
2019-01-31 12:31:55 +08:00
Varun Anand
066e326222 Merge "Add an API that allows VPNs to declare themselves as metered." am: 62a9b66a38 am: 9563c15d09
am: b8ae5b64a9

Change-Id: I74c6eceaa7444d0cc79fac3b94151a1bdeb63037
2019-01-30 20:11:09 -08:00
Varun Anand
b8ae5b64a9 Merge "Add an API that allows VPNs to declare themselves as metered." am: 62a9b66a38
am: 9563c15d09

Change-Id: Iab1d2a3bf27ec9c033253ccd48ce8026e3b18799
2019-01-30 19:39:50 -08:00
Varun Anand
62a9b66a38 Merge "Add an API that allows VPNs to declare themselves as metered." 2019-01-31 02:43:25 +00:00
Nataniel Borges
7b3ec11b8c Fix error message on Flicker's launchSplitActivity test
When the Flicker test is unable to launch a split activity it crashes
with a `NullPointerException`.

Change this error into a meaningful error message.

Test: Run `atest WindowManagerSmokeTest`
Change-Id: I1c3c06b3327b94ad6da1a1eabe147182202676a1
2019-01-30 17:29:13 -08:00
John Reck
51aa189a26 Have position listener only call when interesting
Test: it compiled; HwAccelTest looked fine
Change-Id: I193028791749811d5709d078f32efdebd7173d13
Fixes: 123656149
2019-01-30 16:03:24 -08:00
Varun Anand
1215f09b07 Add an API that allows VPNs to declare themselves as metered.
For VPN apps targeting Q and above, they will by default be treated as
metered unless they override this setting before establishing VPN.

Bug: 120145746
Test: atest FrameworksNetTests
Test: On device tests verifying meteredness setup correctly for apps
targeting Q and apps targeting P.
Change-Id: Ia6d1f7ef244bc04ae2e28faa59625302b5994875
2019-01-30 14:09:03 -08:00
Zimuzo
c119780925 Fix null RollbackManager in RollbackHealthObserver and minor todos
1. RollbackManager was instantiated by Context#getSystemService in
   RollbackHealthObserver. At this time, RollbackManager has not yet
   been published as a service to the system, so RollbackManager was null.
   We now #getSystemService lazily so RollbackManager is never null.
2. Pass causePackages from RollbackHealthObserver to RollbackManager
3. Also fixed flaky ignored test exercising PackageWatchdog auto rollback

Test: atest RollbackTest
Bug: 123615508 112431924

Change-Id: I8f15c257b1efd96a96656405d3d7f74576a32c8e
2019-01-30 14:37:03 +00:00
Zimuzo Ezeozue
aab0a275ae Merge "Notify PackageHealthObservers of the package versionCode on package failure" 2019-01-30 10:13:41 +00:00
Chalard Jean
08577fc579 Tell the factory it is already serving a request.
This is a cherry-pick of ag/607226 that has been rebased on
top of four years of changes and with comments addressed.

Gives each factory a serial number and propogates it to every
NetworkAgent so when a score comes back indicating a request is
being handled the factory can account for it properly.

Without this, a new request that's already handled by a network
offered by a factory will not cause an increment of the factorys
ref count. Concretely this results in issues like the RAT icon
not being displayed in spite of the network actually being up
and usable.

This will be ported to AOSP as soon as possible, but immediately
some master-only WiFi tests need to be adjusted with this change
which would not let me submit to AOSP.

Bug: 18637384
Bug: 29030667
Test: manual
Test: atest frameworks/opt/telephony/tests/telephonytests
Test: atest frameworks-net
Test: atest CtsNetTestCases CtsHostsideNetworkTests
Change-Id: I597ac588f76dd507512ff02868fd1310b7e63f7e
2019-01-30 15:41:57 +09:00
Remi NGUYEN VAN
4a80077ddd Merge "Remove last NetworkStack usage of hidden APIs" am: 16ec5d038c am: 4845df3ced
am: 14062be8f2

Change-Id: I2059d9cfa3015388301a74828255354b6dc23c23
2019-01-29 21:42:29 -08:00
Remi NGUYEN VAN
14062be8f2 Merge "Remove last NetworkStack usage of hidden APIs" am: 16ec5d038c
am: 4845df3ced

Change-Id: I488fc028b8fd2aa5a09464082c65a4889a8a6b62
2019-01-29 21:27:50 -08:00
Remi NGUYEN VAN
231b52bc03 Remove last NetworkStack usage of hidden APIs
Includes various small changes to stop using hidden APIs

Test: make NetworkStack
Test: flashed, booted, WiFi and tethering working
Bug: 112869080
Change-Id: Id2830795a444f484b377ed6437435a1cd833697a
2019-01-30 10:23:24 +09:00
Zimuzo
972e1cdb2e Notify PackageHealthObservers of the package versionCode on package failure
PackageHealthObservers may need to verify that the package failure
notification they receive matches the expected package version code.
We now pass the version code along with the package name when notifying
observers.

Test: atest com.android.server.PackageWatchdogTest
Bug: 120598832
Change-Id: I272965d08a07240f3bde358039b52187ff2dd3cf
2019-01-29 22:43:04 +00:00
Christopher Tate
d4caf851d3 Fix typo: decrement not increment
When iterating a list backwards, one must decrement the index
rather than increment it.

Bug: 123562063
Test: test procedure given in bug
Test: tests/ActivityTests
Change-Id: I09d7bd045ff00291befe9d4e829d153f41a01a15
2019-01-29 12:39:54 -08:00
Richard Uhler
0145c883e0 Convert RollbackTest Android.mk to an Android.bp.
Which is more convenient for building a dummy apex module to test
rollback of staged installs.

Bug: 112431924
Test: atest RollbackTest

Change-Id: I30c2fc7d37ca30e47b49012edc02a1fc637ba6f6
2019-01-29 16:14:36 +00:00
Richard Uhler
2a48c29cb6 Specify status results for RollbackManager.commitRollback.
Rather than implicitly reusing the PackageInstaller status codes.

Bug: 112431924
Test: atest RollbackTest
Change-Id: I86929c0c1a5153c7f58e255e104b30fe96ddeca8
2019-01-29 13:35:56 +00:00
TreeHugger Robot
66a23d0504 Merge "Add a way to record causePackages for rollbacks." 2019-01-29 13:17:22 +00:00
Richard Uhler
bf5b5c4461 Add a way to record causePackages for rollbacks.
By passing a new causePackages list of VersionedPackage to
commitRollback and adding a RollbackInfo.getCausePackages() method to
retrieve the cause packages for committed rollbacks.

Bug: 112431924
Test: atest RollbackTest
Change-Id: I3b52511fd7e31b6304e7a7c34180dbb4d20f6dbf
2019-01-29 09:20:19 +00:00
Pavel Grafov
1f47ab08c1 Merge "Whitelist packages from VPN lockdown." am: 774c3ce152 am: b478bb25ac
am: 2b996ad0dd

Change-Id: Ice1f8f27da3d0092af58c8e93969575ba9f8f925
2019-01-28 22:13:24 -08:00
Pavel Grafov
2b996ad0dd Merge "Whitelist packages from VPN lockdown." am: 774c3ce152
am: b478bb25ac

Change-Id: I10094606f74e6cdc5f4b0b6591cf776fd895b1d3
2019-01-28 21:34:03 -08:00
Chris Tate
d10f95dcef Merge "Defer broadcasts to slow-handling apps" 2019-01-28 22:30:26 +00:00
Christopher Tate
2f558d2659 Defer broadcasts to slow-handling apps
When an app takes a long time to handle broadcasts, we start deferring
further broadcasts to it to make sure that other broadcast traffic in
the system can continue to make progress.  Global delivery order is
technically rearranged, but delivery order from the point of view of any
given app remains consistent with issuance order.

When alarm broadcasts are issued, we prioritize delivery of deferred
alarms to the alarm recipients (i.e. we suspend the deferral policy and
catch up as promptly as possible) in order to minimize wake time spent
waiting for the alarm broadcast to be delivered.  Once an app with a
deferred broadcast backlog is no longer the target of an in-flight
alarm, we re-impose deferral policy on it.

This policy intentionally trades off increased broadcast delivery
latency to apps that take a "long" time to handle broadcasts, in
exchange for lowering delivery latency to all other apps in the system
that would previously have had to wait behind the slow app.

In addition, broadcast dispatch policy parameters can now be overlaid
via the usual global Settings mechanism.  In particular, configuring the
"bcast_slow_time" parameter to a value in milliseconds higher than the
queue's broadcast timeout period will disable the new slow-receiver
policies.

Bug: 111404343
Test: device boots & runs
Test: tests/ActivityTests
Change-Id: I76ac79bdf41ca3cfcc48515bca779ea0f5744c0b
2019-01-28 12:32:41 -08:00
Pavel Grafov
774c3ce152 Merge "Whitelist packages from VPN lockdown." 2019-01-28 20:15:49 +00:00
Richard Uhler
e87368e1fd Commit rollbacks by ID, not by RollbackInfo.
To make it clear that the system only pays attention to the provided
rollback ID when committing a rollback.

Also, rename executeRollback to commitRollback in IRollbackManager.aidl,
now that we are touching the code anyway.

Bug: 112431924
Test: atest RollbackTest
Change-Id: I315e75c39019536fb2f090a0c84ed4cf7c03ce8c
2019-01-28 12:39:05 +00:00
Remi NGUYEN VAN
9a77141364 Merge "Move NetworkUtils used by NetworkStack" am: b8bbc48dee
am: 4c5b40e084

Change-Id: I0d6a40c79e92d1de18c41cc50b72fbe33db13bdc
2019-01-28 01:30:17 -08:00
Remi NGUYEN VAN
b8bbc48dee Merge "Move NetworkUtils used by NetworkStack" 2019-01-28 09:06:20 +00:00
Remi NGUYEN VAN
f6a3b910bb Merge "Add NetworkStack networking deps to SystemApi" am: 9188b49259
am: bc7a8f14f4

Change-Id: I843cb189750666a2cb70b1960d49dfe797f3cf36
2019-01-28 00:35:46 -08:00
Zimuzo
e5009cd82c Add PackageHealthObserverImpact
When a package fails health check, observers will report the impact of their
action on the user. Only the observer with the least user impact will be
allowed to take action.

Bug: 120598832
Test: atest PackageWatchdogTest
Change-Id: I15f358cd599431e1d7ea211aea5b1391f4aa33ab
2019-01-28 08:24:15 +00:00