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

Commit d17f96ae authored by Adam Lesinski's avatar Adam Lesinski Committed by Android (Google) Code Review
Browse files

Merge "Allow multiple Resources associated with an Activity" into nyc-dev

parents a004ed77 7f3f4998
Loading
Loading
Loading
Loading
+29 −11
Original line number Diff line number Diff line
@@ -1993,7 +1993,7 @@ class ContextImpl extends Context {
        ContextImpl context = new ContextImpl(null, mainThread,
                packageInfo, null, null, 0, null, null, Display.INVALID_DISPLAY);
        context.mResources.updateConfiguration(context.mResourcesManager.getConfiguration(),
                context.mResourcesManager.getDisplayMetricsLocked());
                context.mResourcesManager.getDisplayMetrics());
        return context;
    }

@@ -2065,6 +2065,10 @@ class ContextImpl extends Context {
                    || overrideConfiguration != null
                    || (compatInfo != null && compatInfo.applicationScale
                            != resources.getCompatibilityInfo().applicationScale)) {

                if (container != null) {
                    // This is a nested Context, so it can't be a base Activity context.
                    // Just create a regular Resources object associated with the Activity.
                    resources = mResourcesManager.getResources(
                            activityToken,
                            packageInfo.getResDir(),
@@ -2075,6 +2079,20 @@ class ContextImpl extends Context {
                            overrideConfiguration,
                            compatInfo,
                            packageInfo.getClassLoader());
                } else {
                    // This is not a nested Context, so it must be the root Activity context.
                    // All other nested Contexts will inherit the configuration set here.
                    resources = mResourcesManager.createBaseActivityResources(
                            activityToken,
                            packageInfo.getResDir(),
                            packageInfo.getSplitResDirs(),
                            packageInfo.getOverlayDirs(),
                            packageInfo.getApplicationInfo().sharedLibraryFiles,
                            displayId,
                            overrideConfiguration,
                            compatInfo,
                            packageInfo.getClassLoader());
                }
            }
        }
        mResources = resources;
+227 −73

File changed.

Preview size limit exceeded, changes collapsed.

+9 −0
Original line number Diff line number Diff line
@@ -1251,6 +1251,15 @@
        <service android:name="android.os.BinderThreadPriorityService"
                android:process=":BinderThreadPriorityService" />

        <!-- Used by ApplyOverrideConfigurationTest -->
        <activity android:name="android.app.activity.ApplyOverrideConfigurationActivity"
                  android:configChanges="orientation|screenSize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
            </intent-filter>
        </activity>

        <!-- Application components used for search manager tests -->

        <activity android:name="android.app.activity.SearchableActivity"
+32 −0

File added.

Preview size limit exceeded, changes collapsed.

+66 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading