Commit graph

10,936 commits

Message SHA1
Merge "NetworkNotificationManager gets NotificationManager locally" am: a13966feea am: d0034c56c1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1459882

Change-Id: I3663ea2b95ec7815e84fa0729c39591280a90847

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-10-30 11:15:15 +00:00
0776d454a2
Merge "NetworkNotificationManager gets NotificationManager locally" am: a13966feea
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1459882

Change-Id: I1a3b685f04d7b4d7d5a028015e94742c83db2dc8

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-10-30 10:37:17 +00:00
d0034c56c1
Merge "Replace NotificationManager @hide APIs" am: 39516dec37 am: 9fead7cb6e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1452435

Change-Id: I89085c9a06abd61d987659f7283f8dfdc7718c3a

Paul Hu   authored and   Automerger Merge Worker   commited 2020-10-30 04:40:38 +00:00
91bf3e71e3
Merge "Replace NotificationManager @hide APIs" am: 39516dec37
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1452435

Change-Id: I58d1c42c112855e43df6d6af4cd6e10373cff2bb

Paul Hu   authored and   Automerger Merge Worker   commited 2020-10-30 04:00:36 +00:00
9fead7cb6e
NetworkNotificationManager gets NotificationManager locally
It's confusing that NetworkNotificationManager uses
NotificationManager to put up notifcation which is passed from
ConnectivityService. And that NotificationManager should be
gotten from a context with UserHandle.ALL because the
notification should notify to all users. But the future developer
may not know this and pass incorrect NotificationManager
probably. Therefore, adjust the design that
NetworkNotificationManager will get NotificationManager locally.

Bug: 170593746
Test: atest FrameworksNetTests
Change-Id: Id65c998052b7b223171c5194ea46b49d7e84729d

paulhu   authored and   Paul Hu   commited 2020-10-30 03:37:50 +00:00
13cafd92b9
Merge "Replace NotificationManager @hide APIs"
Paul Hu   authored and   Gerrit Code Review   commited 2020-10-30 03:36:40 +00:00
39516dec37
Merge "Fix a bug where modern network agents start in UNKNOWN" am: 0512d7cd48 am: 8d783edbe8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1460964

Change-Id: I1acdfe14a14bfca15967efe2d97b653691e259f8

Chalard Jean   authored and   Automerger Merge Worker   commited 2020-10-29 13:30:39 +00:00
b3dcc65424
Merge "Fix a bug where modern network agents start in UNKNOWN" am: 0512d7cd48
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1460964

Change-Id: I69c5b8712791491552879c6d5aba5352ea03adfc

Chalard Jean   authored and   Automerger Merge Worker   commited 2020-10-29 13:10:05 +00:00
8d783edbe8
Merge "Fix a bug where modern network agents start in UNKNOWN"
Chalard Jean   authored and   Gerrit Code Review   commited 2020-10-29 12:31:03 +00:00
0512d7cd48
Fix a bug where modern network agents start in UNKNOWN
Modern network agents are supposed to have the following
lifecycle :
• Construct the agent
• Declare itself to connectivity by calling #register()
• Possibly do some setup
• Declare connected by calling #markConnected()
• Declare disconnected by calling #unregister()

Internally ConnectivityService still manages the state
with deprecated NetworkInfo, which has a lot of possible
detailed states, most of which are now unused. Internally,
the steps above translate to the states below :
• When the agent calls #register() it starts in state
  CONNECTING
• When it calls #markConnected() it goes to CONNECTED
• When it calls #unregister() it goes to DISCONNECTED which
  triggers the flow that disconnects it immediately
• ConnectivityService also synthesizes the SUSPENDED state
  under some situations, but that's not relevant here.

The translation above is done by the NetworkAgent class,
which translates #register(), #markConnected() and
The only valid lifecyle for new agents is thus :

CONNECTING → CONNECTED → disconnect
                 ↕         ↑
             SUSPENDED ───┘

Note that in the above scheme, there is no space for the
UNKNOWN state, which is only used by legacy network agents.
However, the constructor for NetworkInfo still starts with
UNKNOWN. Ideally the constructor for NetworkInfo would set
the info to CONNECTING instead, but this would be a very
visible change in behavior affecting many apps (especially
their tests), so for backward compatibility we can't do
that.

New network agents however don't expose their NetworkInfo
to the client code, so they can just be made to start in
CONNECTING the way it was meant.

Note that this didn't really have a concrete impact beyond
printing some logs as by and large the ConnectivityService
code handles UNKNOWN and CONNECTING the same way, or more
exactly it handles transitions to CONNECTED from UNKNOWN
and CONNECTING in the same way. The exception to this is
VPNs, which are not using the new agent API yet, and the
upcoming conversion is why this fix is actually needed now.

