Commit Graph

12380 Commits

Author SHA1 Message Date
Lorenzo Colitti
a035f85997 Merge "Unbreak extraInfo values returned to apps." am: 877ef7634f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1624040

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib6560b94331f477cd7ea9df3c8f766b1eec49dfa
2021-03-11 08:26:47 +00:00
Lorenzo Colitti
877ef7634f Merge "Unbreak extraInfo values returned to apps." 2021-03-11 08:06:03 +00:00
Lorenzo Colitti
c612271990 Merge "Set extraInfo on cellular TestNetworkAgents." am: ab2f3d3cb5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1624039

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I66af2cf6b6cd286993fa3328c5cc52d8bba3beb9
2021-03-11 03:57:11 +00:00
Lorenzo Colitti
ab2f3d3cb5 Merge "Set extraInfo on cellular TestNetworkAgents." 2021-03-11 03:31:49 +00:00
Aaron Huang
433b9738b3 Merge "Remove IBatteryStats from ConnectivityService module" am: f3827cf444
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1623262

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibb2e02126cfaf13360e23e43f6f15a8a8254121a
2021-03-11 02:17:59 +00:00
Aaron Huang
f3827cf444 Merge "Remove IBatteryStats from ConnectivityService module" 2021-03-11 02:04:41 +00:00
Chiachang Wang
9ffb4d5e8b Merge "Remove hidden APIs usage regarding to dump" am: f4956c7502
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1622625

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I95aa9931607301a61dfee801de32242f75528d0b
2021-03-11 02:03:11 +00:00
Chiachang Wang
f4956c7502 Merge "Remove hidden APIs usage regarding to dump" 2021-03-11 00:28:54 +00:00
Chiachang Wang
9ddf7d3c36 Remove hidden APIs usage regarding to dump
Classes inside the incoming connectivity module will not be able
to access hidden APIs. The hidden DUMP_FLAG_PRIORITY_* flags
usage should be replaced. It was used to control the dump
priority. DEFAULT priority for services which is treated the
same as NORMAL priority. ConnectivityServiceInitializer took
both NORMAL and HIGH. It trigger different information dumped.
It's replaced with dumpsys that does not send "--dump-priority"
arguments to the service. Thus, design is replaced with
local parsing inside ConnectivitySerivce to provide equivalent
dump.

Bug: 172183305
Test: m ; flash and boot up
Test: adb bugreport ; adb dumpsys connectivity
Change-Id: Ib3c9d8692eb4382cd106734a1a716df6f48ffca4
2021-03-11 00:28:47 +00:00
Lorenzo Colitti
386f9a3662 Unbreak extraInfo values returned to apps.
These were broken by aosp/1553463, which made filterNetworkInfo
unconditionally call setDetailedState with a reason of "" and an
extraInfo of null.

Fix both synchronous getter APIs (e.g., getNetworkInfo) and
CONNECTIVITY_ACTION broadcasts by calling a new
filterForLegacyLockdown method that behaves similarly to how the
now-deleted LockdownVpnTracker#augmentNetworkInfo used to behave.

While I'm at it, move back to private a method that was public
only because LockdownVpnTracker used it.

Fix: 181855958
Test: new unit test coverage
Change-Id: I2c7b88fcec9dd36b45cb51db8d19b3ee8bad44a6
2021-03-11 00:59:14 +09:00
James Mattis
de47d2e4d1 Merge "frameworks: add test group for auto tests" am: 5845859186
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1595037

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7027594488771b408db82639fc6703c42beef186
2021-03-10 15:58:44 +00:00
James Mattis
5845859186 Merge "frameworks: add test group for auto tests" 2021-03-10 15:12:49 +00:00
Lorenzo Colitti
ad4e8837af Set extraInfo on cellular TestNetworkAgents.
This makes the test more realistic, since telephony always puts
the APN name in the extraInfo field. It also makes it easy to
test that various APIs properly return the extra info without
plumbing a new parameter through TestNetworkAgentWrapper,
NetworkAgentWrapper, and InstrumentedNetworkAgent.

Also make the extraInfo and the legacyType available to tests.
This will be used in future tests that assert the contents of
extraInfo.

Bug: 181855958
Test: test-only change
Change-Id: If4eddb6cd9e70bb33e10d72aceebaea843244246
2021-03-10 23:33:08 +09:00
Paul Hu
c80147e92b Merge "Replace PendingIntent#getIntent" am: e0b54f9303
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615190

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2e8256d6d33eb819904b8f972134bc4cd843e43f
2021-03-10 02:43:38 +00:00
Paul Hu
e0b54f9303 Merge "Replace PendingIntent#getIntent" 2021-03-10 02:13:11 +00:00
Chalard Jean
d7e0f35a90 Merge "Fix a bug where listen callbacks would not be called" am: 3b50ce7a6f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1620900

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I14a640aa21b464e7d6ced3086986e0dd79eaa019
2021-03-10 01:07:50 +00:00
Chalard Jean
3b50ce7a6f Merge "Fix a bug where listen callbacks would not be called" 2021-03-10 00:32:58 +00:00
Jun
76df56c7e3 frameworks: add test group for auto tests
Adding a seperate test tag into postsubmit so as to identify which tests
we want to run for automotive builds.

