Commit Graph

560639 Commits

Author SHA1 Message Date
Lorenzo Colitti
8fdfd46218 BroadcastInterceptingContext: use passed-in broadcast Handler.
Currently, BroadcastInterceptingContext always runs broadcast
receivers on the thread that called sendBroadcast. This means:

1. Receivers might run on the wrong thread, making the test less
   realistic.
2. If any receiver checks what thread it's running on, then
   either the check needs to be modified or deleted, or the test
   must call sendBroadcast on the thread that the receiver
   expects to run on. The latter is impossible when there is more
   than one receiver that needs to run on more than one thread.

This CL adds a setUseRegisteredHandlers method that allows tests
to say that they want each receiver to run on the Handler
specified at registration time.

This CL also enables the new mode for ConnectivityServiceTest,
and resolves a TODO to re-enable a disabled thread check.

The new mode cannot be enabled by default because it would break
most of the tests.

All the below tests pass except for the car bluetooth test
testAutoConnectAdapterOff_returnsImmediately which was already failing.

Bug: 173331190
Test: atest CarInputServiceTest BluetoothProfileDeviceManagerTest
Test: atest NetworkPolicyManagerServiceTest
Test: atest ConnectivityServiceTest
Test: atest TetheringTest TetheringNotificationUpdaterTest
Test: atest VersionedBroadcastListenerTest EntitlementManagerTest
Test: atest TetheringConfigurationTest
Test: atest CachedDeviceStateServiceTest
Test: atest EmergencyAffordanceServiceTest
Change-Id: I3303bb14516f07a55d82a16b59c111ab3f8b0389
2021-02-15 10:40:32 +00:00
Lorenzo Colitti
74cbf1917b Merge "Minor fixes to LockdownVpnTracker." 2021-02-15 06:25:16 +00:00
Treehugger Robot
4a7e41a6e6 Merge "Expose VpnTransportInfo as module-lib API." 2021-02-15 04:54:13 +00:00
Lorenzo Colitti
98d12c7de9 Minor fixes to LockdownVpnTracker.
1. Remove the legacy network type. This is only used for logging.
   - Replace the logcat logging with the display transport
   - Remove the EventLogTags logging, since it's likely not
     actually used by anyone.

2. Remove code that checks for NetworkInfo objects in state
   FAILED, since LockdownVpnTracker can never have received any
   such NetworkInfo from ConnectivityService since lollipop.

Bug: 173331190
Test: passes existing tests in ConnectivityServiceTest
Change-Id: I66ed71e51ba18b95862f3a0a5df2775eecea501e
2021-02-15 09:58:20 +09:00
Lorenzo Colitti
d92d403e76 Expose VpnTransportInfo as module-lib API.
This information originates in non-mainline system server code
and needs to be passed to the connectivity mainline code.

Bug: 173331190
Test: already covered by CTS tests
Change-Id: Ic612b6a51f7ec13e2213c8754312cf716130c876
2021-02-15 09:34:19 +09:00
Lorenzo Colitti
45ec3191a7 Merge changes Ia68f482a,I4911e214,Ied379654,I66d18512,Ie8e1bd63
* changes:
  Check registering system default callback needs NETWORK_SETTINGS.
  Move VPN code from ConnectivityService to VpnManagerService.
  Add a skeleton VpnManagerService, and start it on boot.
  Convert LockdownVpnTracker to NetworkCallbacks.
  Minor fixes to VpnTransportInfo.
2021-02-15 00:00:47 +00:00
Rubin Xu
944e30cf6c Merge "Add DPM.getKeyPairGrants()" 2021-02-14 22:22:47 +00:00
Treehugger Robot
acc78ee8eb Merge "Add KeyChain.createManageCredentialsIntent" 2021-02-14 21:28:40 +00:00
Rubin Xu
72ff9029c6 Add KeyChain.createManageCredentialsIntent
Missed from previous cherry-pick.

Test: make -j docs
Bug: 179180345
Merged-In: I1e57ed9c18a1ada463c55dbf17ce30e31aa7bad2
Change-Id: I1d88e11740a13490613962c944b528e6c2bd0fcb
2021-02-14 18:32:02 +00:00
Rubin Xu
e02debebcf Merge "Add KeyChainService credential management app APIs" 2021-02-14 17:06:48 +00:00
Tianjie Xu
6e87192cef Merge "Fix format of helper msg" 2021-02-14 02:27:41 +00:00
James Mattis
601d16a336 Merge changes from topics "pans", "pans-permission"
* changes:
  Marking setOemNetworkPreference as @SystemApi
  Adding permission for OEM managed preferences
  Implementation of setOemNetworkPreference