Bug: 170904131
Test: FrameworksNetTests NetworkStackTests
Test: new test in aosp/1460705
Change-Id: Ib7d906a7b29a0b9f000b90bc78558a7402852fa3

Chalard Jean   commited 2020-10-29 12:30:44 +00:00
a7f72cbe55
Merge "Replace hidden NMS permission control API" am: 67a478d08d am: 89f3f29524
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1473957

Change-Id: I45135311ec026b75d1110614f609b851b72f543b

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-10-29 07:47:31 +00:00
a5c301c629
Merge "Replace hidden NMS permission control API" am: 67a478d08d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1473957

Change-Id: I44840dc0c5ab4421976f606afcced0573e3dfe60

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-10-29 07:34:41 +00:00
89f3f29524
Merge "Replace hidden NMS permission control API"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-10-29 07:03:37 +00:00
67a478d08d
Merge changes from topic "revert-1353490-revert-1323251-ipv6_prov_loss_quirk_parcelable-DVBHZDYMHA-MDHWFKJABZ" am: 780d3d2115 am: ee3d2e049d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1460265

Change-Id: Ibfd085b283caf6a531cbdf752e009317eb105287

Xiao Ma   authored and   Automerger Merge Worker   commited 2020-10-29 06:35:46 +00:00
f7808179b4
Revert "Revert "Test IPv6ProvisioningLossParcelable in the NetworkAttributes""" am: ef20ba23a4 am: 8323b72ef0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1460264

Change-Id: Ie6b10f73ac6508b83e240e74a215edbe58901be3

Xiao Ma   authored and   Automerger Merge Worker   commited 2020-10-29 06:35:44 +00:00
c1d48c0444
Merge changes from topic "revert-1353490-revert-1323251-ipv6_prov_loss_quirk_parcelable-DVBHZDYMHA-MDHWFKJABZ" am: 780d3d2115
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1460265

Change-Id: I49ce3e1c7794dc6db0e410cba481eb98144bc4e5

Xiao Ma   authored and   Automerger Merge Worker   commited 2020-10-29 06:17:22 +00:00
ee3d2e049d
Revert "Revert "Test IPv6ProvisioningLossParcelable in the NetworkAttributes""" am: ef20ba23a4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1460264

Change-Id: Ie13b2bb8037d85ab4782e06cfc31e108397fc78b

Xiao Ma   authored and   Automerger Merge Worker   commited 2020-10-29 06:09:44 +00:00
8323b72ef0
Merge changes I6a51d803,I162fae5c am: b75c584971 am: 18013cefe3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1473228

Change-Id: I61cdda413fe21a46ac075a0abba2b9affa015149

Chiachang Wang   authored and   Automerger Merge Worker   commited 2020-10-29 05:52:33 +00:00
2d6e0ab8e7
Merge "Replace hidden NMS interface to network API" am: 689399aa75 am: 667b09128d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1473224

Change-Id: Ifc403211281b58bf25c9e7c652a863368b80deae

