27103 Commits

Author SHA1 Message Date
markchien
b6858e5919 Expose netId by adding getter API
Bug: 151156820
Test: m
      atest TetetheringTests

Clean CP from ag/10747732

Change-Id: Ieb1483c146aa2f7d8f251157e6e81d71c44ae899
Merged-In: Ieb1483c146aa2f7d8f251157e6e81d71c44ae899
2020-03-24 09:19:26 +00:00
Brad Ebinger
06d11782d7 Merge "API Review: Make ImsReasonInfo in ImsMmTelManager @NonNull" 2020-03-23 17:18:26 +00:00
Brad Ebinger
2a15872d99 Merge "API fix: getProprietaryCallExtras should not return null" 2020-03-23 17:10:13 +00:00
Brad Ebinger
ee30a546d6 Merge "API fix: Rename and clarify ProvisioningManager constants" 2020-03-23 16:19:36 +00:00
Mohammad Samiul Islam
ef3b56dbc7 Allow staging multiple session with non-overlapping packages (apk-only)
Bug: 141843321
Test: atest StagedInstallTest#testAllowNonOverlappingMultipleStagedInstall_BothSinglePackage_Apk
Test: atest StagedInstallTest#testFailOverlappingMultipleStagedInstall_BothSinglePackage_Apk
Test: atest StagedInstallTest#testFailOverlappingMultipleStagedInstall_BothSinglePackage_Apex
Test: atest StagedInstallTest#testAllowNonOverlappingMultipleStagedInstall_MultiPackageSinglePackage
Test: atest StagedInstallTest#testFailOverlappingMultipleStagedInstall_BothMultiPackage
Test: atest StagedInstallTest#testMultipleStagedInstall_ApkOnly
Test: atest RollbackManagerHostTest#testApkOnlyMultipleStagedRollback
Test: atest RollbackManagerHostTest#testApkOnlyMultipleStagedPartialRollback
Test: atest StagedInstallTest
Change-Id: Iad2e35b50fd22e207e3ad91b48a767827d8e8926
Merged-In: Iad2e35b50fd22e207e3ad91b48a767827d8e8926
2020-03-23 15:51:07 +00:00
junyulai
9e69c26a6d Address API council review comment about TetheringRequest
Test: atest TetheringTests FrameworksNetTests NetworkStackTests
Bug: 152055812
Change-Id: I0158d88e364772f9ac258bd18955edcdad266ad8
Merged-In: I0158d88e364772f9ac258bd18955edcdad266ad8
(this is a clean cherry-pick from ag/10796412)

Change-Id: I64f1527d79085cc5dfd78c01a6c49c4df87c82e7
2020-03-23 14:14:22 +08:00
Remi NGUYEN VAN
d4373f3a54 Merge "Add a test API for testing NetworkStack.getService" 2020-03-23 05:46:38 +00:00
Remi NGUYEN VAN
341fa568b9 Merge changes from topic "netstack_constant_cherrypick"
* changes:
  Remove usage of Context.NETWORK_STACK_SERVICE
  Remove NETWORK_STACK_SERVICE constant
2020-03-23 03:33:58 +00:00
Remi NGUYEN VAN
a24a9f710e Add a test API for testing NetworkStack.getService
NetworkStack.getService was introduced to avoid relying on
Context#getSystemService to obtain the NetworkStack binder token.
To allow it to be mocked in tests, a method is introduced to allow tests
to specify a mock NetworkStack token for their own process.

Test: atest NetworkStackTests, using the change
Bug: 151243982
(clean cherry-pick from internal branch)
Merged-In: I04058a007f2dfe1044cabeb3ac508404873665ad

Change-Id: I0e626d871176112a8575d629a05cb7a935b577a6
2020-03-23 03:25:51 +00:00
Remi NGUYEN VAN
4fb0137726 Remove NETWORK_STACK_SERVICE constant
Instead, have a dedicated method in android.net.NetworkStack allowing to
fetch the stable AIDL token for the service.

This avoids returning IBinder from getSystemService, as getSystemService
should generally return manager classes.

Test: atest FrameworksNetTests NetworkStackTests
Fixes: 151243982
Merged-In: I58a6e1f27aff052050197d1901f43a98d7aa1167
(clean cherry-pick from internal branch)

