Commit Graph

1883 Commits

Author SHA1 Message Date
Automerger Merge Worker
e9d2fd2e43 Merge changes Ie756b9aa,I38110f3a am: 87bf9bc09c am: c823b4d1b5
Change-Id: I884650a0a0fbf1a96f81ca927886eb2a563f4e28
2019-12-04 19:56:21 +00:00
Paul Hu
d1fa427d41 Merge "Replace the permission of internal connectivity checks" 2019-12-04 05:52:01 +00:00
paulhu
a6af6b6c2a Replace the permission of internal connectivity checks
A number of connectivity checks that protect system-only methods
check for CONNECTIVITY_INTERNAL, but CONNECTIVITY_INTERNAL is a
signature|privileged permission. We should audit the permission
checks, and convert checks that protect code that should not be
called outside the system to a signature permission. So replace
all CONNECTIVITY_INTERNAL to other proper permissions.

Bug: 32963470
Test: atest FrameworksNetTests NetworkPolicyManagerServiceTest
Change-Id: I8f2dd1cd0609056494eaf612d39820e273ae093f
2019-12-04 11:45:51 +08:00
Treehugger Robot
87bf9bc09c Merge changes Ie756b9aa,I38110f3a
* changes:
  [NS A19] Inline updateCapabilities in rematch.
  [NS A18] Reverse listens and request-availables
2019-12-04 02:07:45 +00:00
Automerger Merge Worker
a03f587746 Merge "Disable a flaky test" am: 932dda858a am: af0c7991ee
Change-Id: Ia3596b558fb09600e7d9a16f0dce03d4402ee653
2019-12-03 16:51:32 +00:00
Chalard Jean
b6ec076ac0 Disable a flaky test
Bug: 145513323
Test: FrameworkNetTests
Change-Id: I66e02fdaab2969b77db4a0f0e6fb8b1a981d9350
2019-12-03 16:13:22 +09:00
Chalard Jean
28e6b26c11 [NS A18] Reverse listens and request-availables
This is a long standing bug that happens to now be trivial
to fix, and also be beneficial for refactoring

Test: FrameworksNetTests NetworkStackTests
Change-Id: I38110f3a4a75936ea755788e7f9fee67863e14be
2019-12-02 18:44:10 +09:00
Chalard Jean
a1132d0068 Merge changes I0613c23f,Ibeab8d0a,I8bd668ad,I7d3a16be am: 5cf5b30990 am: f477d5c4c6
am: 81bce72008

Change-Id: I4540ad08fbb1ccabf0a19f73bc36611194ef8bfa
2019-12-01 21:37:03 -08:00
Chalard Jean
5cf5b30990 Merge changes I0613c23f,Ibeab8d0a,I8bd668ad,I7d3a16be
* changes:
  [NS A14] Move code notifying battery stats in its right place
  [NS A13] Move legacy broadcast handling after rematch.
  [NS A12] Move some legacy type tracker handling to a function
  Add tests for ConnectivityService → BatteryStats messages
2019-12-02 05:17:39 +00:00
Chalard Jean
bbaa33e1d3 [NS A14] Move code notifying battery stats in its right place
This should be done once every time an interface comes online.
Doing this in updateLinkProperties guarantees this happens every
time a new interface comes online, but it doesn't do it more
often than needed.

Test: FrameworksNetTests NetworkStackTests
Change-Id: I0613c23f44192944266d76107308da8d1c541d1c
2019-12-02 13:02:38 +09:00
Mark Chien
e8401aff92 Merge changes from topic "tether_migrate"
* changes:
  [Tether10]Remove UserManagerInternal usage in Tethering
  [Tether07] Migrate Tethering into module
  [Tether07] Clean up build rule for libtetheroffloadjni
2019-11-30 12:17:47 +00:00
markchien
0df2ebc43d [Tether07] Migrate Tethering into module
Now tethering would be run in dedicated service.
TetheringManager is the interface used to communicate with
TetheringService. The new call flow would be: ConnectivityManager
-> ConnectivityService -> TetheringManager -> TetheringService.
Note: the return value of #tether(), #untether() and #setUsbTethering()
APIs would always be no error. Client can use #getLastTetherError()
or #getTetheredIfaces or listen tether state change to check
status of corresponding interface.

