summaryrefslogtreecommitdiffstats
path: root/core/java/com
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2012-11-20 21:17:17 +0000
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2012-11-24 14:09:39 +0000
commitad3c9416092f09213d32eee8b59287766eae5d19 (patch)
tree0bc1e318ca15560299c662e37c6c4fedf0bcf1e6 /core/java/com
parent7d114fb838017d86ece76e18a7e1b0d8534595fa (diff)
downloadframeworks_base-ad3c9416092f09213d32eee8b59287766eae5d19.zip
frameworks_base-ad3c9416092f09213d32eee8b59287766eae5d19.tar.gz
frameworks_base-ad3c9416092f09213d32eee8b59287766eae5d19.tar.bz2
Squashed commit of the theme engine support.
Updated 4.2 support for the old T-Mobile theme engine, as usual needs the provider and switcher apps installed as well. I'm finally dropping the 400+ commit history on this, since everybody else keeps picking it up from CM as a single patch anyway... But for the record, nothing of this would be possible without Josh, Ed, and the rest of the TMo guys who wrote and maintained it until 2.2: amit chabra <amit.chabra@t-mobile.com> Amit Kohli <amit.kohli@t-mobile.com> Chris Cogar <chriscogar@t-mobile.com> Dirk Sigurdson <dirk.sigurdson@t-mobile.com> Ed Carrigan <edward.carrigan@t-mobile.com> Gaurav Sharma <gaurav.sharma3@t-mobile.com> Hui Feng <hui.feng@t-mobile.com> John Ritz <john.ritz1@t-mobile.com> Josh Guilfoyle <josh.guilfoyle@t-mobile.com> Mark Roberts <mark.roberts48@t-mobile.com> Pankaj Kumar <Pankaj.kumar6@t-mobile.com> Samuel Cheung <samuel.cheung@t-mobile.com> Sergey Ten <sergey.ten6@t-mobile.com> Change-Id: I7148d51be48f28a2dc4bdf9ec9018f04b268ffc4
Diffstat (limited to 'core/java/com')
-rw-r--r--core/java/com/android/internal/app/IAssetRedirectionManager.aidl42
-rw-r--r--core/java/com/android/internal/app/ThemeUtils.java56
-rw-r--r--core/java/com/android/internal/os/ZygoteInit.java4
3 files changed, 101 insertions, 1 deletions
diff --git a/core/java/com/android/internal/app/IAssetRedirectionManager.aidl b/core/java/com/android/internal/app/IAssetRedirectionManager.aidl
new file mode 100644
index 0000000..8b47f0b
--- /dev/null
+++ b/core/java/com/android/internal/app/IAssetRedirectionManager.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2011, T-Mobile USA, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.app;
+
+import android.content.res.PackageRedirectionMap;
+
+/**
+ * Interface used to interact with the AssetRedirectionManagerService.
+ */
+interface IAssetRedirectionManager {
+ /**
+ * Access the package redirection map for the supplied package name given a
+ * particular theme.
+ */
+ PackageRedirectionMap getPackageRedirectionMap(in String themePackageName,
+ String themeId, in String targetPackageName);
+
+ /**
+ * Clear all redirection maps for the given theme.
+ */
+ void clearRedirectionMapsByTheme(in String themePackageName,
+ in String themeId);
+
+ /**
+ * Clear all redirection maps for the given target package.
+ */
+ void clearPackageRedirectionMap(in String targetPackageName);
+}
diff --git a/core/java/com/android/internal/app/ThemeUtils.java b/core/java/com/android/internal/app/ThemeUtils.java
new file mode 100644
index 0000000..4265fd5
--- /dev/null
+++ b/core/java/com/android/internal/app/ThemeUtils.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2012 The CyanogenMod Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.app;
+
+import android.content.Context;
+import android.content.BroadcastReceiver;
+import android.content.IntentFilter;
+import android.content.pm.PackageManager;
+import android.util.Log;
+
+/**
+ * @hide
+ */
+
+public class ThemeUtils {
+ private static final String TAG = "ThemeUtils";
+ private static final String DATA_TYPE_TMOBILE_STYLE = "vnd.tmobile.cursor.item/style";
+ private static final String DATA_TYPE_TMOBILE_THEME = "vnd.tmobile.cursor.item/theme";
+ private static final String ACTION_TMOBILE_THEME_CHANGED = "com.tmobile.intent.action.THEME_CHANGED";
+
+ public static Context createUiContext(final Context context) {
+ try {
+ return context.createPackageContext("com.android.systemui", Context.CONTEXT_RESTRICTED);
+ } catch (PackageManager.NameNotFoundException e) {
+ }
+
+ return null;
+ }
+
+ public static void registerThemeChangeReceiver(final Context context, final BroadcastReceiver receiver) {
+ IntentFilter filter = new IntentFilter(ACTION_TMOBILE_THEME_CHANGED);
+ try {
+ filter.addDataType(DATA_TYPE_TMOBILE_THEME);
+ filter.addDataType(DATA_TYPE_TMOBILE_STYLE);
+ } catch (IntentFilter.MalformedMimeTypeException e) {
+ Log.e(TAG, "Could not add MIME types to filter", e);
+ }
+
+ context.registerReceiver(receiver, filter);
+ }
+}
+
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java
index 9e43749..4597a54 100644
--- a/core/java/com/android/internal/os/ZygoteInit.java
+++ b/core/java/com/android/internal/os/ZygoteInit.java
@@ -99,7 +99,7 @@ public class ZygoteInit {
private static final String PRELOADED_CLASSES = "preloaded-classes";
/** Controls whether we should preload resources during zygote init. */
- private static final boolean PRELOAD_RESOURCES = true;
+ private static final boolean PRELOAD_RESOURCES = false;
/**
* Invokes a static "main(argv[]) method on class "className".
@@ -361,6 +361,8 @@ public class ZygoteInit {
ar.recycle();
Log.i(TAG, "...preloaded " + N + " resources in "
+ (SystemClock.uptimeMillis()-startTime) + "ms.");
+ } else {
+ Log.i(TAG, "Preload resources disabled, skipped.");
}
mResources.finishPreloading();
} catch (RuntimeException e) {