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

Commit f0ea79bd authored by Brint E. Kriebel's avatar Brint E. Kriebel
Browse files

Merge branch 'cm-11.0' into stable/cm-11.0

Conflicts:
	core/res/res/values-af/cm_plurals.xml
	core/res/res/values-ar/cm_strings.xml
	core/res/res/values-ca/cm_strings.xml
	core/res/res/values-cs/cm_strings.xml
	core/res/res/values-da/cm_strings.xml
	core/res/res/values-de/cm_strings.xml
	core/res/res/values-el/cm_strings.xml
	core/res/res/values-es-rXA/cm_strings.xml
	core/res/res/values-es/cm_strings.xml
	core/res/res/values-fi/cm_strings.xml
	core/res/res/values-fr/cm_strings.xml
	core/res/res/values-hu/cm_strings.xml
	core/res/res/values-it/cm_strings.xml
	core/res/res/values-ja/cm_strings.xml
	core/res/res/values-ko/cm_strings.xml
	core/res/res/values-lt/cm_strings.xml
	core/res/res/values-pl/cm_strings.xml
	core/res/res/values-pt-rBR/cm_strings.xml
	core/res/res/values-pt-rPT/cm_strings.xml
	core/res/res/values-ru/cm_strings.xml
	core/res/res/values-sk/cm_strings.xml
	core/res/res/values-sr/cm_strings.xml
	core/res/res/values-tr/cm_strings.xml
	core/res/res/values-zh-rCN/cm_strings.xml
	core/res/res/values-zh-rHK/cm_strings.xml
	core/res/res/values-zh-rTW/cm_strings.xml
	packages/PrintSpooler/res/values-ku/strings.xml
	packages/SystemUI/res/values-ja/cm_strings.xml

Change-Id: Icc8588be96a3b1ad22a396f3488fc69f10305efc
parents cb3e1dd8 d0456e88
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -1416,6 +1416,20 @@ final class ApplicationPackageManager extends PackageManager {
        }
    }

    /**
     * @hide
     */
    @Override
    public int processThemeResources(String themePkgName) {
        try {
            return mPM.processThemeResources(themePkgName);
        } catch (RemoteException e) {
            Log.e(TAG, "Unable to process theme resources for " + themePkgName, e);
        }

        return 0;
    }

    @Override
    public void setComponentProtectedSetting(ComponentName componentName, boolean newState) {
        try {
+19 −4
Original line number Diff line number Diff line
@@ -485,9 +485,9 @@ public class ResourcesManager {
        PackageInfo piTarget = null;
        PackageInfo piAndroid = null;

        // Some apps run in process of another app (eg keyguard/systemUI) so we must get the package name
        // from the res tables. The 0th base package name will be the android group. The
        // 1st base package name will be the app group if one is attached. Check if it is there
        // Some apps run in process of another app (eg keyguard/systemUI) so we must get the
        // package name from the res tables. The 0th base package name will be the android group.
        // The 1st base package name will be the app group if one is attached. Check if it is there
        // first or else the system will crash!
        String basePackageName = null;
        String resourcePackageName = null;
@@ -619,9 +619,24 @@ public class ResourcesManager {
     * @return true if succes, false otherwise
     */
    private boolean attachCommonAssets(AssetManager assets, ThemeConfig theme) {
        // Some apps run in process of another app (eg keyguard/systemUI) so we must get the
        // package name from the res tables. The 0th base package name will be the android group.
        // The 1st base package name will be the app group if one is attached. Check if it is there
        // first or else the system will crash!
        String basePackageName;
        int count = assets.getBasePackageCount();
        if (count > 1) {
            basePackageName  = assets.getBasePackageName(1);
        } else if (count == 1) {
            basePackageName  = assets.getBasePackageName(0);
        } else {
            return false;
        }

        PackageInfo piTheme = null;
        try {
            piTheme = getPackageManager().getPackageInfo(theme.getOverlayPkgName(), 0,
            piTheme = getPackageManager().getPackageInfo(
                    theme.getOverlayPkgNameForApp(basePackageName), 0,
                    UserHandle.getCallingUserId());
        } catch (RemoteException e) {
        }
+1 −0
Original line number Diff line number Diff line
@@ -425,6 +425,7 @@ interface IPackageManager {
    /** Themes */
    void updateIconMapping(String pkgName);
    ComposedIconInfo getComposedIconInfo();
    int processThemeResources(String themePkgName);

    /** Protected Apps */
    void setComponentProtectedSetting(in ComponentName componentName, in boolean newState,
+12 −0
Original line number Diff line number Diff line
@@ -3290,6 +3290,18 @@ public abstract class PackageManager {
     */
    public abstract void updateIconMaps(String pkgName);

    /**
     * Used to compile theme resources for a given theme
     * @param themePkgName
     * @return A value of 0 indicates success.  Possible errors returned are:
     * {@link android.content.pm.PackageManager#INSTALL_FAILED_THEME_AAPT_ERROR},
     * {@link android.content.pm.PackageManager#INSTALL_FAILED_THEME_IDMAP_ERROR}, or
     * {@link android.content.pm.PackageManager#INSTALL_FAILED_THEME_UNKNOWN_ERROR}
     *
     * @hide
     */
    public abstract int processThemeResources(String themePkgName);

    /**
     * Update Component protection state
     * @hide
+54 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */
package android.content.pm;

import android.Manifest;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.ContentValues;
@@ -22,7 +23,11 @@ import android.content.Context;
import android.content.ContextWrapper;
import android.content.IntentFilter;
import android.content.res.AssetManager;
import android.content.res.Configuration;
import android.content.res.ThemeConfig;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.FileUtils;
@@ -103,6 +108,10 @@ public class ThemeUtils {

    public static final String CATEGORY_THEME_COMPONENT_PREFIX = "org.cyanogenmod.intent.category.";

    private static final String SETTINGS_DB =
            "/data/data/com.android.providers.settings/databases/settings.db";
    private static final String SETTINGS_SECURE_TABLE = "secure";

    // Actions in manifests which identify legacy icon packs
    public static final String[] sSupportedActions = new String[] {
            "org.adw.launcher.THEMES",
@@ -668,4 +677,49 @@ public class ThemeUtils {
            }
        }
    }

    /**
     * Get the boot theme by accessing the settings.db directly instead of using a content resolver.
     * Only use this when the system is starting up and the settings content provider is not ready.
     *
     * Note: This method will only succeed if the system is calling this since normal apps will not
     * be able to access the settings db path.
     *
     * @return The boot theme or null if unable to read the database or get the entry for theme
     *         config
     */
    public static ThemeConfig getBootThemeDirty() {
        ThemeConfig config = null;
        SQLiteDatabase db = null;
        try {
            db = SQLiteDatabase.openDatabase(SETTINGS_DB, null,
                    SQLiteDatabase.OPEN_READONLY);
            if (db != null) {
                String selection = "name=?";
                String[] selectionArgs =
                        { Configuration.THEME_PKG_CONFIGURATION_PERSISTENCE_PROPERTY };
                String[] columns = {"value"};
                Cursor c = db.query(SETTINGS_SECURE_TABLE, columns, selection, selectionArgs,
                        null, null, null);
                if (c != null) {
                    if (c.getCount() > 0) {
                        c.moveToFirst();
                        String json = c.getString(0);
                        if (json != null) {
                            config = ThemeConfig.fromJson(json);
                        }
                    }
                    c.close();
                }
            }
        } catch (Exception e) {
            Log.w(TAG, "Unable to open " + SETTINGS_DB, e);
        } finally {
            if (db != null) {
                db.close();
            }
        }

        return config;
    }
}
Loading