Commit Graph

7662 Commits

Author SHA1 Message Date
Chalard Jean
fb342fcf55 Merge "Make NetworkCapabilities authoritative for suspended state" 2020-01-17 05:08:11 +00:00
Jorim Jaggi
72f8f1b4e6 Merge "Add test app for new Inset API's" 2020-01-16 18:52:20 +00:00
Mohammad Samiul Islam
8474b608a7 Merge "Revert "Revert "Make RollbackPackageHealthObserver observe apk-in-apex""" 2020-01-16 17:59:33 +00:00
TreeHugger Robot
ba8fe2f180 Merge "Add extra logging for Assert.isMainThread" 2020-01-16 15:40:06 +00:00
JW Wang
2d66ab9be8 Merge changes I7579d6c9,I329b1f1a,I46d08fe2
* changes:
  No need to call #updateRollbackLifetimeDurationInMillis (3/n)
  Register an OnPropertiesChangedListener in onBootCompleted (2/n)
  Squash runnables in onBootCompleted (1/n)
2020-01-16 14:21:13 +00:00
Mohammad Samiul Islam
e7e63a692a Revert "Revert "Make RollbackPackageHealthObserver observe apk-in-apex""
This reverts commit 400124c6ae.

Reason for revert: Fixed the compile error; TestAppACrashingV2 was not
available to com.android.apex.apkrollback.test_v1

Change-Id: Ic443e913b837c9bb2716678521ad1d12d3bc7e4d
2020-01-16 14:00:28 +00:00
Greg Kaiser
400124c6ae Revert "Make RollbackPackageHealthObserver observe apk-in-apex"
This reverts commit d56ce00039.

This revert is to fix the wembley build.

Test: Local wembley build
Change-Id: I651f20ffc6ba11cced5a2a737fd3d77211127221
2020-01-16 05:40:17 -08:00
Mohammad Samiul Islam
67d72581ac Merge "Make RollbackPackageHealthObserver observe apk-in-apex" 2020-01-16 12:48:16 +00:00
Jorim Jaggi
a31ca7caed Add test app for new Inset API's
Bug: 118118435
Change-Id: I53f09522a7859f15364dd2b71fa495256a830235
2020-01-16 12:27:46 +00:00
Gavin Corkery
fd2f68734c Merge "Integrate Rescue Party boot loop logic to Package Watchdog" 2020-01-16 11:12:55 +00:00
Chalard Jean
52638ac414 Make NetworkCapabilities authoritative for suspended state
...instead of NetworkInfo

Bug: 138306002
Test: FrameworksNetTests FrameworksTelephonyTests
Change-Id: I4808fcc0047a926b23ed3d49d979bb7b0371dc69
2020-01-16 15:32:23 +09:00
Beverly
2563d21629 Add extra logging for Assert.isMainThread
Test: atest SystemUiTests
Bug: 147685528
Change-Id: Ia041f98acaa35e5a89303cbdfa72c8965e8eab75
2020-01-15 14:47:22 -05:00
Gavin Corkery
aa57ef3e46 Integrate Rescue Party boot loop logic to Package Watchdog
Make Package Watchdog the component that receives calls
about boot events, and decides on whether or not to
perform mitigation action for a perceived boot loop.
The logic for selecting an observer to handle boot loops
is similar to how package failure is handled. The threshold
logic is the same as it was in Rescue Party (5 system server
boots in 10 minutes). Rescue Party maintains its own rescue
levels internally, which map to user impact levels.

Add optional onBootLoop() and executeBootLoopMitigation() methods
to PackageHealthObserver.

Add tests to handle the new cases handled by Package Watchdog.

Test: atest RescuePartyTest
Test: atest PackageWatchdogTest
Bug: 136135457
Change-Id: Ic435e60318e369509975c19a9888741e047803de
2020-01-15 19:20:57 +00:00
Automerger Merge Worker
de38d0529f Merge "Replace StringNetworkSpecifier & subId with TelephonyNetworkSpecifer" am: 7fd95f64df am: 4a76965c68 am: b8a357c250
Change-Id: I9aee20185e189e51d537b6b0895fdc31c31d0ea2
2020-01-15 18:39:33 +00:00
Automerger Merge Worker
b8a357c250 Merge "Replace StringNetworkSpecifier & subId with TelephonyNetworkSpecifer" am: 7fd95f64df am: 4a76965c68
Change-Id: I71d047b955cbb80519bca4cd15d4638dec3dc812
2020-01-15 18:24:31 +00:00
Mohammad Samiul Islam
d56ce00039 Make RollbackPackageHealthObserver observe apk-in-apex
Due to b/147666157, this CL will only work as long as an apk is not
embedded in two different apex.

Bug: 142712057
Test: StagedRollbackTest#testRollbackApexWithApkCrashing
Change-Id: I60f7f70b627fd380094a11373259debddd5dc532
2020-01-15 15:29:32 +00:00
Mohammad Samiul Islam
724b6028ef Merge changes from topic "rollback-all"
* changes:
  Allow handling of all pending staged rollback sessions before rebooting
  Add test for verifying all available rollbacks are triggered during native crash
2020-01-15 12:52:01 +00:00
JW Wang
4ff9d08435 No need to call #updateRollbackLifetimeDurationInMillis (3/n)
No need to call #updateRollbackLifetimeDurationInMillis manually inside
reloadPersistedData. Also fix tests since #reloadPersistedData no longer
pulls DeviceConfig changes.

Bug: 147712943
Test: atest StagedRollbackTest RollbackTest
Change-Id: I7579d6c969117189e01e0767decd1faeaa811eb9
2020-01-15 18:33:02 +08:00
Rambo Wang
818cf71da8 Replace StringNetworkSpecifier & subId with TelephonyNetworkSpecifer
StringNetworkSpecifier is widely used to specify subscription id for
the NetworkRequest. The raw string field introduce ambiguity and leave
large space for bugs. With TelephonyNetworkSpecifer, we are able to
settle down the type and value of the fields (although currently only
one) and introduce validation to detect the bug in the beginning.

Bug: 145993724
Test: atest FrameworksNetTests FrameworksTelephonyTests &
      make offline-sdk-docs
Change-Id: Iefbad9b1deb3de2c0b262d9ce5ae0704a50d08a6
2020-01-14 10:51:11 -08:00
Aaron Huang
94df39acd8 Remove framework code that has moved to frameworks/libs/net
Add srcs to framework and change import path.
Remove the codes which are moved to frameworks/libs/net.

Bug: 139268426
Bug: 135998869
Bug: 138306002
Bug: 143925787
Test: atest FrameworksNetTests
      atest FrameworksTelephonyTests
      atest ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: Ieb8927f9af7f87a5ae038bd6c7daeb3d70117fef
2020-01-14 18:10:39 +09:00
Mohammad Samiul Islam
2f9fa5c9da Allow handling of all pending staged rollback sessions before rebooting
When there is an unattributable native service crash during boot, we
rollback all packages available for rollback. In the current
implementation, we reboot immediately when a staged rollback session
becomes ready, even though there can be other staged rollback sessions
which are still being handled.

In this CL, the logic is changed to allow the health observer wait for
all staged sessions to be handled before rebooting.

Bug: 141843321
Test: atest StagedRollbackTest#testNativeWatchdogTriggersRollbackForAll
Test: atest StagedRollbackTest
Change-Id: Ib2aaee22868e5502b68847aa7f64e428070f7e3c
2020-01-14 09:04:21 +00:00
Chalard Jean
f41a9d0051 Merge "Have registerNetworkAgent return a Network." 2020-01-14 07:06:37 +00:00
Lorenzo Colitti
cae0b367e0 Merge "Add a Builder to NetworkAgentConfig, and make it SystemApi." 2020-01-14 05:01:06 +00:00
Chalard Jean
a0e2aa127a Have registerNetworkAgent return a Network.
This is more useful.

Bug: 135998869
Test: FrameworkNetTests FrameworksWifiTests
Change-Id: I74710b396fa3cec6fbae08d3dcab5bc90dc2e669
2020-01-14 13:59:55 +09:00
Lorenzo Colitti
7638966e93 Add a Builder to NetworkAgentConfig, and make it SystemApi.
Currently, only support the three elements in the config that are
known to be used.

Bug: 138306002
Test: builds, boots
Test: atest FrameworksTelephonyTests
Change-Id: I1d231ec2ddcff97c039bcbc815a39c1d3e26c410
2020-01-14 11:43:53 +09:00
Automerger Merge Worker
69f81d1f12 Merge "Support reevaluation request from captive portal app" am: ba43c13e77 am: 92718acb09 am: 5c9fe3df4a
Change-Id: Id0c020ade4c7de71f7540a82d84045e131ea25e2
2020-01-14 02:33:53 +00:00
Automerger Merge Worker
5c9fe3df4a Merge "Support reevaluation request from captive portal app" am: ba43c13e77 am: 92718acb09
Change-Id: Ie186aeac83cf30478ba0fedc0686b5e506e1add2
2020-01-14 02:17:06 +00:00
Chiachang Wang
ba43c13e77 Merge "Support reevaluation request from captive portal app" 2020-01-14 01:42:22 +00:00
Automerger Merge Worker
cd8f271923 [SP04] add unit test for NetworkStatsProvider am: 9ff7b4ed81 am: fbca4dae26 am: 66823dd6aa
Change-Id: Ic48609b113a7174204eaa2207901c8110d76f65f
2020-01-13 14:48:10 +00:00
Automerger Merge Worker
62dba7a4e6 Merge "Use new UnsupportedAppUsage annotation." am: b2c3eaaf10 am: 904b7f9de2
Change-Id: I62868fbcba5ffd65a441808e2a0cda59c9597654
2020-01-13 14:37:21 +00:00
Automerger Merge Worker
66823dd6aa [SP04] add unit test for NetworkStatsProvider am: 9ff7b4ed81 am: fbca4dae26
Change-Id: I0ce508b3ccf22b01603de7246b2068d3b1a2afcd
2020-01-13 14:28:10 +00:00
Treehugger Robot
b2c3eaaf10 Merge "Use new UnsupportedAppUsage annotation." 2020-01-13 14:27:29 +00:00
junyulai
fbca4dae26 [SP04] add unit test for NetworkStatsProvider
am: 9ff7b4ed81

Change-Id: Icd440ff9086604cb0baaa4cb3e8e458dcda3bb97
2020-01-13 06:12:48 -08:00
Junyu Lai
432f29f770 Merge changes from topic "sp04"
* changes:
  [SP05] add unit test for onStatsProviderLimitReached in NPMS
  [SP04] add unit test for NetworkStatsProvider
  [SP03] support registerNetworkStatsProvider API
  [SP03.1] Replace com.android.internal.util.Preconditions.checkNotNull
2020-01-13 14:09:52 +00:00
Mohammad Samiul Islam
9481762932 Add test for verifying all available rollbacks are triggered during native crash
Bug: 135977463
Test: atest StagedRollbackTest#testNativeWatchdogTriggersRollbackForAll
Change-Id: Iaff10b39207753434c216de5d462211c9826e69c
2020-01-13 11:35:20 +00:00
junyulai
9ff7b4ed81 [SP04] add unit test for NetworkStatsProvider
Test: atest NetworkStatsServiceTest
Bug: 130855321
Change-Id: I0c19d8bedcb9398da3f464efe01e775fde9f8a78
2020-01-13 14:43:06 +08:00
Chiachang Wang
207b6cff26 Support reevaluation request from captive portal app
CaptivePortalLogin use similar way to validate the network as
NetworkMonitor. Provide API to reuse NetworkMonitor facilities
for consistent captive portal detection.

Bug: 134892996
Test: atest FrameworksNetTests NetworkStackTests NetworkStackNextTests
Test: manually test with captive portal Wi-Fi
Test: make system-api-stubs-docs-update-current-api \
      test-api-stubs-docs-update-current-api