Chiachang Wang   authored and   Automerger Merge Worker   commited 2020-10-29 05:52:12 +00:00
cf129dae9f
Merge changes from topic "revert-1353490-revert-1323251-ipv6_prov_loss_quirk_parcelable-DVBHZDYMHA-MDHWFKJABZ"
* changes:
  Add jarjar rule for IPv6ProvisioningLossQuirk.
  Revert "Revert "Test IPv6ProvisioningLossParcelable in the NetworkAttributes"""

Xiao Ma   authored and   Gerrit Code Review   commited 2020-10-29 05:39:16 +00:00
780d3d2115
Merge changes I6a51d803,I162fae5c
* changes:
  Replace hidden NMS API for setting MTU
  Replace hidden NMS default network configuration API

Chiachang Wang   authored and   Gerrit Code Review   commited 2020-10-29 05:03:43 +00:00
b75c584971
Merge "Replace hidden NMS interface to network API"
Chiachang Wang   authored and   Gerrit Code Review   commited 2020-10-29 05:02:21 +00:00
689399aa75
Replace NotificationManager @hide APIs
Connectivity service module is using some NotificationManager
@hide APIs but they are not able to call after CS become a
mainline module. Thus, replace them with similar System APIs.

Bug: 170593746
Test: atest FrameworksNetTests
Change-Id: I2644867cfc01d8d651c7029134294a9d44fdb471

paulhu   commited 2020-10-28 16:24:37 +08:00
e7a50004d8
Replace hidden NMS permission control API
Replace the hidden setNetworkPermission NMS APIs with accessing
INetd directly for the incoming ConnectivityService mainline.

Bug: 170598012
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Change-Id: I37ed1003355677b98cbb741f774ba0fa4d193572

Chiachang Wang   commited 2020-10-28 14:38:18 +08:00
9695da3ba0
Replace hidden NMS API for setting MTU
Replace the hidden NMS setMtu API with calling INetd directly
for incoming ConnectivityService mainline.

Bug: 170598012
Test: atest FrameworksNetTests
Test: manually connect and disconnect network
Change-Id: I6a51d8033b3354824d4cfb953c2bbe3055d00102

Chiachang Wang   commited 2020-10-28 14:38:18 +08:00
fd47831a5c
Replace hidden NMS interface to network API
Replace the hidden NMS addInterfaceToNetwork and
removeInterfaceFromNetwork with calling INetd directly for
incoming ConnectivityService mainline.

Bug: 170598012
Test: atest FrameworksNetTests
Test: manually connect and disconnect network
Change-Id: I0f1f866be2f8084b992b340aeabfb5d62420686b

Chiachang Wang   commited 2020-10-28 14:38:18 +08:00
a93ddb250b
Replace hidden NMS default network configuration API
Replace the hidden setDefaultNetId and clearDefaultNetId NMS
APIs with accessing INetd directly for the incoming
ConnectivityService mainline.

Bug: 170598012
Test: atest FrameworksNetTests
Test: manually connect and disconnect wifi
Change-Id: I162fae5ca444207a037e5ac4bf8fa0a77a648ca1

Chiachang Wang   commited 2020-10-28 14:38:18 +08:00
c1fe7a0a37
Merge "Add OEM_PRIVATE NetworkCapability" am: 7415f6f9b5 am: 32fbc09bd0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1472326

Change-Id: I3eeeb071bf77c9f71ba54a680b7d43936200b12e

James Mattis   authored and   Automerger Merge Worker   commited 2020-10-27 23:57:19 +00:00
73877e08a8
Add OEM_PRIVATE NetworkCapability
Adding network capability to be used with networks to be only used by
OEM apps.

Bug: 171505922
Test: atest CtsNetTestCasesLatestSdk:NetworkCapabilitiesTest
Change-Id: Ib55ebec0e178b6317d92f17e1aff060dacdfb2b1

James Mattis   commited 2020-10-27 13:14:06 -07:00
b3b4899980
Add jarjar rule for IPv6ProvisioningLossQuirk.
A new stable parcelable IPv6ProvisioningLossQuirk added in network
stack module, which is used to record the network quirk info which
causes IPv6 provisioning loss, e.g. the router lifetime in RA is 0
and the default route will be removed from LinkProperties.

Previously this change breaks CtsStrictJavaPackagesTestCases due to
a jarjar rule is missed. Also rename the package name based on the
revert change.

Also include slight stable AIDL package and variable rename.

Bug: 157534516
Test: atest CtsStrictJavaPackagesTestCases FrameworksNetTests
Change-Id: Ic2f6b75beefb574f7e2fb4c157667e7734eccd05

Xiao Ma   commited 2020-10-27 08:04:29 +00:00
1cd2532d26
Revert "Revert "Test IPv6ProvisioningLossParcelable in the NetworkAttributes"""
Test IPv6ProvisioningLossParcelable in the NetworkAttributes.

Bug: 157534516
Test: atest NetworkStackTests

This reverts commit_3740bfadadaaf268f92aaf35dd92e4ce432b39cb

Reason for revert:
Roll forward the previous change, as the CtsStrictJavaPackagesTestCases
breakage has been addressed by adding the jarjar rule in wifi module.

Change-Id: Ib4d70ce557cad98643c811b219f51e9b68179ee8

Xiao Ma   commited 2020-10-27 07:49:05 +00:00
ef20ba23a4
Merge "Replace PendingIntent @hide APIs" am: 3b32517990 am: 97adf1f334
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1456121

Change-Id: I18693b621bcae7a011719324bd8bede302d22efb

Paul Hu   authored and   Automerger Merge Worker   commited 2020-10-26 07:59:15 +00:00
1847f9be9a
Merge "Replace PendingIntent @hide APIs"
Paul Hu   authored and   Gerrit Code Review   commited 2020-10-26 07:32:56 +00:00
3b32517990
Merge "Add a mutability flag to the PendingIntent" am: 315a097740 am: 0cfb318d10
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1456120

Change-Id: Id09c2c39f6ba7ecd68d1b5c792b300ae33c30278

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-10-23 10:27:28 +00:00
fd2447df82
Merge "Add a mutability flag to the PendingIntent"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-10-23 09:49:27 +00:00
315a097740
Merge "Using Context#getSystemService instead of ServiceManager#checkService" am: d769b3863e am: bb6fc081c2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1463902