Change-Id: I75aba269595f3e315dd5e0693c878b2026e8e299
2020-03-23 11:28:56 +09:00
Treehugger Robot
c1cae420a2 Merge "Add BLUETOOTH_PRIVILEGED permission as a requirement for all new Bluetooth SystemApis and for hidden connect/disconnect APIs." 2020-03-22 08:30:56 +00:00
Philip P. Moltmann
2a9c3e49ba Merge "Pipe through attributeTag for one SMS permission check" 2020-03-21 05:18:24 +00:00
Rahul Sabnis
8bc55739e7 Add BLUETOOTH_PRIVILEGED permission as a requirement for all new Bluetooth SystemApis and for hidden connect/disconnect APIs.
Hide some APIs that were previously marked as @UnsupportedAppUsage and re-add annotation as changing the permissions for these SystemApis would break the unsupported app contract that was previously there. Therefore, we're choosing to hide them until we have a good story on how to deal with them next release.

Bug: 148689314
Test: Manual
Merged-In: I33ee2c7ccd3827db3d23d6447cf82d9ffc36836a
Change-Id: I33ee2c7ccd3827db3d23d6447cf82d9ffc36836a
2020-03-21 04:14:29 +00:00
Brad Ebinger
51aa63a61d API Review: Make ImsReasonInfo in ImsMmTelManager @NonNull
1) If the vendor does not specify an ImsReasonInfo, create an
unspecified ImsReasonInfo instead of passing null back.
2) Move onUnregistered to @NonNull

Fixes: 150008589
Test: atest CtsTelephonyTestCases:ImsServiceTest
Merged-In: Idd0f2216bdd55011cb16d268b61cb652ca11bd41
Change-Id: Idd0f2216bdd55011cb16d268b61cb652ca11bd41
2020-03-20 16:49:41 -07:00
Sarah Chin
14f87a28d8 API review: SubscriptionPlan#getNetworkTypes/setNetworkTypes
Default value is TelephonyManager#getAllNetworkTypes instead of null

Test: atest SubscriptionManagerTest, DcTrackerTest
Bug: 148218045
Change-Id: If7a46be43648a337ca11ca9dcb30bc532829ef43
Merged-In: If7a46be43648a337ca11ca9dcb30bc532829ef43
2020-03-20 16:40:03 -07:00
Brad Ebinger
72e3eef33c API fix: getProprietaryCallExtras should not return null
Bug: 149216142
Fixes: 151172594
Test: atest CtsTelephonyTestCases
Merged-In: I7bd0d44f08169d41396a8cb202f3928e14bc5939
Change-Id: I7bd0d44f08169d41396a8cb202f3928e14bc5939
2020-03-20 16:26:51 -07:00
Nathan Harold
c62ebcc6c3 Convert getBands() to int[] from List<Integer>
To conform with API council guidelines, convert the
getBands() function to store and return an array of
int[] rather than a List<Integer> to avoid autoboxing.

Also:
-Add bands to hashCode() and equals() for CellIdentityLte
-Add EARFCN to hashCode() for CellIdentityLte

Bug: 150399894
Test: atest FrameworksTelephonyTests
Merged-In: I7edd5896b48794cd9c291788c28420ce40898f77
Change-Id: I7edd5896b48794cd9c291788c28420ce40898f77
(cherry picked from commit 9d722a0c7f1c1975ddb1a1f229eb5c2b08167d17)
2020-03-20 15:23:55 -07:00
Peter Wang
54af9046ac Merge "[API Review] APIs in SubscriptionManager" 2020-03-20 19:54:58 +00:00
Jack Yu
c33377b077 Merge changes from topic "lte_bands"
* changes:
  Added bands from HAL 1.5
  Convert getAdditionalPlmns to return a Set
2020-03-20 19:03:49 +00:00
Sarah Chin
029e64d931 Revert "Expose hidden resources used in telephony/common"
This reverts commit dd066606452043c2f70288ac489d94334c7ca45b.

Reason for revert: Remove mainline API for R

Test: build
Bug: 148174114
Change-Id: I8a8cddfd1d824c908c49f818f2671941b4bb5dca
Merged-In: I712958984254ca6f16a9604d2aab532500dc1ca9
2020-03-20 03:44:48 +00:00
Sarah Chin
7b53d011cb Unexpose unnecessary SysUI APIs
These APIs were exposed for mainline since they were used in SysUI code,
but the logic that was using them was moved to Telephony. Unexposing the
APIs since they no longer need to be exposed.

