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

Commit 17423d16 authored by Tsung-Mao Fang's avatar Tsung-Mao Fang
Browse files

Fix abnormal behavior on avatar account page

Prior to this cl, if user opens settings app
in single-pane first and navigates to
the avatar account page, then rotate the device,
user observed the account page was still shown
with full screen.

Because we didn't register correct split rule,
it causes the abormal behavior on two-pane mode.
In order to register correct rule,  we also need
to assign correct component name while opening the
account page.

Bug: 207609699
Test: Rebuilt apk and verify the behavior
Change-Id: I31def684c033c1d0c20870284826c6713a31b43d
parent 045983a6
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.OnLifecycleEvent;

import com.android.settings.R;
import com.android.settings.activityembedding.ActivityEmbeddingRulesController;
import com.android.settings.homepage.SettingsHomepageActivity;
import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.utils.ThreadUtils;
@@ -105,6 +106,17 @@ public class AvatarViewMixin implements LifecycleObserver {
                return;
            }

            // Set a component name since activity embedding requires a component name for
            // registering a rule.
            intent.setComponent(matchedIntents.get(0).getComponentInfo().getComponentName());
            ActivityEmbeddingRulesController.registerTwoPanePairRuleForSettingsHome(
                    mContext,
                    intent.getComponent(),
                    intent.getAction(),
                    false /* finishPrimaryWithSecondary */,
                    true /* finishSecondaryWithPrimary */,
                    false /* clearTop */);

            FeatureFactory.getFactory(mContext).getMetricsFeatureProvider()
                    .logSettingsTileClick(KEY_AVATAR_ICON, SettingsEnums.SETTINGS_HOMEPAGE);