Commit Graph

162 Commits

Author SHA1 Message Date
Aaron Huang
a10cc3aa60 Rename *Iface* APIs to *Interface*
Address API review feedback, other APIs have been refering to
these as "interface" instead of "iface" so migrate the APIs named
*Iface* to *Interface*.

Bug: 183972554
Test: atest android.net.UnderlyingNetworkInfoTest
Change-Id: I38b476e762fb57fa88c4a789092d0af6f5330d80
2021-04-28 17:57:32 +08:00
Lorenzo Colitti
609f5cff0b Merge "Hide NetworkPolicyManager.blockedReasonsToString API." am: 0549ca0217 am: fe78ceab36 am: 8027b42fe6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1682220

Change-Id: If0d8f99d618173d707d2f473d4f6634c3461f0ca
2021-04-22 03:29:41 +00:00
Aaron Huang
0924e0d9d6 Merge "Add getters to UnderlyingNetworkInfo" into sc-dev 2021-04-22 03:09:41 +00:00
Aaron Huang
5d3144c977 Merge "Add getters to NetworkStateSnapshot" into sc-dev 2021-04-21 11:20:10 +00:00
Sudheer Shanka
00f344a18e Hide NetworkPolicyManager.blockedReasonsToString API.
BLOCKED_REASON_* constants have been moved to ConnectivityManager
and blockedReasonsToString() util method doesn't belong in
NetworkPolicyManager as an API. So, just removing it for now.

Bug: 185967486
Test: treehugger
Change-Id: Ie04044980fdfc7ec772444be13fc659880953bd1
2021-04-21 07:23:54 +00:00
Aaron Huang
d78c60c10a Add getters to NetworkStateSnapshot
Address API council feedback, add getters to NetworkStateSnapshot
instead of exposing the bare fields directly.

Bug: 183972826
Test: FrameworksNetTests
Change-Id: Id1707753b42ae88d2b95e4bd00a792609434e4f5
2021-04-20 21:55:56 +08:00
Aaron Huang
f6008978c4 Add getters to UnderlyingNetworkInfo
Address API review feedback, add getters to UnderlyingNetworkInfo
instead of exposing fields.

Instead of wasting memory by converting this into an array, have
migrateTun take a List<String>. In turn, tunAdjustmentInit should
also take a List<String>.

Bug: 183972554
Test: atest android.net.UnderlyingNetworkInfoTest
Change-Id: Id59744097208d91298a25ef110ade91a9cf291a1
2021-04-20 13:34:52 +08:00
Kyunglyul Hyun
b4e519caf4 Revert^2 "Change PlaybackState#isActiveState to isActive"
This reverts d077dbf438
because the issue was resolved.

Bug: 161331016
Test: m lint-check
Change-Id: Ic4a2025407caeb6d41db3b84a293dc249f77ad0b
2021-04-19 07:11:57 +00:00
Orion Hodson
56b6ff07c3 Merge "Revert "Change PlaybackState#isActiveState to isActive"" into sc-dev 2021-04-15 15:07:24 +00:00
Treehugger Robot
2d4f2324cf Merge "Make TYPE_VPN_LEGACY no longer deprecated." am: 590949fd61 am: 9d5240865f am: 0d3acacdd5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1675627

Change-Id: Ib6419d4d408c5f4859bac2e92b1811dffd513c9c
2021-04-15 05:50:32 +00:00
Lorenzo Colitti
fb7f36b3cb Make TYPE_VPN_LEGACY no longer deprecated.
Addresses API council feedback.

Test: m
Fix: 185311050
Change-Id: I93c8c46ceda7b08f9fc0ab8930f6a3c960f30930
2021-04-14 23:30:48 +09:00
Sahana Rao
d077dbf438 Revert "Change PlaybackState#isActiveState to isActive"
Revert "Change PlaybackState#isActiveState to isActive"

Revert submission 14124578-playbackstate_isactive

Reason for revert: b/185343312
Reverted Changes:
I4757038d6:Change PlaybackState#isActiveState to isActive
If7753e8e9:Change PlaybackState#isActiveState to isActive