Bug: 136040414
Bug: 144742179
Test: -build, flash, boot
      -atest TetheringTests
      -atest FrameworksNetTests

Change-Id: I7e78c0e0a3e70f940a749ba2a39ece7c7ec5b9b3
Merged-In: I7e78c0e0a3e70f940a749ba2a39ece7c7ec5b9b3
2019-11-30 10:03:08 +00:00
Chalard Jean
587758bea6 Add tests for ConnectivityService → BatteryStats messages
Test: ConnectivityServiceTest
Bug: 113554781
Change-Id: I7d3a16be76f606872f8edb84647b9ef94f36cba1
2019-11-29 16:59:30 +09:00
markchien
0f63ca6e91 [Tether07] Migrate Tethering into module
Now tethering would be run in dedicated service.
TetheringManager is the interface used to communicate with
TetheringService. The new call flow would be: ConnectivityManager
-> ConnectivityService -> TetheringManager -> TetheringService.
Note: the return value of #tether(), #untether() and #setUsbTethering()
APIs would always be no error. Client can use #getLastTetherError()
or #getTetheredIfaces or listen tether state change to check
status of corresponding interface.

Bug: 136040414
Bug: 144742179
Test: -build, flash, boot
      -atest TetheringTests
      -atest FrameworksNetTests

Change-Id: I7e78c0e0a3e70f940a749ba2a39ece7c7ec5b9b3
2019-11-29 07:05:21 +00:00
Hugo Benichi
f97a443e67 Merge "BitUtils: support packing/unpacking negative long values" am: 9e5de85e21 am: 04cad88eee
am: 039b4745a7

Change-Id: Iaa8c4084f0754781ea3e6a0a9202d9e102d5f074
2019-11-27 07:58:33 -08:00
Treehugger Robot
9e5de85e21 Merge "BitUtils: support packing/unpacking negative long values" 2019-11-27 15:34:46 +00:00
Hugo Benichi
7157c8e7af BitUtils: support packing/unpacking negative long values
Bug: None
Test: Compiled. New unit tests.
Change-Id: Ia543285e206b0bbc7d64458da10e68a951f9eec1
2019-11-27 11:00:32 +09:00
Paul Hu
2e1da35b3b Merge "Fix hasUseBackgroundNetworksPermission issue." am: 85e8fd5a24 am: e0ddf49e0b
am: 53b38ab96b

Change-Id: I8a1575dedd6e3b7a8b60ee2ffd475d790aec55c4
2019-11-25 10:35:55 -08:00
Lucas Lin
bb3c7ac3de Merge "Fix title of PRIVATE_DNS_BROKEN notification when connecting VPN" am: 82f0c22598 am: 124bb5c9ff
am: 5e5ac63f3c

Change-Id: I9539e73842040e3a38a64c4b4863adfe32c893e9
2019-11-25 10:33:04 -08:00
Anton Hansson
3cda6a23d7 Merge 37ccd4 into goog/master
Conflicted with Ifd6cfc77acf2284804a2f64011c2733b5c222369

Test: m
Change-Id: I2cb428a8cf6f194f2c33106df4610e0956bc994c
2019-11-25 14:48:04 +00:00
Paul Hu
85e8fd5a24 Merge "Fix hasUseBackgroundNetworksPermission issue." 2019-11-25 08:41:05 +00:00
Lucas Lin
82f0c22598 Merge "Fix title of PRIVATE_DNS_BROKEN notification when connecting VPN" 2019-11-25 08:14:09 +00:00
paulhu
86e23ebb47 Fix hasUseBackgroundNetworksPermission issue.
PermissionMonitor#hasUseBackgroundNetworksPermission only uses
the first package name of the uid for checking permission.
This is incorrect since each package declared different
permissions. So using the mApps which already checked both
network and using restricted network permissions. If uid is in
the mApps list that means uid has one of permission at least.