2021-02-13 20:54:57 +00:00
Rubin Xu
c9a8b2fa8e Merge "add MANAGE_CREDENTIALS appop" 2021-02-13 18:32:16 +00:00
Kalesh Singh
599b4e4ac4 Merge "Eliminate memtrack variability from the lost RAM calculation" 2021-02-13 05:11:28 +00:00
Suren Baghdasaryan
3e0c7c8231 Eliminate memtrack variability from the lost RAM calculation
Modify lost RAM calculation to use total mapped dmabuf and private GPU
allocations instead of memtrack HAL's reported Graphics and GL values.
All of memtrack HAL's reported Graphics should be accounted for as part
of mapped dmabufs. In order to not count it twice and not to depend on
memtrack HAL's reported value we exclude it from total PSS calculation
and replace it with mapped dmabufs.
All of memtrack HAL's reported GL should be accounted for as part
of private GPU allocations. In order to not count it twice and not to
depend on memtrack HAL's reported value we exclude it from total PSS
calculation and add GPU private allocations to total kernel memory
usage.

Bug: 165832481
Test: dumpsys meminfo
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I631488d95cfd91d5428c877b3a004215031dd223
Merged-In: I631488d95cfd91d5428c877b3a004215031dd223
2021-02-13 02:36:13 +00:00
Kalesh Singh
f403b56267 Merge "Provide an interface to query dmabuf GPU allocations" 2021-02-13 02:35:06 +00:00
Benedict Wong
cefc4f6864 Merge "Lazy-create IpSecTunnelInterface" 2021-02-12 23:11:01 +00:00
Rubin Xu
ac5ee32091 Add DPM.getKeyPairGrants()
(Trimmed down version)

Bug: 179180345
Test: atest
com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testKeyManagement
Test: atest
com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDelegatedCertInstallerDirectly
Test: atest android.admin.cts.DevicePolicyManagerTest
Change-Id: Ieee1048b145fb8400eccbf32c054afc64b5d90c0
Merged-In: Ieee1048b145fb8400eccbf32c054afc64b5d90c0

Change-Id: Id1ab42ddbf04a3f6874ba5ce7eb937114d2194ef
2021-02-12 21:35:33 +00:00
Rubin Xu
0aa18af47d Add KeyChainService credential management app APIs
(Trimmed down version)

Bug: 179180345
Test: Manual Testing
      atest com.android.keychain.KeyChainServiceRoboTest

Change-Id: I00b7df27a92f6ee4f74546f892c83290fead1112
Merged-In: I00b7df27a92f6ee4f74546f892c83290fead1112
2021-02-12 21:35:33 +00:00
Rubin Xu
fd4c56d4d3 add MANAGE_CREDENTIALS appop
This is part of the work to support
a credential management app on
unmanaged devices.

Bug: 179180345
Test: atest android.appsecurity.cts.AppOpsTest

Merged-In: Ifd87b5e38f341db4b34bf9f61480e29e49148846
Change-Id: Ifd87b5e38f341db4b34bf9f61480e29e49148846
2021-02-12 21:34:53 +00:00
Yan Yan
8d659bb1ec Merge changes Ifc8ad902,I6d1b8d0e
* changes:
  [API] Expose IpSecTunnelInterface#setUnderlyingNetwork
  Update underlying network of IpSecTunnelInterface
2021-02-12 21:23:29 +00:00
Brad Ebinger
dd170ee3f3 Merge "Add the ability to send the feature tags associated with IMS registration" 2021-02-12 18:35:13 +00:00
Kalesh Singh
1a8d198b5b Provide an interface to query dmabuf GPU allocations
The DMA buffers mapped by GPU device(s) are already accounted for
in the total exported dmabuf size (ionHeap) size.

To remove GPU memory from lost RAM, provide an API to get only the
DMA buf memory mapped by the GPU device(s).

Bug: 176477627
Test: adb shell dumpsys meminfo
Change-Id: Ie72f46c8de026b143629406714f413677ce6693b
Merged-In: Ie72f46c8de026b143629406714f413677ce6693b
2021-02-12 10:07:30 -08:00
Jeff Sharkey
a8a2198ddc Merge "Add owners for locksettings unit tests" 2021-02-12 16:12:41 +00:00
Rubin Xu
b64368f803 Add owners for locksettings unit tests
Bug: 174932174
Test: builds
Change-Id: I694e003100b76f9e7a69b8c0f10fb85e734232b7
2021-02-12 16:04:14 +00:00
Jeff Sharkey
bc447056c0 Merge "Add OWNERS file for ConnTestApp." 2021-02-12 15:54:56 +00:00
Sudheer Shanka
b632d34728 Add OWNERS file for ConnTestApp.
Bug: n/a
Test: n/a
Change-Id: I0c6730fdf7b9bf5ebd8c907cb8a71630725e67e6
2021-02-12 09:16:43 +00:00
Almaz Mingaleev
a36c8d2b6a Merge "Prioritise NTP over NITZ in time detection." 2021-02-12 08:10:37 +00:00
Treehugger Robot
da21df3a17 Merge "Remove unnecessary calls to JNIEnv::GetArrayLength" 2021-02-12 04:48:47 +00:00
James Mattis
0846b40040 Marking setOemNetworkPreference as @SystemApi
Marking setOemNetworkPreference in ConnectivityManager as @SystemApi.

