Merge "New System API to launch SIM Preference in Setting" into main

This commit is contained in:
Jin Jeong
2024-12-04 01:31:58 +00:00
committed by Android (Google) Code Review
2 changed files with 14 additions and 3 deletions

View File

@@ -852,10 +852,15 @@
</activity>
<activity android:name=".network.SimOnboardingActivity"
android:exported="false"
android:exported="true"
android:configChanges="orientation|keyboard|keyboardHidden|screenSize|screenLayout|smallestScreenSize"
android:permission="android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS"
android:theme="@style/Theme.SpaLib.BottomSheetDialog"/>
android:theme="@style/Theme.SpaLib.BottomSheetDialog">
<intent-filter android:priority="1">
<action android:name="android.settings.SIM_PREFERENCE_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".network.telephony.ToggleSubscriptionDialogActivity"
android:exported="false"

View File

@@ -109,6 +109,12 @@ class SimOnboardingActivity : SpaBaseDialogActivity() {
}
var targetSubId = intent.getIntExtra(SUB_ID,SubscriptionManager.INVALID_SUBSCRIPTION_ID)
if (targetSubId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
targetSubId = intent.getIntExtra(
Settings.EXTRA_SUB_ID,
SubscriptionManager.INVALID_SUBSCRIPTION_ID
)
}
initServiceData(this, targetSubId, callbackListener)
if (!onboardingService.isUsableTargetSubscriptionId) {
Log.e(TAG, "The subscription id is not usable.")