Bug: 135897744
Test: atest FrameworksNetTests
Change-Id: I3500a03ce06b5b822311ad0c67b606ce4039216a
2019-11-24 22:27:32 +08:00
Remi NGUYEN VAN
27253f29ad Merge "Move shared packages to NetworkStack project" 2019-11-22 06:50:22 +00:00
lucaslin
ccab250a55 Fix title of PRIVATE_DNS_BROKEN notification when connecting VPN
NetworkNotificationManager will only get the first transport
type from the NetworkCapabilities of network, and if the device
connects to a VPN and its underlying network is wifi, then the
first finding transport type will be TRANSPORT_WIFI. So, if the
private DNS is broken when device connected to VPN,
NetworkNotificationManager will try to get the SSID for the
title of notification but failed. For this kind of case, the
title of PRIVATE_DNS_BROKEN notification will show
"null has no internet access".

Bug: 143340533
Test: 1. Build pass.
      2. Connect to VPN and let private DNS to be broken, check
      title of PRIVATE_DNS_BROKEN notification.
      3. atest FrameworksNetTests

Change-Id: I1ed018cc8774d4fce4b94854f8e8703a28818463
2019-11-22 12:46:32 +08:00
Chalard Jean
67c8338dd4 Merge "Rename waitForConnectivityBroadcast" am: eb6a236187 am: daf956f91e
am: 61177acef9

Change-Id: I9c3197407c99bb209700364686ee64d6ccb07a06
2019-11-20 06:21:12 -08:00
Remi NGUYEN VAN
882d8b31bc Move shared packages to NetworkStack project
Both were already statically linked both in the NetworkStack module and
the framework, so this change only reorganizes the file locations.

It makes more sense to have the library files in the NetworkStack module
folder, as changes to these files will be released with the same cadence
as the module, not the framework.

Bug: 139106271
Test: built, flashed, WiFi working
Change-Id: Ifaa882b53d1084ef32db6b27d35b56eb226c468f
2019-11-20 17:01:25 +09:00
Chalard Jean
28945e5d70 Merge "Add tests for the legacy broadcast" am: 99ef62827b am: 6951ffb13c
am: aa1a10a5f4

Change-Id: Ifc56e73f7eeaa22d8f16fcd50083f0b0fa37dc95
2019-11-19 19:43:42 -08:00
Chalard Jean
407deb75ee Rename waitForConnectivityBroadcast
This doesn't wait, so it was ill-named.
Test: ConnectivityServiceTest

Change-Id: I15e5083f961e415b1d2d870e49c177fc84f0312c
2019-11-19 22:41:09 +09:00
Chalard Jean
99ef62827b Merge "Add tests for the legacy broadcast" 2019-11-19 13:32:17 +00:00
Chalard Jean
9ca137700d Add tests for the legacy broadcast
Test: this
Change-Id: I0777bf443f65d894eaab9b800db40c1caf6520fe
2019-11-19 21:08:44 +09:00
Jayachandran Chinnakkannu
a46de19da4 Merge "Remove usage of Telephonymanager getDefault() and from() hidden APIs" am: 73e22ad21d am: 306f8cecf8
am: 6d2b8e0d6a

Change-Id: Ief1f090f3664d583565f291c89357bfbac58fe17
2019-11-18 01:09:40 -08:00
Jayachandran C
43fa1be03a Remove usage of Telephonymanager getDefault() and from() hidden APIs
This CL replaces with getSystemService(TelephonyManager.class)

Bug: 140768340
Test: atest frameworks/base/tests/net
Change-Id: I0f14cc5440fa85c81ab90f3199e9e91c1b00f5e1
2019-11-15 19:26:33 -08:00
Jeff Vander Stoep
e4a34f68eb Merge "Speed up and reenable test for b/141603906" am: 58578023dc am: 24589540b2
am: 37e3d62cbc

Change-Id: I3989b33f7732880d34c5ef1df28b344c4a6751d1
2019-11-13 02:38:00 -08:00
Treehugger Robot
58578023dc Merge "Speed up and reenable test for b/141603906" 2019-11-13 10:05:49 +00:00
Lucas Lin
4b99f180bb Merge "[NS01] Create NetworkScore" am: c000664c7c am: 1f1c098ad9
am: 29ea077fda