Bug: 176496438
Bug: 176494815
Test: atest FrameworksNetTests
atest FrameworksNetIntegrationTests
atest CtsNetTestCasesLatestSdk

Change-Id: I4681c88dc3a83f71c387b29610c33594e57cb43f
2021-02-11 20:38:21 -08:00
James Mattis
6f4a9ce808 Adding permission for OEM managed preferences
Adding CONTROL_OEM_PAID_NETWORK_PREFERENCE as a signature level
permission to allow an application to control OEM managed network
preferences.

Bug: 176496438
Bug: 176494815
Test: atest FrameworksNetTests
atest NetworkStackTests
atest FrameworksNetIntegrationTests
atest NetworkStackIntegrationTests
atest CtsNetTestCasesLatestSdk
Change-Id: Iee13e89f3931c7079c2d88cb57b249b1b1cf93ad

Change-Id: Id29cafe1eaf5dff8a0605cb2579204d9c77b7e70
2021-02-11 20:38:21 -08:00
James Mattis
82da6ad33d Implementation of setOemNetworkPreference
Main implementation of ConnectivityService.setOemNetworkPreference. This
covers the main requirements of this method including listener
functionality.

Bug: 176495594
Bug: 177101287
Bug: 176494815
Test: atest FrameworksNetTests
atest NetworkStackTests
atest FrameworksNetIntegrationTests
atest NetworkStackIntegrationTests
atest CtsNetTestCasesLatestSdk

Change-Id: I8d318ab07785e52dd84d6261fdea8f318dce9bc5
2021-02-11 20:38:18 -08:00
Treehugger Robot
564aecdefb Merge "Stop using Slog in QosCallbackTracker." 2021-02-12 04:03:12 +00:00
Lorenzo Colitti
9d2c3ee808 Stop using Slog in QosCallbackTracker.
This is not public API. Use Log instead.

Test: m
Fix: 172050541
Change-Id: I281831431e2edcf9a3b77122ad8736b94aa8e215
2021-02-12 01:40:06 +00:00
Suren Baghdasaryan
0c13c67158 Remove unnecessary calls to JNIEnv::GetArrayLength
Replace repeated calls to JNIEnv::GetArrayLength operating on the same
array with a cached value obtained once and then reused.

Bug: 165832481
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Id85f887a9a4dc8eeacbb047beca7ced49853484e
2021-02-12 01:12:44 +00:00
Suren Baghdasaryan
ca115f206a Merge "Extend getPssPid to report itemized memtrack values" 2021-02-12 01:11:55 +00:00
Suren Baghdasaryan
c17cbb303c Extend getPssPid to report itemized memtrack values
Currently getPssPid includes memtrack HAL reported values in the pss
calculation. This makes it impossible to get these values separately.
Extend this interface to include itemized memtrack values.

Bug: 165832481
Test: dumpsys meminfo
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ieb7e1b79ad8ecae6023338d9992467952558e2bd
2021-02-12 01:11:39 +00:00
Daniel Bright
9379af7c56 Merge "Changed ApnThrottleStatus to ThrottleStatus" 2021-02-11 23:31:24 +00:00
Philip P. Moltmann
25ee5a7fb7 Merge "Remove me from OWNERS files" 2021-02-11 22:29:07 +00:00
Philip P. Moltmann
a8eb3d3e69 Remove me from OWNERS files
Test: n/a
Change-Id: I6113011e6ab0997285d5b7a86303fc60a3b98a2b
Exempt-From-Owner-Approval: Previously approved
2021-02-11 22:28:43 +00:00
Tianjie Xu
60edeec07e Merge "Delay loadEscrowData from locksettings" 2021-02-11 21:52:11 +00:00
Tianjie
1c98980d00 Delay loadEscrowData from locksettings
For server-based ror, we want to deplay loadEscrowData until
1. Binding to Gmscore works
2. Network is available

So we factor out the loadEscrowData to be called later in the
start sequence of system server. Also make the function async
so that we can retry on temporarily failures.

Bug: 172780686
Test: run server based ror

Change-Id: If71f8974f94eb1be2ab896e95601377196e01790
2021-02-11 21:52:01 +00:00
Daniel Bright
a5a88fd3e8 Changed ApnThrottleStatus to ThrottleStatus
* Changed verbiage to be more generic at request of the API council