Test: atest FrameworksTelephonyTests
Bug: 147447171
Bug: 111498835
Bug: 149874525
Change-Id: I1930977c5345c075773d18db4eb05913038d7e7f
Merged-In: I1930977c5345c075773d18db4eb05913038d7e7f
2020-03-19 20:40:30 -07:00
Sarah Chin
872d287af1 Unexpose getDataRoamingFromRegistration API
Test: build
Bug: 148604865
Change-Id: I695645418d2babc1eb524a29b2054c1cd8f74da3
Merged-In: I695645418d2babc1eb524a29b2054c1cd8f74da3
2020-03-19 20:29:04 -07:00
Sarah Chin
2b99e5fcfa API Review: rename isGlobalModeEnabled
Test: atest FrameworksTelephonyTest
Bug: 148603998
Change-Id: Ia23e47047bb8e79e528ba2e37b8ab67e17af1ec7
Merged-In: Ia23e47047bb8e79e528ba2e37b8ab67e17af1ec7
2020-03-19 19:02:31 -07:00
Philip P. Moltmann
b36bcc882a Pipe through attributeTag for one SMS permission check
Bug: 136595429
Test: TH
Change-Id: I99635efd0da5e72c3df9c6383779a059bbe3c1d1
Merged-In: I346ac2d3acad0e0d18b298f89f0b96324fc52333
2020-03-20 00:28:09 +00:00
Peter Wang
0ddf44070b [API Review] APIs in SubscriptionManager
Bug: 146362772
Bug: 148180034
Test: atest SubscriptionControllerTest, TelephonyDatabaseHelperTest, TelephonyProviderTest
Change-Id: I77cad8f828ac38976355b7a5f3e8d757b73694ca
Merged-In: I77cad8f828ac38976355b7a5f3e8d757b73694ca
2020-03-19 16:06:52 -07:00
Jack Yu
0a7c66bcd8 Merge "Hide API" 2020-03-19 19:00:58 +00:00
Cody Kesting
70a08d9f7e Merge "Change NetworkCapabilties administrator UIDs to be stored as int[]." 2020-03-19 18:09:26 +00:00
Jack Yu
63fcb9b978 Hide API
Hide API that is only used by telephony registry.

Test: Telephony sanity tests
Bug: 149850449
Merged-In: Ie4c46de336097fb7231291f15048329aea0b639c
Change-Id: Ie4c46de336097fb7231291f15048329aea0b639c
(cherry picked from commit f0df0ba2ba735b6c484d3e752c20650d3c222bf1)
2020-03-19 10:27:36 -07:00
Mark Chien
c686fa828b Merge "TetheringManager API clean up" 2020-03-19 16:09:21 +00:00
Treehugger Robot
e215c5d047 Merge "Move NetworkCallback to last parameter for new exposed requestNetwork" 2020-03-19 15:51:32 +00:00
markchien
32726e00e2 Move NetworkCallback to last parameter for new exposed requestNetwork
Bug: 151243698
Test: atest TetheringTests
Change-Id: I87ef1d451eefa6998b9793c4eacabae978376d24
Merged-In: I87ef1d451eefa6998b9793c4eacabae978376d24
2020-03-19 11:36:07 +00:00
markchien
743236096e TetheringManager API clean up
Per API review:
- @IntDef defined on the type integer parameter
- have getters on each parameter that is set in the
  TetheringRequest.Builder
- new added API should not be deprecated
Below APIs is moved from system-current to module-lib-current that only
plafrom code(e.g. ConnectivityManager and Settings) can use them.
TetheringRequest.
onTetherableInterfaceRegexpsChanged, TetheringInterfaceRegexps:
Only platform code can use them because interfaces by regular
expressions are a mechanism which is planning to be deprecated.

Also rename some constants for easier to understand.

Bug: 149858697
Bug: 151243337
Test: m doc-comment-check-docs
      atest TetheringTests
Change-Id: I45cb21d5bc919f6d32c42650326597d5173ea028
Merged-In: Idd041f0fbeca411ea23e49786a50dd7feb77ef45
2020-03-19 19:32:50 +08:00
Lorenzo Colitti
e30d9267ef Merge "Make Ethernet interfaces more testable." 2020-03-19 11:12:09 +00:00
Zoey Chen
1859e648d6 Merge "[TelephonyMainline] @hide @SystemApi and revisit them in S. - CarrierColumns" 2020-03-19 06:21:35 +00:00
Nathan Harold
a4e79e3d41 Convert getAdditionalPlmns to return a Set
Set support is a little weird in Java and Android.
Java doesn't support ArraySet, but Android does; Parcel
has both read/write for ArraySet, but they are @hide. Thus,
my options were limited to:
-use the hidden parcel methods
-convert between list and set in the constructor and parcel code
-convert between list and set in the getter
-maintain parallel data structures.