Change-Id: Ic093e655b1ff7e44db57d7add6b0818a06700962
2019-11-07 17:05:20 -08:00
Lucas Lin
c000664c7c Merge "[NS01] Create NetworkScore" 2019-11-08 00:47:22 +00:00
lucaslin
c2bac51882 [NS01] Create NetworkScore
It's the first patch for refounding network selection. The new
network selection will try to compare the networks by more
factors, and will try to choose the best network after doing
the evaluation of trade-off.
Create the object that will serve to represent network quality
for more comprehensive ranking.

Bug: 143676287
Test: 1. Build pass.
      2. atest FrameworksNetTests

Change-Id: I4b6071d14365aa84d06be9802516fedf527e70f7
2019-11-07 16:47:56 +08:00
Mark Chien
8fa4f94f00 Merge "[Tether06] Migrate tether offload controller into module" am: 5d6eea1bc5 am: 3bb2eae1b8
am: 8582437269

Change-Id: I067c803982ce0dbd3d7af22fe1682440c4074752
2019-11-05 11:01:39 -08:00
markchien
77c17be6f3 [Tether06] Migrate tether offload controller into module
The tether offload JNI library in this patch still have many dependencies
with internal libraries. Will have follow up changes to cut the
dependencies to let it be a unbundled library.

Bug: 136040414
Test: -build, flash, boot
      -atest TetheringTests
      -atest FrameworksNetTests

Change-Id: Iacf8e0b94135e35672de3ee77c474ee39a00c591
2019-11-05 12:49:50 +09:00
Mark Chien
aa5c303d5c Merge "[Tether05] Migrate UpstreamNetworkMonitor into module" am: 259fdbb0b3 am: 58c84a752d
am: 8ed3176808

Change-Id: Ifc9f7626848727161f938f44b26e756dbf664588
2019-10-31 06:40:55 -07:00
Mark Chien
259fdbb0b3 Merge "[Tether05] Migrate UpstreamNetworkMonitor into module" 2019-10-31 13:05:32 +00:00
Mark Chien
47db7adcca Merge "[Tether04] Migrate EntitlementManager into module" 2019-10-31 07:33:21 +00:00
markchien
d020e55723 [Tether05] Migrate UpstreamNetworkMonitor into module
Bug: 136040414
Test: -build, flash, boot
      -atest TetheringTests
      -atest FrameworksNetTests

Change-Id: Ic1d9deecb66aaba0a4264a57f2e6579ea491ac9b
2019-10-30 12:42:42 +00:00
markchien
f303c5a881 [Tether04] Migrate EntitlementManager into module
Bug: 136040414
Test: -build, flash, boot
      -atest TetheringTests
      -atest FrameworksNetTests

Change-Id: Ifdfc6cd95377351c37946a146b60896f07ece59d
Merged-In: Ifdfc6cd95377351c37946a146b60896f07ece59d
2019-10-30 11:06:28 +00:00
markchien
67fac18ad9 [Tether04] Migrate EntitlementManager into module
Bug: 136040414
Test: -build, flash, boot
      -atest TetheringTests
      -atest FrameworksNetTests

Change-Id: Ifdfc6cd95377351c37946a146b60896f07ece59d
2019-10-30 15:59:34 +08:00
Mark Chien
5acf731ce3 Merge "[Tether03] Migrate IpServer into module" am: 634c6a512f am: c8c297544c am: 5724764344
am: f6e49999cd

Change-Id: Icc89e446b80e57a196861263bbcd824553db56c0
2019-10-25 00:18:11 -07:00
Mark Chien
634c6a512f Merge "[Tether03] Migrate IpServer into module" 2019-10-25 06:41:49 +00:00
Mark Chien
f78f8d7eff Merge "[Tether02] Migrate TetheringConfiguration into module" am: 72d5460dda am: c7ed6b4fe5 am: c95ca17d04
am: a2bfbe79cf

Change-Id: Ia361893223c5d08e7ca0193c38f9b1b88a330320
2019-10-24 07:14:21 -07:00
Mark Chien
72d5460dda Merge "[Tether02] Migrate TetheringConfiguration into module" 2019-10-24 13:10:24 +00:00