Change-Id: I453b183add07e6b3e3d24138d62ceb2c800710cc

Lucas Lin   authored and   Automerger Merge Worker   commited 2020-10-23 04:30:27 +00:00
884546597e
Using Context#getSystemService instead of ServiceManager#checkService
ConnectivityService is going to be a mainline module, it can only
use formal APIs or @SystemApi. So use public API -
Context#getSystemService() instead of hidden API -
ServiceManager#checkService().

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: I9824caa7aec57e70f0ba405fcce39f9bc068732d

lucaslin   authored and   Lucas Lin   commited 2020-10-23 03:07:07 +00:00
f0d393d530
Merge "Address comments on aosp/1448415" am: bc7602e296 am: bafa575166
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1465505

Change-Id: I86a2f48ee199c83c429d99d5025ece56f42251cd

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-10-21 08:03:39 +00:00
1f4d324fc7
Merge "Do not use hidden SystemProperties.set" am: 93961f7b21 am: d7146b6742
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1460971

Change-Id: I3ff0ce12f3b12e0eb78f330a75675fb79ecf561d

Chiachang Wang   authored and   Automerger Merge Worker   commited 2020-10-21 07:55:31 +00:00
b2d82398a6
Merge "Address comments on aosp/1448415"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-10-21 07:05:49 +00:00
bc7602e296
Merge "Do not use hidden SystemProperties.set"
Chiachang Wang   authored and   Gerrit Code Review   commited 2020-10-21 07:00:56 +00:00
93961f7b21
Address comments on aosp/1448415
Adds the necessary jarjar rules to FrameworksTestNet and
removes the test for CompareResult which has moved to its
right place.

Test: FrameworksTestNet
Change-Id: I50e51e72268e432a65a831aa5eebd606584ac721

Chalard Jean   commited 2020-10-21 13:54:02 +09:00
c8b4e0124d
Merge "Remove @TestApi from @SystemApi symbols" am: 49ca9d3ca9 am: cbe282347e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1466264

Change-Id: I86daec690141893837ec58ab1d75aecc88557ff9

Anton Hansson   authored and   Automerger Merge Worker   commited 2020-10-20 19:45:04 +00:00
9cd59a3529
Merge "Remove unused MockableSystemProperties from DnsManager constructor" am: 3e23d7271b am: 250a9d3d20
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1466231

Change-Id: Ib8464068df47baebd3d56c66f6b517d8f59da4f9

Chiachang Wang   authored and   Automerger Merge Worker   commited 2020-10-20 19:44:46 +00:00
672ee3eef5
Merge "Create service-connectivity.jar" am: 4a19a57729 am: b91257f553
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1351252

Change-Id: Ic068be012bee6d8b1cd7b974896da9750e6ca453

Aaron Huang   authored and   Automerger Merge Worker   commited 2020-10-20 19:42:46 +00:00
acc01f1346
Merge "Remove @TestApi from @SystemApi symbols"
Anton Hansson   authored and   Gerrit Code Review   commited 2020-10-20 13:45:13 +00:00
49ca9d3ca9
Do not use hidden SystemProperties.set
ConnectivityService is going to become a mainline module, and
it will not able to use hidden method anymore. Thus, use
alternative new sysprop as API to control the tcp init rwnd
value.

Bug: 170917042
Test: adb shell getprop net.tcp_def_init_rwnd and check if
      value is set correctly
Test: atest FrameworksNetTests
Change-Id: If9e99c88de50b6829721b0dfacc430a3b53c7728

Chiachang Wang   commited 2020-10-20 19:35:01 +08:00
c43d68f0d0
Remove unused MockableSystemProperties from DnsManager constructor
DnsManager does not use MockableSystemProperties to communicate
with netd to configure the dns server anymore. ConnectivityService
does not need to take it into DnsManager as a parameter. Thus,
clean up the unused code.

Bug: 33308258
Test: atest FrameworksNetTests
Change-Id: I2ac89944391f7d1fd5d67f26cf7f2b11a4a4cf84

Chiachang Wang   commited 2020-10-20 15:46:30 +08:00
6710686910
Merge "Create service-connectivity.jar"
Aaron Huang   authored and   Gerrit Code Review   commited 2020-10-20 06:09:41 +00:00
4a19a57729
Remove @TestApi from @SystemApi symbols
I ran these commands:
    cd frameworks/base
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs'
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs'

Bug: 171179806
Test: m checkapi
Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789
Merged-In: I772790b783b0a8730b8bf680c9e569a886b8d789

Anton Hansson   commited 2020-10-19 16:41:01 +01:00
f4d863eb95