Loading AndroidManifest.xml +3 −1 Original line number Diff line number Diff line Loading @@ -249,12 +249,14 @@ android:name=".Settings$MobileNetworkActivity" android:label="@string/network_settings_title" android:configChanges="orientation|screenSize|keyboardHidden" android:launchMode="singleInstance" android:launchMode="singleTop" android:exported="true"> <meta-data android:name="com.android.settings.FRAGMENT_CLASS" android:value="com.android.settings.network.telephony.MobileNetworkSettings"/> <intent-filter android:priority="1"> <!-- Displays the MobileNetworkActivity and opt-in dialog for capability discovery. --> <!-- Please sync with a list created within MobileNetworkIntentConverter.java --> <action android:name="android.intent.action.MAIN" /> <action android:name="android.telephony.ims.action.SHOW_CAPABILITY_DISCOVERY_OPT_IN" /> <action android:name="android.settings.NETWORK_OPERATOR_SETTINGS" /> <action android:name="android.settings.DATA_ROAMING_SETTINGS" /> Loading src/com/android/settings/Settings.java +23 −30 Original line number Diff line number Diff line Loading @@ -22,8 +22,6 @@ import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; import android.telephony.ims.ImsRcsManager; import android.text.TextUtils; import android.util.FeatureFlagUtils; Loading @@ -33,8 +31,7 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.settings.biometrics.face.FaceSettings; import com.android.settings.core.FeatureFlags; import com.android.settings.enterprise.EnterprisePrivacySettings; import com.android.settings.network.SubscriptionUtil; import com.android.settings.network.telephony.MobileNetworkUtils; import com.android.settings.network.MobileNetworkIntentConverter; import com.android.settings.overlay.FeatureFactory; import com.android.settings.safetycenter.SafetyCenterManagerWrapper; import com.android.settings.security.SecuritySettingsFeatureProvider; Loading Loading @@ -370,41 +367,37 @@ public class Settings extends SettingsActivity { public static class PowerMenuSettingsActivity extends SettingsActivity {} public static class MobileNetworkActivity extends SettingsActivity { public static final String TAG = "MobileNetworkActivity"; public static final String EXTRA_MMS_MESSAGE = "mms_message"; public static final String EXTRA_SHOW_CAPABILITY_DISCOVERY_OPT_IN = "show_capability_discovery_opt_in"; private MobileNetworkIntentConverter mIntentConverter; /** * Override of #onNewIntent() requires Activity to have "singleTop" launch mode within * AndroidManifest.xml */ @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); Log.d(TAG, "Starting onNewIntent"); createUiFromIntent(null /* savedState */, convertIntent(intent)); } @Override public Intent getIntent() { final Intent intent = new Intent(super.getIntent()); int subId = intent.getIntExtra(android.provider.Settings.EXTRA_SUB_ID, SubscriptionManager.INVALID_SUBSCRIPTION_ID); SubscriptionInfo subInfo = SubscriptionUtil.getSubscriptionOrDefault( getApplicationContext(), subId); CharSequence title = SubscriptionUtil.getUniqueSubscriptionDisplayName( subInfo, getApplicationContext()); intent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_TITLE, title); intent.putExtra(android.provider.Settings.EXTRA_SUB_ID, subId); if (android.provider.Settings.ACTION_MMS_MESSAGE_SETTING.equals(intent.getAction())) { // highlight "mms_message" preference. intent.putExtra(EXTRA_FRAGMENT_ARG_KEY, EXTRA_MMS_MESSAGE); } if (doesIntentContainOptInAction(intent)) { intent.putExtra(EXTRA_SHOW_CAPABILITY_DISCOVERY_OPT_IN, maybeShowContactDiscoveryDialog(subId)); } return intent; } private boolean maybeShowContactDiscoveryDialog(int subId) { // If this activity was launched using ACTION_SHOW_CAPABILITY_DISCOVERY_OPT_IN, show the // associated dialog only if the opt-in has not been granted yet. return MobileNetworkUtils.isContactDiscoveryVisible(getApplicationContext(), subId) // has the user already enabled this configuration? && !MobileNetworkUtils.isContactDiscoveryEnabled( getApplicationContext(), subId); return convertIntent(super.getIntent()); } private Intent convertIntent(Intent copyFrom) { if (mIntentConverter == null) { mIntentConverter = new MobileNetworkIntentConverter(this); } Intent intent = mIntentConverter.apply(copyFrom); return (intent == null) ? copyFrom : intent; } public static boolean doesIntentContainOptInAction(Intent intent) { Loading src/com/android/settings/SettingsActivity.java +3 −0 Original line number Diff line number Diff line Loading @@ -264,7 +264,10 @@ public class SettingsActivity extends SettingsBaseActivity super.onCreate(savedState); Log.d(LOG_TAG, "Starting onCreate"); createUiFromIntent(savedState, intent); } protected void createUiFromIntent(Bundle savedState, Intent intent) { long startTime = System.currentTimeMillis(); final FeatureFactory factory = FeatureFactory.getFactory(this); Loading src/com/android/settings/bluetooth/BluetoothPermissionRequest.java +1 −1 Original line number Diff line number Diff line Loading @@ -126,7 +126,7 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver { // "Clear All Notifications" button Intent deleteIntent = new Intent(BluetoothDevice.ACTION_CONNECTION_ACCESS_REPLY); deleteIntent.setPackage("com.android.bluetooth.services"); deleteIntent.setPackage("com.android.bluetooth"); deleteIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mDevice); deleteIntent.putExtra(BluetoothDevice.EXTRA_CONNECTION_ACCESS_RESULT, BluetoothDevice.CONNECTION_ACCESS_NO); Loading src/com/android/settings/development/BluetoothMaxConnectedAudioDevicesPreferenceController.java +2 −2 Original line number Diff line number Diff line Loading @@ -47,10 +47,10 @@ public class BluetoothMaxConnectedAudioDevicesPreferenceController extends try { Resources res = context.getPackageManager().getResourcesForApplication( "com.android.bluetooth.services"); "com.android.bluetooth"); mDefaultMaxConnectedAudioDevices = res.getInteger(res.getIdentifier( "config_bluetooth_max_connected_audio_devices", "integer", "com.android.bluetooth.services")); "integer", "com.android.bluetooth")); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } Loading Loading
AndroidManifest.xml +3 −1 Original line number Diff line number Diff line Loading @@ -249,12 +249,14 @@ android:name=".Settings$MobileNetworkActivity" android:label="@string/network_settings_title" android:configChanges="orientation|screenSize|keyboardHidden" android:launchMode="singleInstance" android:launchMode="singleTop" android:exported="true"> <meta-data android:name="com.android.settings.FRAGMENT_CLASS" android:value="com.android.settings.network.telephony.MobileNetworkSettings"/> <intent-filter android:priority="1"> <!-- Displays the MobileNetworkActivity and opt-in dialog for capability discovery. --> <!-- Please sync with a list created within MobileNetworkIntentConverter.java --> <action android:name="android.intent.action.MAIN" /> <action android:name="android.telephony.ims.action.SHOW_CAPABILITY_DISCOVERY_OPT_IN" /> <action android:name="android.settings.NETWORK_OPERATOR_SETTINGS" /> <action android:name="android.settings.DATA_ROAMING_SETTINGS" /> Loading
src/com/android/settings/Settings.java +23 −30 Original line number Diff line number Diff line Loading @@ -22,8 +22,6 @@ import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; import android.telephony.ims.ImsRcsManager; import android.text.TextUtils; import android.util.FeatureFlagUtils; Loading @@ -33,8 +31,7 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.settings.biometrics.face.FaceSettings; import com.android.settings.core.FeatureFlags; import com.android.settings.enterprise.EnterprisePrivacySettings; import com.android.settings.network.SubscriptionUtil; import com.android.settings.network.telephony.MobileNetworkUtils; import com.android.settings.network.MobileNetworkIntentConverter; import com.android.settings.overlay.FeatureFactory; import com.android.settings.safetycenter.SafetyCenterManagerWrapper; import com.android.settings.security.SecuritySettingsFeatureProvider; Loading Loading @@ -370,41 +367,37 @@ public class Settings extends SettingsActivity { public static class PowerMenuSettingsActivity extends SettingsActivity {} public static class MobileNetworkActivity extends SettingsActivity { public static final String TAG = "MobileNetworkActivity"; public static final String EXTRA_MMS_MESSAGE = "mms_message"; public static final String EXTRA_SHOW_CAPABILITY_DISCOVERY_OPT_IN = "show_capability_discovery_opt_in"; private MobileNetworkIntentConverter mIntentConverter; /** * Override of #onNewIntent() requires Activity to have "singleTop" launch mode within * AndroidManifest.xml */ @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); Log.d(TAG, "Starting onNewIntent"); createUiFromIntent(null /* savedState */, convertIntent(intent)); } @Override public Intent getIntent() { final Intent intent = new Intent(super.getIntent()); int subId = intent.getIntExtra(android.provider.Settings.EXTRA_SUB_ID, SubscriptionManager.INVALID_SUBSCRIPTION_ID); SubscriptionInfo subInfo = SubscriptionUtil.getSubscriptionOrDefault( getApplicationContext(), subId); CharSequence title = SubscriptionUtil.getUniqueSubscriptionDisplayName( subInfo, getApplicationContext()); intent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_TITLE, title); intent.putExtra(android.provider.Settings.EXTRA_SUB_ID, subId); if (android.provider.Settings.ACTION_MMS_MESSAGE_SETTING.equals(intent.getAction())) { // highlight "mms_message" preference. intent.putExtra(EXTRA_FRAGMENT_ARG_KEY, EXTRA_MMS_MESSAGE); } if (doesIntentContainOptInAction(intent)) { intent.putExtra(EXTRA_SHOW_CAPABILITY_DISCOVERY_OPT_IN, maybeShowContactDiscoveryDialog(subId)); } return intent; } private boolean maybeShowContactDiscoveryDialog(int subId) { // If this activity was launched using ACTION_SHOW_CAPABILITY_DISCOVERY_OPT_IN, show the // associated dialog only if the opt-in has not been granted yet. return MobileNetworkUtils.isContactDiscoveryVisible(getApplicationContext(), subId) // has the user already enabled this configuration? && !MobileNetworkUtils.isContactDiscoveryEnabled( getApplicationContext(), subId); return convertIntent(super.getIntent()); } private Intent convertIntent(Intent copyFrom) { if (mIntentConverter == null) { mIntentConverter = new MobileNetworkIntentConverter(this); } Intent intent = mIntentConverter.apply(copyFrom); return (intent == null) ? copyFrom : intent; } public static boolean doesIntentContainOptInAction(Intent intent) { Loading
src/com/android/settings/SettingsActivity.java +3 −0 Original line number Diff line number Diff line Loading @@ -264,7 +264,10 @@ public class SettingsActivity extends SettingsBaseActivity super.onCreate(savedState); Log.d(LOG_TAG, "Starting onCreate"); createUiFromIntent(savedState, intent); } protected void createUiFromIntent(Bundle savedState, Intent intent) { long startTime = System.currentTimeMillis(); final FeatureFactory factory = FeatureFactory.getFactory(this); Loading
src/com/android/settings/bluetooth/BluetoothPermissionRequest.java +1 −1 Original line number Diff line number Diff line Loading @@ -126,7 +126,7 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver { // "Clear All Notifications" button Intent deleteIntent = new Intent(BluetoothDevice.ACTION_CONNECTION_ACCESS_REPLY); deleteIntent.setPackage("com.android.bluetooth.services"); deleteIntent.setPackage("com.android.bluetooth"); deleteIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mDevice); deleteIntent.putExtra(BluetoothDevice.EXTRA_CONNECTION_ACCESS_RESULT, BluetoothDevice.CONNECTION_ACCESS_NO); Loading
src/com/android/settings/development/BluetoothMaxConnectedAudioDevicesPreferenceController.java +2 −2 Original line number Diff line number Diff line Loading @@ -47,10 +47,10 @@ public class BluetoothMaxConnectedAudioDevicesPreferenceController extends try { Resources res = context.getPackageManager().getResourcesForApplication( "com.android.bluetooth.services"); "com.android.bluetooth"); mDefaultMaxConnectedAudioDevices = res.getInteger(res.getIdentifier( "config_bluetooth_max_connected_audio_devices", "integer", "com.android.bluetooth.services")); "integer", "com.android.bluetooth")); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } Loading