Change-Id: I7c890c65ecb955860d31db6c926ad2d6ded514dc
2021-04-14 12:14:49 +00:00
Kyunglyul Hyun
90e33e72cb Merge "Change PlaybackState#isActiveState to isActive" into sc-dev 2021-04-14 03:18:06 +00:00
Corina Grigoras
5b4e1622b7 Merge "Rename createContentUriAsUser to createContentUriForUser" into sc-dev 2021-04-13 16:43:00 +00:00
Paul Hu
036d189a8d Merge "Rename FIRST_SDK_INT to DEVICE_INITIAL_SDK_INT" into sc-dev 2021-04-13 02:05:21 +00:00
Corina
7c368531a4 Rename createContentUriAsUser to createContentUriForUser
Bug: 183395239
Test: atest ContentProviderTest
Change-Id: I13c382e7ad4f291de28a52025a8ec4e59d815409
2021-04-12 21:57:06 +00:00
paulhu
016950a485 Rename FIRST_SDK_INT to DEVICE_INITIAL_SDK_INT
As API review feedback, rename Build#VERSION#FIRST_SDK_INT to
Build#VERSION#DEVICE_INITIAL_SDK_INT. As well as update all usage
in frameworks and tests.

Bug: 184735771
Test: m
Change-Id: I72660959cb4e638a8e80fcf2f4e96ea172969f44
2021-04-09 15:47:36 +08:00
Kyunglyul Hyun
4879480b99 Change PlaybackState#isActiveState to isActive
Rename PlaybackState#isActiveState() to #isActive()
and make it public.
This is according to API review.

This CL also includes STATE_SKIPPING_TO_QUEUE_ITEM
as an active playback state.

Bug: 184612506
Test: build successful && atest PlaybackStateTest

Change-Id: I4757038d63adc3478f19f177265ebd198fb5f424
2021-04-09 05:48:31 +00:00
TreeHugger Robot
0a0ddadab5 Merge "usb: Address some API review comments" into sc-dev 2021-04-09 05:14:47 +00:00
Remi NGUYEN VAN
6c9d7a5c75 Merge "Replace IS_DEBUGGABLE with isDebuggable module API" am: ba77876dbd am: 4290766ae7 am: 116bab20ab
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1667304

Change-Id: I3a64653b1a9cb283ba04d4c5a363d3b44fa7b987
2021-04-09 01:30:00 +00:00
Remi NGUYEN VAN
ba77876dbd Merge "Replace IS_DEBUGGABLE with isDebuggable module API" 2021-04-09 00:19:19 +00:00
Paul Hu
3347a6c3db Merge "Move ACTION_CLEAR_DNS_CACHE to ConnectivityManager" am: ed4117ff40 am: d40e17099f am: 52b8921820
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1667080

Change-Id: I5fd350d67065211b84dbea769d258daff9780276
2021-04-08 07:48:14 +00:00
Remi NGUYEN VAN
b5f095ebf0 Replace IS_DEBUGGABLE with isDebuggable module API
Introduce a Build.isDebuggable() getter instead of the IS_DEBUGGABLE
static member.

Also make it module API as APK modules now have access to module APIs in
S, but also TestApi so it can be tested.

Test: m
Fixes: 182345786
Change-Id: I25d0848aee758792bbaba8ab73b5dd997a7250b3
2021-04-08 13:50:31 +09:00
paulhu
b4e9b2b3d8 Move ACTION_CLEAR_DNS_CACHE to ConnectivityManager
- As API review feedback, move ACTION_CLEAR_DNS_CACHE form Intent
  to ConnectivityManager.

- Rename to "android.net.action.CLEAR_DNS_CACHE" because of lint
  suggestion.
frameworks/base/packages/Connectivity/framework/src/android/net/
ConnectivityManager.java:449: error: Inconsistent action value;
expected `android.net.action.CLEAR_DNS_CACHE`, was
`android.intent.action.CLEAR_DNS_CACHE` [ActionValue]

Bug: 183937999
Test: atest FrameworksNetTests
Test: atest ActivityTaskManagerServiceTests
Test: atest android.permission2.cts.PermissionPolicyTest
Test: atest CtsNetTestCases
Change-Id: Iae8aa0ba10dfc7581f0cfaab82643edbee789e2f
2021-04-07 19:40:47 +08:00
TreeHugger Robot
20d6212568 Merge "Remove a module-lib API" into sc-dev 2021-04-06 10:09:50 +00:00
Aaron Huang
46d99ea11f Expose Context#PAC_PROXY_SERVICE as module lib API
(cherry-picked from ag/14097767)
Bug: 183938000
Test: make update-api
Merged-In: I4341e177b61df0311f0a3234f8814a0ae2cf9a1b
Change-Id: I4341e177b61df0311f0a3234f8814a0ae2cf9a1b
2021-04-06 17:06:03 +08:00
Aaron Huang
62718c2bbf Expose Context#PAC_PROXY_SERVICE as module lib API
Bug: 183938000
Test: make update-api
Change-Id: I4341e177b61df0311f0a3234f8814a0ae2cf9a1b
2021-04-06 11:50:21 +08:00
JW Wang
9fcfccbcc0 Remove a module-lib API
Per b/150347230#comment18, remove the API since
RollbackManager will not be a module in S.