Bug: 175092152
Test: make & flash
Merged-In: I8bec64b0c38be94bcd3f3b99bcebfb378384c970
Change-Id: I8bec64b0c38be94bcd3f3b99bcebfb378384c970
2021-02-11 13:02:19 -08:00
Janis Danisevskis
3faed136d5 Merge "Adding device ID attestation to KeyGenParameterSpec" 2021-02-11 20:03:01 +00:00
Brad Ebinger
8420894edc Add the ability to send the feature tags associated with IMS registration
- In order to better support UCE, allow the IMS registration update to
the framework to include the feature tags associated with the registration
so that this information can be used in SIP PUBLISH.

- Encapsulate other IMS registration attributes into a singlular class.

Bug: 177375635
Test: atest CtsTelephonyTestCases:ImsServiceTest
Merged-In: Id730e5e0c9322c2a845523f3b3901f3d899c3f1c
Change-Id: Id730e5e0c9322c2a845523f3b3901f3d899c3f1c
2021-02-11 19:59:16 +00:00
Lorenzo Colitti
fad82fdcf5 Check registering system default callback needs NETWORK_SETTINGS.
Also address a code review comment.

Bug: 173331190
Test: test-only change
Change-Id: Ia68f482af6d10af203bdbd4e14a12ae0b12bb6b5
2021-02-12 01:12:48 +09:00
Lorenzo Colitti
3dc6dbe80f Move VPN code from ConnectivityService to VpnManagerService.
ConnectivityService itself does not depend on mVpns or the Vpn
class any more. Most of this CL is simply moving code from one
class to another:

- Move the AIDL calls from IConnectivityManager to IVpnManager.
- Move the implementation from ConnectivityService to
  the new VpnManagerService.
- Move the APIs from ConnectivityManager to VpnManager, but
  temporarily maintain some shims in ConnectivityManager for the
  moved calls so that existing callers do not have to be modified
  in this CL.
- Update VpnService to call IVpnManager instead of
  IConnectivityManager.
- Move the code that registers the VpnManager service from
  ConnectivityFrameworkInitializer to SystemServiceRegistry.

Bug: 173331190
Test: atest HostsideVpnTests FrameworksNetTests CtsNetTestCases
Change-Id: I4911e2144df721a94fa00da9edf0dc372a7091c2
2021-02-12 01:12:24 +09:00
Lorenzo Colitti
f83d22b77d Add a skeleton VpnManagerService, and start it on boot.
This adds a lot of unused code but this should make it easier to
review subsequent CLs.

Bug: 173331190
Test: builds, boots, "dumpsys vpnmanager" succeeds
Change-Id: Ied379654a0c3ab6242d3125661fe30f322395059
2021-02-12 01:07:29 +09:00
Lorenzo Colitti
8e40a0623c Convert LockdownVpnTracker to NetworkCallbacks.
This will allow moving LockdownVpnTracker from the connectivity
to the VPN code. This requires moderate refactoring since it's
pretty tightly coupled to both.

In this CL:

1. Add an @hide API to tell ConnectivityService that legacy
   lockdown VPN is enabled. I chose not to use the existing
   setVpnRequiredForUids API because that method has specific
   semantics and because it will be required long term since
   it's used by non-legacy VPN types.

2. Instead of updating LockdownVpnTracker inline from the
   ConnectivityService handler thread, have it listen to
   NetworkCallbacks. This introduces an extra thread hop, but
   most of the interactions between the lockdown VPN and CS were
   via NetworkAgent, which is asynchronous anyway.

3. Add code to LegacyTypeTracker to send the extra
   CONNECTIVITY_ACTION broadcast for the underlying network type
   that is sent after the VPN connects. In order to do this, make
   Make LockdownVpnTracker specify its underlying network
   (via setUnderlyingNetworks) when it connects.

4. Reimplement LockdownVpnTracker#augmentNetworkInfo based on
   information that is available in ConnectivityService.

5. Remove the code in LockdownVpnTracker that counted errors.
   I think this code has not worked since lollipop, because
   ConnectivityService never sees NetworkInfo objects in state
   FAILED. This is because ConnectivityService only hears about
   NetworkInfo objects via NetworkAgents, and LegacyVpnRunner
   only registers its NetworkAgent when the connection succeeds.

Bug: 173331190
Test: passes existing tests in ConnectivityServiceTest
Change-Id: I66d18512882efd468ee0ecec61f28786a195b357
2021-02-12 01:07:29 +09:00
Lorenzo Colitti
5fb746fd88 Minor fixes to VpnTransportInfo.
This CL addesses comments on aosp/1570921.

Bug: 173331190
Test: new test coverage
Change-Id: Ie8e1bd63bb818a03f4b17402e1b365577ca034a2
2021-02-11 23:28:00 +09:00