Skip to content

Commit 68c3191

Browse files
kufikugelsrisurya95
authored andcommitted
Add missing/needed lines for TRDS
- These fixes were pulled from KK as we had theme engine and TRDS then. Change-Id: Id8eaa485937e8b28a7a52eabae4044ba371897db
1 parent 6718bcb commit 68c3191

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

core/java/android/app/ResourcesManager.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ public final boolean applyConfigurationToResourcesLocked(Configuration config,
456456
DisplayMetrics dm = defaultDisplayMetrics;
457457
final boolean hasOverrideConfiguration = key.hasOverrideConfiguration();
458458
boolean themeChanged = (changes & ActivityInfo.CONFIG_THEME_RESOURCE) != 0;
459+
final boolean themeChanged2 = (changes & ActivityInfo.CONFIG_UI_THEME_MODE) != 0;
459460
if (themeChanged) {
460461
AssetManager am = r.getAssets();
461462
if (am.hasThemeSupport()) {
@@ -471,7 +472,7 @@ public final boolean applyConfigurationToResourcesLocked(Configuration config,
471472
}
472473
}
473474
}
474-
if ((!isDefaultDisplay || hasOverrideConfiguration)) {
475+
if (!isDefaultDisplay || hasOverrideConfiguration) {
475476
if (tmpConfig == null) {
476477
tmpConfig = new Configuration();
477478
}
@@ -487,7 +488,7 @@ public final boolean applyConfigurationToResourcesLocked(Configuration config,
487488
} else {
488489
r.updateConfiguration(config, dm, compat);
489490
}
490-
if (themeChanged) {
491+
if (themeChanged || themeChanged2) {
491492
r.updateStringCache();
492493
}
493494
//Slog.i(TAG, "Updated app resources " + v.getKey()

core/java/android/content/res/Resources.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,6 +2034,15 @@ private void clearDrawableCacheLocked(
20342034
return;
20352035
}
20362036

2037+
if (Configuration.needNewResources(configChanges, 0)) {
2038+
if (DEBUG_CONFIG) {
2039+
Log.d(TAG, "Clear drawable cache from config changes: 0x"
2040+
+ Integer.toHexString(configChanges));
2041+
}
2042+
cache.clear();
2043+
return;
2044+
}
2045+
20372046
if (DEBUG_CONFIG) {
20382047
Log.d(TAG, "Cleaning up drawables config changes: 0x"
20392048
+ Integer.toHexString(configChanges));

core/java/com/android/internal/app/ResolverActivity.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,12 @@ protected void onCreate(Bundle savedInstanceState, Intent intent,
206206
protected void onCreate(Bundle savedInstanceState, Intent intent,
207207
CharSequence title, int defaultTitleRes, Intent[] initialIntents,
208208
List<ResolveInfo> rList, boolean alwaysUseOption) {
209-
setTheme(R.style.Theme_DeviceDefault_Resolver);
209+
if (getResources().getConfiguration().uiThemeMode
210+
== Configuration.UI_THEME_MODE_HOLO_DARK) {
211+
setTheme(R.style.Theme_DeviceDefault_Dialog_Alert);
212+
} else {
213+
setTheme(R.style.Theme_DeviceDefault_Resolver);
214+
}
210215
super.onCreate(savedInstanceState);
211216

212217
// Determine whether we should show that intent is forwarded

0 commit comments

Comments
 (0)