Test: atest --test-mapping [src]:auto-postsubmit
bug: 179917339
Change-Id: I3860fb6bf4f4174fad26cce5f7d6b43fd6494c0f
2021-03-09 15:54:39 -08:00
Aaron Huang
c3f79207ef Remove IBatteryStats from ConnectivityService module
Currently ConnectivityService calls the methods in
BatteryStatsService through BatteryStatsManager so
IBatteryStats can be removed from ConnectivityService.

Bug: 171686421
Test: FrameworksNetTests
Change-Id: I559369c9900e8100cdae187bc9cec603ed85a131
2021-03-09 21:39:17 +08:00
Zoey Chen
df270afdb6 Merge changes from topic "PSL_TelephonyCallback" am: f619c9967d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1614981

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Idd41c34f9e4dff1ca7930a9fc2a6f06ec8c316ba
2021-03-09 11:24:06 +00:00
Aaron Huang
9b58ed12cc Merge changes I1d1f0d2d,Ifbd4a978 am: 77ed87e072
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1475901

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I156b9230ef2ea495a6d1661c3f618de4a9c2ac2a
2021-03-09 11:14:40 +00:00
Zoey Chen
f619c9967d Merge changes from topic "PSL_TelephonyCallback"
* changes:
  [Telephony] Use TelephonyCallback instead of PhoneStateListener part1
  [PhoneStateListener] Redesign PhoneStateListener: Use TelephonyCallback
2021-03-09 10:36:03 +00:00
Aaron Huang
77ed87e072 Merge changes I1d1f0d2d,Ifbd4a978
* changes:
  Communicate with BatteryStatsService through BatteryStatsManager
  Add a new API in BatteryStatsManager for connectivity service
2021-03-09 10:33:56 +00:00
Chalard Jean
d67ab4df87 Fix a bug where listen callbacks would not be called
NetworkAgentInfos cache the list of requests they satisfy,
and that list is used to send callbacks. Therefore, when
the TRACK_DEFAULTs are copied, this list needs to be
updated.

The best way to do this is to figure out what was the old
active request and find which requests corresponds to it
in the new list, and then upon registering adding the
active request to the relevant satisfier if present.

A few other ways can be considered like replacing the
request as it gets added, but this would temporarily
increase the number of callbacks allocated to the app
and risks crashing it for no good reason ; furthermore
the call to remove would have to be eschewed somehow
for those requests that are replaced. This is much
simpler.

Test: new test for this. This also passes the future
      tests for per-profile default network preference.
Change-Id: I001351e5c478c2c77cbf2844abca77b205291778
2021-03-09 19:05:55 +09:00
Chalard Jean
3d4e6deeb3 Merge "Replace withCleanCallingIdentity with [clear|restore]CallingIdentity" am: aaef65de42
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615182

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I376927831333a78dc2c60b5be23324b8f0395c58
2021-03-09 08:07:32 +00:00
Chalard Jean
aaef65de42 Merge "Replace withCleanCallingIdentity with [clear|restore]CallingIdentity" 2021-03-09 07:41:13 +00:00
Aaron Huang
e044c46257 Communicate with BatteryStatsService through BatteryStatsManager
Mainline connectivity service is only allowed to use formal
APIs. Use new system API in BatteryStatsManager instead of
calling BatteryStatsService directly.

Bug: 171686421
Test: FrameworksNetTests
Change-Id: I1d1f0d2d456003e842ad77519667c0532995610d
Merged-In: I1d1f0d2d456003e842ad77519667c0532995610d
2021-03-09 06:29:30 +00:00
paulhu
94c60a99c7 Replace PendingIntent#getIntent
Connectivity is becoming a mainline module in S but mainline
modules are not allowed to use non-formal APIs. Thus, replace
non-formal API PendingIntent#getIntent to new formal API
PendingIntent#intentFilterEquals.

Bug: 174237997
Test: FrameworksNetTests
Change-Id: Ic5e27f812bd42dbc80b9d29d81303df4dd5e8199
2021-03-09 05:43:05 +00:00
Lucas Lin
ee5644f6b5 Merge "Use ArraySet#add() instead of ArraySet#append()" am: 627c6a5258
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615181

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1991567f130f3afee6c6bcb78a9254b45e14f6e4
2021-03-09 05:31:26 +00:00
Lucas Lin
627c6a5258 Merge "Use ArraySet#add() instead of ArraySet#append()" 2021-03-09 04:52:42 +00:00
Zoey Chen
dbc2df30cb [Telephony] Use TelephonyCallback instead of PhoneStateListener part1
Since the redesign of PhoneStateListener, use TelephonyCallback to get the callback of EVENT_*

