Commit Graph

11957 Commits

Author SHA1 Message Date
Mathew Inwood
78d8a0e947 [automerger skipped] Add maxTargetSdk restriction to unused APIs. am: d771d6e94d -s ours
am skip reason: Change-Id I8285daa8530260251ecad6f3f38f98e263629ca7 with SHA-1 d078d3d65a is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12967795

Change-Id: I7640cc309f990c400ff3a7db6de77a71bb0f1d72
2020-11-02 15:04:11 +00:00
Mathew Inwood
d771d6e94d Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Merged-In: I8285daa8530260251ecad6f3f38f98e263629ca7
Change-Id: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
2020-11-02 10:30:09 +00:00
Treehugger Robot
2e6e66df94 Merge "NetworkNotificationManager gets NotificationManager locally" am: a13966feea am: d0034c56c1 am: 0776d454a2 am: 29001506d8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1459882

Change-Id: Ib82fdb4eb61b7d52e0011271da81c30606dbe3c3
2020-10-30 11:54:12 +00:00
Treehugger Robot
29001506d8 Merge "NetworkNotificationManager gets NotificationManager locally" am: a13966feea am: d0034c56c1 am: 0776d454a2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1459882

Change-Id: Ib457623c1d204f8b83918a13c662335b4b9aded0
2020-10-30 11:25:49 +00:00
Treehugger Robot
0776d454a2 Merge "NetworkNotificationManager gets NotificationManager locally" am: a13966feea am: d0034c56c1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1459882

Change-Id: I3663ea2b95ec7815e84fa0729c39591280a90847
2020-10-30 11:15:15 +00:00
Treehugger Robot
d0034c56c1 Merge "NetworkNotificationManager gets NotificationManager locally" am: a13966feea
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1459882

Change-Id: I1a3b685f04d7b4d7d5a028015e94742c83db2dc8
2020-10-30 10:37:17 +00:00
Paul Hu
e5fcad7f3b Merge "Replace NotificationManager @hide APIs" am: 39516dec37 am: 9fead7cb6e am: 91bf3e71e3 am: 6818725de8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1452435

Change-Id: Iaf9363492fb24714750314765439a4edec7d948c
2020-10-30 05:04:17 +00:00
Paul Hu
6818725de8 Merge "Replace NotificationManager @hide APIs" am: 39516dec37 am: 9fead7cb6e am: 91bf3e71e3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1452435

Change-Id: I41c548b42717f65e0e2421f1ad72e027408aa7ce
2020-10-30 04:51:53 +00:00
Paul Hu
91bf3e71e3 Merge "Replace NotificationManager @hide APIs" am: 39516dec37 am: 9fead7cb6e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1452435

Change-Id: I89085c9a06abd61d987659f7283f8dfdc7718c3a
2020-10-30 04:40:38 +00:00
Paul Hu
9fead7cb6e Merge "Replace NotificationManager @hide APIs" am: 39516dec37
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1452435

Change-Id: I58d1c42c112855e43df6d6af4cd6e10373cff2bb
2020-10-30 04:00:36 +00:00
paulhu
13cafd92b9 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
2020-10-30 03:37:50 +00:00
Paul Hu
39516dec37 Merge "Replace NotificationManager @hide APIs" 2020-10-30 03:36:40 +00:00
Mathew Inwood
ce2e083b30 Merge "Add maxTargetSdk restriction to unused APIs." 2020-10-29 15:23:24 +00:00
Chalard Jean
e9cffb6f3d Merge "Fix a bug where modern network agents start in UNKNOWN" am: 0512d7cd48 am: 8d783edbe8 am: b3dcc65424 am: 20b2858a92
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1460964

Change-Id: I4de127e0ce7f4fc0591ee59e65a60592e96efbfc
2020-10-29 14:32:37 +00:00
Chalard Jean
20b2858a92 Merge "Fix a bug where modern network agents start in UNKNOWN" am: 0512d7cd48 am: 8d783edbe8 am: b3dcc65424
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1460964

Change-Id: I9a6b1bbb4e0bfa9e902add0476aaa44d40d5198e
2020-10-29 13:52:57 +00:00
Chalard Jean
b3dcc65424 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
2020-10-29 13:30:39 +00:00
Chalard Jean
8d783edbe8 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
2020-10-29 13:10:05 +00:00
Chalard Jean
0512d7cd48 Merge "Fix a bug where modern network agents start in UNKNOWN" 2020-10-29 12:31:03 +00:00
Chalard Jean
a7f72cbe55 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
2020-10-29 12:30:44 +00:00
Mathew Inwood
d078d3d65a Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

This is a resubmit of ag/12929664 with some APIs excluded that caused
test failures; see bugs 171886397, 171888296, 171864568.

APIs excluded:
Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord;
Landroid/os/Process;->myPpid()I
Landroid/os/SharedMemory;->getFd()I
Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I

Bug: 170729553
Test: Treehugger
Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
2020-10-29 11:51:12 +00:00
Treehugger Robot
f30a0ed252 Merge "Replace hidden NMS permission control API" am: 67a478d08d am: 89f3f29524 am: a5c301c629 am: 1f8a2bda71
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1473957

Change-Id: Ib53b5efe2af87f21563de0d883fce86afbdb89d7
2020-10-29 08:47:51 +00:00
Treehugger Robot
1f8a2bda71 Merge "Replace hidden NMS permission control API" am: 67a478d08d am: 89f3f29524 am: a5c301c629
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1473957

Change-Id: Ie55d43f42235fbfc570f8088a9459dba99008799
2020-10-29 08:06:04 +00:00
Treehugger Robot
a5c301c629 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
2020-10-29 07:47:31 +00:00
Treehugger Robot
89f3f29524 Merge "Replace hidden NMS permission control API" am: 67a478d08d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1473957