Using the hidden methods seemed cleanest. Since they are
@UnsupportedAppUsage they can't be credibly removed.

In addition, the HAL code doesn't understand Set<> only List<> so
I was faced with the choice of having 2 constructors or using
Collection<>, which actually works just fine and avoids changing
a hundred or so unit tests with no ill effect.

Bug: 149476549
Test: atest FrameworksTelephonyTests
Test: (cts) atest CellInfoTest
Merged-In: I9dfa5f59512f3d1305187cc383c4069ceaaf27fd
Change-Id: I9dfa5f59512f3d1305187cc383c4069ceaaf27fd
(cherry picked from commit 5522de1af3bd875cfb4aa584e275ff148e95eb1f)
2020-03-18 22:05:36 -07:00
Treehugger Robot
0d56f6c047 Merge "Revert "Revert "Require user pass in a non-null BluetoothDevice ..."" 2020-03-19 01:36:09 +00:00
Lorenzo Colitti
da4fe152c4 Make Ethernet interfaces more testable.
This CL adds a setIncludeTestInterfaces method to EthernetManager
that, when called, causes the Ethernet service to recognize and
manage test interfaces created by TestNetworkManager.

Bug: 150644681
Test: Tested by EthernetTetheringTest in same topic
Change-Id: I86eef7a93267f800dbfc8eafd307effa76a344ca
2020-03-19 09:46:37 +09:00
Nathan Harold
2ea0b56cff Merge changes from topics "barring-cp", "nri-rplmn"
* changes:
  Allow Nullable Registered PLMN
  Return the RPLMN from NetworkRegistrationInfo
  Expose PreciseDataConnectionstate#getApnSetting()
  Skip sanitizing location info for Null Barring CID
  Remove BarringInfo#isServiceBarred()
  Introduce a new RIL request constant to support getBarringInfo.
  Update BarringInfo as Barring HAL date stuctures updated
  Add a BARRING_TYPE_UNKNOWN for Unreported Barring
  Add Callback to notify changes of barring status
2020-03-18 23:41:57 +00:00
Nathan Harold
4ad89fb955 Allow Nullable Registered PLMN
API Council has noted an inconsistency
between setRegisteredPlmn() and getRegisteredPlmn().

Because other methods such as CellIdentity#getMncStr()
are already nullable, it's reasonable to allow the
registered PLMN to be null in the event that the device
isn't registered.

Bug: 149476549
Test: make update-api && make && atest NetworkRegistrationInfoTest
Merged-In: Ib38e72a6bdbaf4e1fd439e92f835daa6f87ceb73
Change-Id: Ib38e72a6bdbaf4e1fd439e92f835daa6f87ceb73
(cherry picked from commit 2fb0bc50f93a728c52dd729ba28005ba1061b2b3)
2020-03-18 23:41:32 +00:00
Nathan Harold
ad4d8569e7 Return the RPLMN from NetworkRegistrationInfo
Add an API to get the RPLMN in network registration info.

This PLMN-ID is the one chosen from the PLMN IDs broadcast
by the cell for registration purposes.

Bug: 135921133
Test: make update-api && make offline-sdk-docs && make
      && atest FrameworksTelephonyTests
Merged-In: I82f9150e185d9809572d246b57ea42f14ad64f15
Change-Id: I82f9150e185d9809572d246b57ea42f14ad64f15
(cherry picked from commit 2b14af22daf38449c29ed0bfe2e619e991737581)
2020-03-18 23:41:13 +00:00
Nathan Harold
ca2e76571e Expose PreciseDataConnectionstate#getApnSetting()
Expose an API that was accidentally left as package private.

This is was missed when exposing other methods for the same
class; however, other methods have been deprecated based on
the presumption that this method is available in the public
API.

This method deprecated:
PreciseDataConnectionState#getDataConnectionApnTypeBitMask()
PreciseDataConnectionState#getDataConnectionApn()

Bug: 148565164
Bug: 147600208
Test: make update-api && make offline-sdk-docs
Merged-In: I0207c18d853d0b83db2622ff3abcda98565eac30
Change-Id: I0207c18d853d0b83db2622ff3abcda98565eac30
(cherry picked from commit a61992b67adf0180a073da5820826c27fd8d5e88)
2020-03-18 23:40:51 +00:00
Cody Kesting
8fcc76839f Change NetworkCapabilties administrator UIDs to be stored as int[].
NetworkCapabilities#mAdministratorUids is used to track the UIDs that
are administrators of the given Network. This value was previously
stored as List<Integer>. However, general Android API Council guidelines
recommend using Arrays for primitive values. In order to be consistent
with the guidelines, updating the field to use an Array.

Bug: 147903575
Test: atest FrameworksNetTests
Change-Id: I2652a5b0f276b8944454af5cb4b1383a3e054cfa
Merged-In: I2652a5b0f276b8944454af5cb4b1383a3e054cfa
2020-03-18 15:18:47 -07:00
Rahul Sabnis
cd3bee95ed Revert "Revert "Require user pass in a non-null BluetoothDevice ..."
Revert "Revert "Pass in active device to all BluetoothA2dp APIs ..."

Revert "Revert "Pass in active device to all BluetoothA2dp APIs ..."

Revert submission 10303287-revert-10253996-bt-a2dp-no-null-FQRXACWPIA

Reason for revert: Fixing breakage
Reverted Changes:
I4d9f2f819:Revert "Make sure calls to BluetoothA2dp APIs pass...
I771ca0d57:Revert "Need to now pass in active device instead ...
I76529c7a1:Revert "Pass in active device to all BluetoothA2dp...
I297bda68d:Revert "Require user pass in a non-null BluetoothD...
I525327959:Revert "Pass in active device to all BluetoothA2dp...
I1d8660b11:Revert "Pass in active device to all BluetoothA2dp...

Bug: 147287141
Test: Manual
Merged-In: I91ee6878cac1b84bd289278a1b965658a26fe4db
Merged-In: I4d7d971af75bff8967fd807d34dad90c32e24eba
Change-Id: I4d7d971af75bff8967fd807d34dad90c32e24eba
2020-03-18 11:10:24 -07:00
Nathan Harold
e3adb3a0a6 Remove BarringInfo#isServiceBarred()
Address API Council comments:
-Remove convenience method isServiceBarred()
-Pre-construct default barring objects rather than
 construct new ones in case the struct is sparsely
 populated.

Bug: 148553656
Test: atest BarringInfoTest
Change-Id: Ib0cbdfb431e1fc57afe16595406e0a4d70af8945
(cherry picked from commit 40cd94dde08cc2d9184baf75422534dd9003a6b9)
2020-03-18 10:18:28 -07:00
Nathan Harold
3c5e57cd07 Add a BARRING_TYPE_UNKNOWN for Unreported Barring
For vendors that do not support barring info reports,
add an additional BARRING_TYPE to express the difference
between unbarred and unknown barring status.

Bug: 143226991
Test: make update-api && make && atest BarringInfoTest
Merged-In: Ie9314c5612536bf181a3c0e52876b1804ed7cce2
Change-Id: Ie9314c5612536bf181a3c0e52876b1804ed7cce2
(cherry picked from commit d5b9cc737b8b89de303a1ce90f2a1e398658773f)
2020-03-18 09:52:10 -07:00
Nathan Harold
61b5d6741b Add Callback to notify changes of barring status
-Create a BarringInfo class to pass Barring information
 from HAL to PhoneStateListener.
-Add a multi-callback registrant so that ServiceStateTracker
 and potentially DcTracker can also listen to barring info in
 the future.

Bug: 143226991
Test: make update-api && make && atest BarringInfoTest
Merged-In: I08240259f3142beeca991238bf705236f0303954
Change-Id: I08240259f3142beeca991238bf705236f0303954
2020-03-18 09:52:10 -07:00
Amit Mahajan
0aa828ab5d Merge "Revert "Expose ACTION_USER_SWITCHED as system API"" 2020-03-18 15:31:08 +00:00
zoey chen
c73028e9f2 [TelephonyMainline] @hide @SystemApi and revisit them in S. - CarrierColumns
Test: manual
Bug: 144455212
Change-Id: I719ee0a4d23dcb7786954fe2741f3830d3d3a5bc
Merged-In: I719ee0a4d23dcb7786954fe2741f3830d3d3a5bc
2020-03-18 11:55:54 +00:00
Zoey Chen
685fe6f443 Merge "[TelephonyMainline] @hide system api since we'll revisit in S. - IccLock" 2020-03-18 05:15:05 +00:00
Junyu Lai
2c7aa1f5ab Merge "[SP25] Rename functions that add Entry conditionally" 2020-03-18 03:16:41 +00:00