[Settings] 1. Add configChange for WFC Activity to cover the changes of rotation and screen size am: 6cf16b0aa9
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16145006 Change-Id: Idea7f177ee4897c20bd7faf773a34e79976f2376
This commit is contained in:
@@ -3350,6 +3350,7 @@
|
||||
<activity
|
||||
android:name="Settings$WifiCallingSettingsActivity"
|
||||
android:exported="true"
|
||||
android:configChanges="orientation|keyboard|keyboardHidden|screenSize|smallestScreenSize|screenLayout"
|
||||
android:label="@string/wifi_calling_settings_title">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
@@ -33,7 +33,6 @@ import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.activityembedding.ActivityEmbeddingRulesController;
|
||||
import com.android.settings.core.PreferenceControllerMixin;
|
||||
import com.android.settings.dashboard.DashboardFragment;
|
||||
import com.android.settings.network.helper.SubscriptionAnnotation;
|
||||
@@ -202,12 +201,9 @@ public class MobileNetworkSummaryController extends AbstractPreferenceController
|
||||
|| mStatusCache.isPhysicalSimDisableSupport()) {
|
||||
final Intent intent = new Intent(mContext, MobileNetworkActivity.class);
|
||||
intent.putExtra(Settings.EXTRA_SUB_ID, info.getSubscriptionId());
|
||||
// MobilenetworkActivity is singleTask, set SplitPairRule to show in 2-pane.
|
||||
ActivityEmbeddingRulesController.registerTwoPanePairRuleForSettingsHome(
|
||||
mContext,
|
||||
intent.getComponent(),
|
||||
null /* secondaryIntentAction */,
|
||||
false /* clearTop */);
|
||||
// MobileNetworkActivity is singleTask, set SplitPairRule to show in 2-pane.
|
||||
MobileNetworkTwoPaneUtils.registerTwoPaneForMobileNetwork(mContext, intent,
|
||||
null);
|
||||
mContext.startActivity(intent);
|
||||
return true;
|
||||
}
|
||||
|
@@ -0,0 +1,29 @@
|
||||
package com.android.settings.network;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.settings.activityembedding.ActivityEmbeddingRulesController;
|
||||
|
||||
public class MobileNetworkTwoPaneUtils {
|
||||
|
||||
private static final String TAG = "MobileNetworkTwoPaneUtils";
|
||||
|
||||
/**
|
||||
* TODO: b/206061070, the problem of multi-instance should be fixed in Android T to apply the
|
||||
* Settings' architecture and 2 panes mode instead of registering the rule.
|
||||
*
|
||||
* The launchMode of MobileNetworkActivity is singleTask, set SplitPairRule to show in 2-pane.
|
||||
*/
|
||||
public static void registerTwoPaneForMobileNetwork(Context context, Intent intent,
|
||||
@Nullable String secondaryIntentAction) {
|
||||
Log.d(TAG, "registerTwoPaneForMobileNetwork");
|
||||
ActivityEmbeddingRulesController.registerTwoPanePairRuleForSettingsHome(
|
||||
context,
|
||||
intent.getComponent(),
|
||||
secondaryIntentAction /* secondaryIntentAction */,
|
||||
false /* clearTop */);
|
||||
}
|
||||
}
|
@@ -130,6 +130,8 @@ public class NetworkProviderDownloadedSimListController extends
|
||||
pref.setOnPreferenceClickListener(clickedPref -> {
|
||||
final Intent intent = new Intent(mContext, MobileNetworkActivity.class);
|
||||
intent.putExtra(Settings.EXTRA_SUB_ID, info.getSubscriptionId());
|
||||
// MobileNetworkActivity is singleTask, set SplitPairRule to show in 2-pane.
|
||||
MobileNetworkTwoPaneUtils.registerTwoPaneForMobileNetwork(mContext, intent, null);
|
||||
mContext.startActivity(intent);
|
||||
return true;
|
||||
});
|
||||
|
@@ -128,6 +128,9 @@ public class NetworkProviderSimListController extends AbstractPreferenceControll
|
||||
} else {
|
||||
final Intent intent = new Intent(mContext, MobileNetworkActivity.class);
|
||||
intent.putExtra(Settings.EXTRA_SUB_ID, info.getSubscriptionId());
|
||||
// MobileNetworkActivity is singleTask, set SplitPairRule to show in 2-pane.
|
||||
MobileNetworkTwoPaneUtils.registerTwoPaneForMobileNetwork(mContext, intent,
|
||||
null);
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
return true;
|
||||
|
@@ -396,6 +396,8 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl
|
||||
private static void startMobileNetworkActivity(Context context, int subId) {
|
||||
final Intent intent = new Intent(context, MobileNetworkActivity.class);
|
||||
intent.putExtra(Settings.EXTRA_SUB_ID, subId);
|
||||
// MobileNetworkActivity is singleTask, set SplitPairRule to show in 2-pane.
|
||||
MobileNetworkTwoPaneUtils.registerTwoPaneForMobileNetwork(context, intent, null);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
|
@@ -52,6 +52,7 @@ import android.util.Log;
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.settings.HelpTrampoline;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.network.MobileNetworkTwoPaneUtils;
|
||||
import com.android.settings.network.SubscriptionUtil;
|
||||
import com.android.settings.network.telephony.MobileNetworkActivity;
|
||||
|
||||
@@ -263,7 +264,9 @@ public class SimSelectNotification extends BroadcastReceiver {
|
||||
Intent resultIntent = new Intent(Settings.ACTION_MMS_MESSAGE_SETTING);
|
||||
resultIntent.setClass(context, MobileNetworkActivity.class);
|
||||
resultIntent.putExtra(Settings.EXTRA_SUB_ID, subId);
|
||||
resultIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
// MobileNetworkActivity is singleTask, set SplitPairRule to show in 2-pane.
|
||||
MobileNetworkTwoPaneUtils.registerTwoPaneForMobileNetwork(context, resultIntent,
|
||||
Settings.ACTION_MMS_MESSAGE_SETTING);
|
||||
PendingIntent resultPendingIntent = PendingIntent.getActivity(context, 0, resultIntent,
|
||||
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
|
||||
builder.setContentIntent(resultPendingIntent);
|
||||
|
@@ -157,7 +157,7 @@ public class WifiCallingSettingsForSub extends SettingsPreferenceFragment
|
||||
}
|
||||
|
||||
/*
|
||||
* Launch carrier emergency address managemnent activity
|
||||
* Launch carrier emergency address management activity
|
||||
*/
|
||||
private final OnPreferenceClickListener mUpdateAddressListener =
|
||||
preference -> {
|
||||
|
Reference in New Issue
Block a user