summaryrefslogtreecommitdiffstats
path: root/services/java
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2015-05-06 10:41:43 -0700
committerAlan Viverette <alanv@google.com>2015-05-06 10:41:43 -0700
commite54d245b993e1347cb32c23a6bdc907a45fab324 (patch)
treebe087de6d12733ca9800724ac77103a0b2173964 /services/java
parent424681e43e454bfcbceb863ddccb875ea57ec26f (diff)
downloadframeworks_base-e54d245b993e1347cb32c23a6bdc907a45fab324.zip
frameworks_base-e54d245b993e1347cb32c23a6bdc907a45fab324.tar.gz
frameworks_base-e54d245b993e1347cb32c23a6bdc907a45fab324.tar.bz2
Improve keying for theme caches, rebase system theme on config change
Themes now use an array of applied styles rather than a String to store their history. They are keyed based on a hash code computed from the history of applied styles. The themed drawable cache has been abstracted out into its own class. Also updates system context to use DayNight as the default and ensures that GlobalActions uses the correct context, which exercises the change. CTS tests have been added in another CL. Bug: 20421157 Change-Id: I9eb4b7dffd198ad24d02f656eaf0839570b59caa
Diffstat (limited to 'services/java')
-rw-r--r--services/java/com/android/server/SystemServer.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 2d265e2..925a609 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -28,6 +28,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
+import android.content.res.Resources.Theme;
import android.os.Build;
import android.os.Environment;
import android.os.FactoryTest;
@@ -291,7 +292,7 @@ public final class SystemServer {
private void createSystemContext() {
ActivityThread activityThread = ActivityThread.systemMain();
mSystemContext = activityThread.getSystemContext();
- mSystemContext.setTheme(android.R.style.Theme_DeviceDefault_Light_DarkActionBar);
+ mSystemContext.setTheme(android.R.style.Theme_Material_DayNight_DarkActionBar);
}
/**
@@ -1026,6 +1027,12 @@ public final class SystemServer {
w.getDefaultDisplay().getMetrics(metrics);
context.getResources().updateConfiguration(config, metrics);
+ // The system context's theme may be configuration-dependent.
+ final Theme systemTheme = context.getTheme();
+ if (systemTheme.getChangingConfigurations() != 0) {
+ systemTheme.rebase();
+ }
+
try {
// TODO: use boot phase
mPowerManagerService.systemReady(mActivityManagerService.getAppOpsService());