Change-Id: I6f039eae7ceb18eb6c3cf15587cdc27a7fe35b00
2020-01-13 14:28:02 +08:00
Lorenzo Colitti
d969656f45 Rename NetworkMisc to NetworkAgentConfig.
NetworkMisc is not really an appropriate name for a system API.

Bug: 138306002
Test: builds, boots, wifi works, telephony works
Test: atest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests
Change-Id: I621cfbe165996c67b201ca2dd2f95a5ab9af10ee
2020-01-13 15:01:52 +09:00
Automerger Merge Worker
c15b706790 Merge changes I7ea39b80,I6b9979f3 am: 310d1dac0d am: a27e14c240 am: ea6288bd2d
Change-Id: I97bd2471b04d9a6291b03a989ccd618c2dc70c6e
2020-01-13 04:51:33 +00:00
Automerger Merge Worker
ea6288bd2d Merge changes I7ea39b80,I6b9979f3 am: 310d1dac0d am: a27e14c240
Change-Id: If8cd7bd2c1fe4b698113eb761ed8e2b4f9580cf0
2020-01-13 04:34:10 +00:00
Lorenzo Colitti
6654b08619 Stop using NetworkFactory in connectivity code.
Bug: 138306002
Test: builds, boots
Test: atest FrameworksNetTests
Change-Id: I6b9979f343108c0c077abd86ae1c21e5ece0cccc
2020-01-12 17:40:02 +09:00
Mohammad Samiul Islam
a2fbe126c9 Merge changes from topic "rollback-of-apk-in-apex"
* changes:
  Check if number of packages enabled for rollback is equal to number of sessions
  Rollback user data of apks-in-apex while rolling back the apex
2020-01-10 21:13:26 +00:00
Rob Carr
57b072545f Merge "Introduce TaskOrganizer" 2020-01-10 20:27:27 +00:00
Mohammad Samiul Islam
3fcecfc1ce Rollback user data of apks-in-apex while rolling back the apex
Currently, the RollbackManager is not aware of the apk-in-apex being
installed since the install is done by PM during scan phase of boot. As
such, RM does not backup the user data of the apk-in-apex.

In the new implementation, we ask the RM to snapshot/restore user data
of apk-in-apex while resuming the apex session in StagingManager.

Bug: 142712057
Test: atest StagedRollbackTest#testRollbackApexWithApk
Test: atest AppDataRollbackHelperTest
Test: atest RollbackStoreTest
Test: atest RollbackUnitTest
Change-Id: Ibbaa5d0c98cb883588c085d77bc89c3e8217d76a
2020-01-10 16:15:47 +00:00
Automerger Merge Worker
61c7ade3a8 Merge "Add keepalive related methods and fields to system APIs" am: b7d665988d am: 23a2ee7ac2
Change-Id: Ie4cd12bb96a42f414d7026828e72eea16f4bd073
2020-01-10 06:31:54 +00:00
Aaron Huang
b7d665988d Merge "Add keepalive related methods and fields to system APIs" 2020-01-10 06:16:04 +00:00
Robert Carr
8a2f913ac4 Introduce TaskOrganizer
A first take at the TaskOrganizer API for allowing SysUI to control task presentation.
In this CL we introduce the first two primitives:
        1. The interface itself for implementation by SysUI
        2. Support for organizing a given windowing mode (but atm really only PIP)
We include a sample app that manages the PIP from an APPLICATION_OVERLAY window.

Bug: 139371701
Test: wmtests/TaskOrganizerTests. TaskOrganizerPipTest
Change-Id: I44a8ed311bc5f06285bba2c6ff3b37a7d19a9190
2020-01-09 13:04:18 -08:00
Hongming Jin
d261711e49 Merge "System action registration API for SystemUI" 2020-01-09 21:00:39 +00:00
Gavin Corkery
3df3e3b0bf Merge "Integrate Rescue Party with Package Watchdog" 2020-01-09 19:59:28 +00:00
Artur Satayev
54af4fc42a Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I547d7fb2e6bc2e9707bbc0d14dc1e8cd632c5a23
Merged-In: I547d7fb2e6bc2e9707bbc0d14dc1e8cd632c5a23
2020-01-09 13:52:18 +00:00