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

Commit edff5e3b authored by tanxiaoyan's avatar tanxiaoyan
Browse files

Update application info for activity record when application info changed



Activity manager will schedule application info changed for process record and app thread When OMS#setEnabled is called.
But the app process may be restarted for top-activity, it use application of the top activity which may not be updated.

Bug:294624020

Change-Id: I7fac9fab11c6f62350b31e486dcea89268bd086b
Signed-off-by: default avatartanxiaoyan <tanxiaoyan@xiaomi.com>
parent 4ed5e379
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4698,6 +4698,7 @@ public final class ProcessList {
                        if (ai != null) {
                            if (ai.packageName.equals(app.info.packageName)) {
                                app.info = ai;
                                app.getWindowProcessController().updateApplicationInfo(ai);
                                PlatformCompatCache.getInstance()
                                        .onApplicationInfoChanged(ai);
                            }
+6 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio
    private static final String TAG_CONFIGURATION = TAG + POSTFIX_CONFIGURATION;

    // all about the first app in the process
    final ApplicationInfo mInfo;
    volatile ApplicationInfo mInfo;
    final String mName;
    final int mUid;

@@ -1500,12 +1500,17 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio
            Configuration overrideConfig = new Configuration(r.getRequestedOverrideConfiguration());
            overrideConfig.assetsSeq = assetSeq;
            r.onRequestedOverrideConfigurationChanged(overrideConfig);
            r.updateApplicationInfo(mInfo);
            if (r.isVisibleRequested()) {
                r.ensureActivityConfiguration(0, true);
            }
        }
    }

    public void updateApplicationInfo(ApplicationInfo aInfo) {
        mInfo = aInfo;
    }

    /**
     * This is called for sending {@link android.app.servertransaction.LaunchActivityItem}.
     * The caller must call {@link #setLastReportedConfiguration} if the delivered configuration