Bug: 150347230
Test: m
Change-Id: I1f356d0f5097da340986182314e47e3b6b6d9223
2021-03-31 18:17:05 +08:00
Sudheer Shanka
05f75c2553 Merge "Remove NetworkPolicyManager.isUidBlocked() API." am: 9cff99d059 am: 433c866186 am: 4b3348f115
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1652550

Change-Id: Ic5c9fb2603a010976bc93e5059e5548ee782005e
2021-03-29 17:45:42 +00:00
Sudheer Shanka
d3ba15beeb Remove NetworkPolicyManager.isUidBlocked() API.
It isn't used by ConnectivityService any more and even if
it needs such utility method in the future, we could create
one which is part of connectivity module and doesn't need
to be exposed as part of NetworkPolicyManager API surface.

Bug: 183696103
Test: atest ./tests/net/java/com/android/server/ConnectivityServiceTest.java
Change-Id: Ie3c681f88e4b2b9bb92d2224c5ea96b074f155d5
2021-03-29 12:39:12 +00:00
Zimuzo Ezeozue
3244637a97 Merge "Address onAnrDelayStarted API comments" into sc-dev 2021-03-25 19:35:47 +00:00
Zim
308a048787 Address onAnrDelayStarted API comments
Test: m
Bug: 183446229
Change-Id: I433096c9fdc003b777f8a280f13f675a2d7ea8bf
2021-03-25 16:15:36 +00:00
Sudheer Shanka
d533fa78b1 Move BLOCKED_REASON_* constants from NPMS into ConnectivityManager.
These constants will now be including all the reasons for why an
uid's network access can be blocked, instead of only the
restrictions that could be imposed by NPMS.

Bug: 183473548
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Merged-In: I4c544415e12adf442fd2415c371b1b70a39c3aa4
Change-Id: I6dcea43fbefa9eac8b5a971b822a5be5422a54b4
2021-03-25 01:33:26 +09:00
TreeHugger Robot
956dd2834f Merge "Move BLOCKED_REASON_* constants from NPMS into ConnectivityManager." into sc-dev 2021-03-24 16:02:56 +00:00
Sudheer Shanka
2e20a1a29e Move BLOCKED_REASON_* constants from NPMS into ConnectivityManager.
These constants will now be including all the reasons for why an
uid's network access can be blocked, instead of only the
restrictions that could be imposed by NPMS.

Bug: 183473548
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Ignore-AOSP-First: Merging internally first to handle conflicts.
Change-Id: I4c544415e12adf442fd2415c371b1b70a39c3aa4
2021-03-23 15:26:29 -07:00
Martijn Coenen
b329228214 Make StorageVolume#getOwner a system API.
Since the MediaProvider mainline module will now manage volumes of
multiple users, it needs to know which user a volume belongs to. This
was implemented by an already existing API, so make that a @SystemApi.

Bug: 182396009
Test: N/A

Change-Id: I9ca24e500adfd51fbd52e863f549365dd9aaf39d
2021-03-23 14:16:12 +00:00
Lorenzo Colitti
f969377a96 Expose isUidNetworkingBlocked and isUidRestrictedOnMeteredNetworks
These methods are used by ConnectivityService for synchronous
calls such as getActiveNetworkInfo, isActiveNetworkMetered, etc.

These calls must call into NPMS and acquire the NPMS lock because
they are synchronous. They cannot use the stale copy of the
policy rules maintained by ConnectivityService, because if they
did, races like the following could occur:

1. App gets broadcast/callback/....
2. App calls isActiveNetworkMetered or other synchronous method.
3. ConnectivityService's copy of the rules is out of date, so the
   call returns stale information that the UID is still blocked.
4. The app thinks it has no networking, and does not call the
   synchronous method again until some other event occurs,
   potentially much later.

Bug: 176289731
Test: passes existing tests in ConnectivityServiceTest
Change-Id: I4ad0ca60431fe3702be85332530b6e93728d55e7
Merged-In: I4ad0ca60431fe3702be85332530b6e93728d55e7
2021-03-20 22:23:23 +09:00
Remi NGUYEN VAN
00b8d2cf37 Add multipath preference, background status API
Add APIs for getMultipathPreference and getRestrictBackgroundStatus.
Both are used by Connectivity to back the external
ConnectivityManager.getRestrictBackgroundStatus, and
ConnectivityManager.getMultipathPreference APIs.

