Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6cf16b0a authored by Zoey Chen's avatar Zoey Chen
Browse files

[Settings] 1. Add configChange for WFC Activity to cover the changes of rotation and screen size

2. register split rule for MobileNetworkActivity

Bug: 204508876
Test: manual
Change-Id: Iff3dae41293e79b274d2928cb51efea46fb45dd4
parent 822f98c1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3337,6 +3337,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" />
+3 −7
Original line number Diff line number Diff line
@@ -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;
                }
+29 −0
Original line number Diff line number Diff line
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 */);
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -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;
            });
+3 −0
Original line number Diff line number Diff line
@@ -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;
Loading