Bug: 167684594
Test: make
Change-Id: Ia3b777b12142b104b5798804f50b34748f9bf28c
Merged-In: Ia3b777b12142b104b5798804f50b34748f9bf28c
2021-03-08 20:25:00 +08:00
Remi NGUYEN VAN
37aa459906 Merge "Move OemNetworkPreferences to Connectivity" am: c61a6fc426
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1620981

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9adc394b0c203cdb1045f50e83487ea0c2000632
2021-03-08 09:12:05 +00:00
Remi NGUYEN VAN
c61a6fc426 Merge "Move OemNetworkPreferences to Connectivity" 2021-03-08 08:41:04 +00:00
Paul Hu
cdb81da32c Merge "Replace Inet[4|6]Address#ANY" am: 3483a8be68
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615184

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I45cf2b37c775da158cdec2d3b7f50ac491d2fca8
2021-03-08 08:05:59 +00:00
Paul Hu
3483a8be68 Merge "Replace Inet[4|6]Address#ANY" 2021-03-08 07:20:21 +00:00
paulhu
ee4cd637e3 Replace Inet[4|6]Address#ANY
Connectivity is becoming a mainline module in S but mainline
modules are not allowed to use non-formal APIs. Thus, replace
non-formal API Inet[4|6]Address#ANY to
NetworkStackConstants#IPV[4|6]_ADDR_ANY.

Bug: 181756157
Test: FrameworksNetTests
Change-Id: Id4d2fc551c1384f549a586e87ab68356ba05b995
2021-03-08 07:18:31 +00:00
Frank Li
defaaf05a4 Merge "[CS10]Remove the hidden API usage of BitUtils" am: 02d57fc2ae
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615192

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia0dcd92a896a759e65ada070f16394db216b07b8
2021-03-08 02:14:44 +00:00
Remi NGUYEN VAN
9930f13c67 Move OemNetworkPreferences to Connectivity
The data class supports a ConnectivityManager API, so it should be
together with the ConnectivityManager API surface.

Bug: 181512874
Test: m
Change-Id: I5642486ea0febcb08cadcbd4cd3f0c6056deae0e
2021-03-08 09:26:41 +09:00
lifr
c33ea4de7d [CS10]Remove the hidden API usage of BitUtils
The connection service will become the main line module.
It is difficult to include BitUtils in the module. and so
Move the hidden API needed in BitUtils to NetworkCapabilitiesUtils.

Bug: 170598012
Test: atest ConnectivityServiceTest
      atest NetworkCapabilitiesTest
      atest DnsUtilsTest
Change-Id: Ibc81827e25a54fc3ff94f78d810fe4f5073e3a98
2021-03-06 16:21:16 +00:00
James Mattis
00f75b0b32 Merge "Applying OEM network pref to all users" am: 3f0925ee2e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612760

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id805612e7b807dd789c4ff88a933660fb11b12cf
2021-03-05 21:39:23 +00:00
James Mattis
3f0925ee2e Merge "Applying OEM network pref to all users" 2021-03-05 19:09:24 +00:00
Remi NGUYEN VAN
65982d493b Merge "Move NetworkState to Connectivity" am: 4d2ad2a68a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1620379

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie8eda98704327d894b59c335753739600b87f670
2021-03-05 11:33:30 +00:00
Remi NGUYEN VAN
4d2ad2a68a Merge "Move NetworkState to Connectivity" 2021-03-05 10:27:57 +00:00
Aaron Huang
3c79f13642 Merge "Use NetworkCallback in BatteryStatsService to get connectivity change" am: 74850ac20e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1574864

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If6fd08a8ba2bcbe4a955c245f49be517794f8a91
2021-03-05 07:45:53 +00:00
Aaron Huang
74850ac20e Merge "Use NetworkCallback in BatteryStatsService to get connectivity change" 2021-03-05 07:03:51 +00:00
Treehugger Robot
f216522f0f Merge "[FUI22] Support getAllNetworkStateSnapshot" am: bcbc04f329
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1614779

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I70cbeb9d2b5b4cb2d09d31444b5d60e887b7e8c2
2021-03-05 05:53:33 +00:00
Remi NGUYEN VAN
4386582dd2 Merge "Replace user with debuggable check in ConnectivityService" am: a923322f24
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615085

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ieb729be68e810972506b1d8a3960dfc371a294b1
2021-03-05 05:50:47 +00:00
Chalard Jean
9b385fa220 Merge "Generalize some PANS methods" am: b639d79547
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612258

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7baa17a0f882ec21f766c9f7dc2c0694853fb467
2021-03-05 05:47:57 +00:00
Chiachang Wang
658a53ccef Merge "Have the DataConnectionStat started from BSS" am: 86dce50c72
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1607895

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7f9e9d496c92e86609871c93a08b819b3704314f
2021-03-05 05:37:43 +00:00
Janis Danisevskis
d8fb75701d Merge "Keystore 2.0: Make VPN Keystore 2.0 ready." am: c410b053b9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1569502

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I97b24a5462f42773df919bd1d7acf9a9c5dcd43c
2021-03-05 05:17:12 +00:00