Test: atest CtsNetTestCases
      atest ConnectivityServiceTests
      atest NetworkPolicyManagerServiceTest
Bug: 176289731
Change-Id: I8a03162b2f6691086bb64e75ffd354cdfca7f86a
Merged-In: I8a03162b2f6691086bb64e75ffd354cdfca7f86a
2021-03-20 22:23:16 +09:00
Ray Chi
5603742b00 usb: Address some API review comments
- Add the missing annotation for the permission in UsbService
- Enforce the permission in UsbManager

Test: atest CtsUsbManagerTestCases
Bug: 179389205
Change-Id: I9cb3a0f24367f0b28417588e03db882db159f7a7
2021-03-20 12:48:27 +00:00
Treehugger Robot
66794f915f Merge "Reland "Add an API to listen for changes in network blocked status of an uid."" 2021-03-19 10:12:15 +00:00
Remi NGUYEN VAN
7e26e33269 Merge "Add TEST_NETWORK_SERVICE to module API" 2021-03-19 02:32:00 +00:00
Remi NGUYEN VAN
2bf4c58ceb Add TEST_NETWORK_SERVICE to module API
TestNetworkManager is being unbundled; the TEST_NETWORK_SERVICE constant
is necessary for the module to register the manager with
registerContextAwareService.

Bug: 171540887
Test: m
Change-Id: I0690251ddfcdaa8a34830e110b75869a370de389
Merged-In: I0690251ddfcdaa8a34830e110b75869a370de389
2021-03-19 00:04:24 +00:00
Sudheer Shanka
da90e7a2bb Reland "Add an API to listen for changes in network blocked status of an uid."
This reverts commit 8623f2b3ca.

Reason for revert: The issue causing the build breakage has been fixed

Change-Id: I03fa406551b51aaa4d4d9255cf1a53f9b4bcc1bd
Merged-In: Ib9949b8619c6b148f73630b314c4113d76c31ec1
2021-03-18 19:11:55 +00:00
Lorenzo Colitti
9eb2c374a2 Merge "Add a VpnManager.TYPE_VPN_OEM." am: 9794a9444e am: 630a52226f am: 6de50c8008
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1644265

Change-Id: I512785d414fcfd4819cdf26ff3c3403c049db475
2021-03-18 18:25:54 +00:00
Anthony Stange
677f4420b9 Merge "Revert "Add an API to listen for changes in network blocked status of an uid."" 2021-03-18 16:52:08 +00:00
Anthony Stange
8623f2b3ca Revert "Add an API to listen for changes in network blocked status of an uid."
This reverts commit 7dc302d612.

Reason for revert: Breaking build - b/183106805
Bug: 183106805
Merged-In: Ib9949b8619c6b148f73630b314c4113d76c31ec1
Change-Id: I9789ed81e630f49c71034b6917188983bd11d774
2021-03-18 16:51:22 +00:00
Sudheer Shanka
5497657433 Merge "Add an API to listen for changes in network blocked status of an uid." 2021-03-18 15:29:17 +00:00
Remi NGUYEN VAN
690e8880ae Merge changes I4ad0ca60,I8a03162b into sc-dev
* changes:
  Expose isUidNetworkingBlocked and isUidRestrictedOnMeteredNetworks
  Add multipath preference, background status API
2021-03-18 14:07:12 +00:00
Sudheer Shanka
7dc302d612 Add an API to listen for changes in network blocked status of an uid.
Given that ConnectivityService is moving to a mainline module, we need
a @SystemApi for it to listen for changes in blocked status of an uid.
So, we decided to create a new API for this which can provide
ConnectivityService with more info about why an uid is blocked (which
will be useful for adding a new similar onBlockedStatusChanged callback
in CM.NetworkCallback) and also captures data saver restriction without
having out to track it separately.

Currently, NPMS does some redundant computations because we are
calculating both uid rules and blocked reasons separately. In a
follow-up change, we will compute uid rules using blocked reasons
and later possibly remove that onUidRulesChanged callback.

Bug: 176289731
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Test: atest ./tests/net/java/com/android/server/ConnectivityServiceTest.java
Test: atest ./services/tests/servicestests/src/com/android/server/net/NetworkPolicyManagerServiceTest.java
Change-Id: Ib9949b8619c6b148f73630b314c4113d76c31ec1
Merged-In: Ib9949b8619c6b148f73630b314c4113d76c31ec1
2021-03-18 10:42:25 +00:00
TreeHugger Robot
043d71394c Merge "Add TEST_NETWORK_SERVICE to module API" into sc-dev 2021-03-18 10:33:54 +00:00