Change-Id: I44840dc0c5ab4421976f606afcced0573e3dfe60
2020-10-29 07:34:41 +00:00
Xiao Ma
e75400be3d Merge changes from topic "revert-1353490-revert-1323251-ipv6_prov_loss_quirk_parcelable-DVBHZDYMHA-MDHWFKJABZ" am: 780d3d2115 am: ee3d2e049d am: f7808179b4 am: c95be48120
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1460265

Change-Id: I5c6bf738b8fc24c65e0ac256ed4b595cfb8a34fe
2020-10-29 07:28:15 +00:00
Xiao Ma
eeafbc5738 Revert "Revert "Test IPv6ProvisioningLossParcelable in the NetworkAttributes""" am: ef20ba23a4 am: 8323b72ef0 am: c1d48c0444 am: 9180884b13
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1460264

Change-Id: I0c28f689e056dc4ac5d6750c9f5c74ce49c8a103
2020-10-29 07:27:51 +00:00
Treehugger Robot
67a478d08d Merge "Replace hidden NMS permission control API" 2020-10-29 07:03:37 +00:00
Xiao Ma
c95be48120 Merge changes from topic "revert-1353490-revert-1323251-ipv6_prov_loss_quirk_parcelable-DVBHZDYMHA-MDHWFKJABZ" am: 780d3d2115 am: ee3d2e049d am: f7808179b4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1460265

Change-Id: I38ca7a3d1a07d511d99beb9fbe3eb48b265d40e9
2020-10-29 06:50:05 +00:00
Xiao Ma
9180884b13 Revert "Revert "Test IPv6ProvisioningLossParcelable in the NetworkAttributes""" am: ef20ba23a4 am: 8323b72ef0 am: c1d48c0444
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1460264

Change-Id: If0b8d031b80b9cd8315327211ede0be1a58df44f
2020-10-29 06:49:56 +00:00
Xiao Ma
f7808179b4 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
2020-10-29 06:35:46 +00:00
Xiao Ma
c1d48c0444 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
2020-10-29 06:35:44 +00:00
Chiachang Wang
1d6fc4f622 Merge changes I6a51d803,I162fae5c am: b75c584971 am: 18013cefe3 am: 2d6e0ab8e7 am: fa1fc27d9b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1473228

Change-Id: I40ff3cfcb4dbe7dc036eaa87df2fa192aee3f016
2020-10-29 06:19:52 +00:00
Chiachang Wang
671a480929 Merge "Replace hidden NMS interface to network API" am: 689399aa75 am: 667b09128d am: cf129dae9f am: 054053a6ca
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1473224

Change-Id: Id97da9dda9bed8c182ea2fcd92c79d94bc619d52
2020-10-29 06:19:30 +00:00
Xiao Ma
ee3d2e049d 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
2020-10-29 06:17:22 +00:00
Chiachang Wang
fa1fc27d9b Merge changes I6a51d803,I162fae5c am: b75c584971 am: 18013cefe3 am: 2d6e0ab8e7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1473228

Change-Id: I49cb16e2ae99687be9a4b72773901fa59b506138
2020-10-29 06:14:34 +00:00
Chiachang Wang
054053a6ca Merge "Replace hidden NMS interface to network API" am: 689399aa75 am: 667b09128d am: cf129dae9f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1473224

Change-Id: I4cd75254a26106103352c98d3fefe4a275c83bed
2020-10-29 06:14:03 +00:00
Xiao Ma
8323b72ef0 Revert "Revert "Test IPv6ProvisioningLossParcelable in the NetworkAttributes""" am: ef20ba23a4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1460264

Change-Id: Ie13b2bb8037d85ab4782e06cfc31e108397fc78b
2020-10-29 06:09:44 +00:00
Chiachang Wang
2d6e0ab8e7 Merge changes I6a51d803,I162fae5c am: b75c584971 am: 18013cefe3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1473228

Change-Id: I61cdda413fe21a46ac075a0abba2b9affa015149
2020-10-29 05:52:33 +00:00
Chiachang Wang
cf129dae9f 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
2020-10-29 05:52:12 +00:00
Xiao Ma
780d3d2115 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"""
2020-10-29 05:39:16 +00:00
Chiachang Wang
b75c584971 Merge changes I6a51d803,I162fae5c
* changes:
  Replace hidden NMS API for setting MTU
  Replace hidden NMS default network configuration API
2020-10-29 05:03:43 +00:00
Chiachang Wang
689399aa75 Merge "Replace hidden NMS interface to network API" 2020-10-29 05:02:21 +00:00
Hongwei Wang
903a7239df Merge "Revert "Add maxTargetSdk restriction to unused APIs."" 2020-10-28 23:58:21 +00:00
Hongwei Wang
1dc34ce1e6 Revert "Add maxTargetSdk restriction to unused APIs."
This reverts commit 335e158fb0.

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397

Bug: 171886397
Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
2020-10-28 20:16:22 +00:00
Mathew Inwood
15f681fb2c Merge "Add maxTargetSdk restriction to unused APIs." 2020-10-28 09:39:20 +00:00
paulhu
e7a50004d8 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
2020-10-28 16:24:37 +08:00
Chiachang Wang
9695da3ba0 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
2020-10-28 14:38:18 +08:00
Chiachang Wang
fd47831a5c 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
2020-10-28 14:38:18 +08:00
Chiachang Wang
a93ddb250b 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
2020-10-28 14:38:18 +08:00
Chiachang Wang
c1fe7a0a37 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
2020-10-28 14:38:18 +08:00