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

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

Merge remote-tracking branch 'github/cm-11.0' into HEAD

Conflicts:
	services/java/com/android/server/pm/PackageManagerService.java

Change-Id: I13627327fc847c580db608fa7dc1d12dbb4fcd52
parents ed597586 44029dc8
Loading
Loading
Loading
Loading
+11 −16
Original line number Diff line number Diff line
@@ -4200,16 +4200,12 @@ public final class ActivityThread {

        Log.d(TAG, "handleBindApplication:" + data.processName );

        String runtime = VMRuntime.getRuntime().vmLibrary();

        String str  = SystemProperties.get("dalvik.vm.heaptargetutilization", "" );
        if( !str.equals("") ){
            float heapUtil = Float.valueOf(str.trim()).floatValue();
            VMRuntime.getRuntime().setTargetHeapUtilization(heapUtil);
            Log.d(TAG, "setTargetHeapUtilization:" + heapUtil );
        }
        // ART currently doesn't support these methods
        if (runtime.equals("libdvm.so")) {
        String heapMinFree = SystemProperties.get("dalvik.vm.heapminfree", "" );
        int minfree =  parseMemOption(heapMinFree);
        if( minfree > 0){
@@ -4222,7 +4218,6 @@ public final class ActivityThread {
            VMRuntime.getRuntime().setTargetHeapConcurrentStart(concurr_start);
            Log.d(TAG, "setTargetHeapConcurrentStart:" + concurr_start );
        }
        }

        ////
        ////If want to set application specific GC paramters, can use
+4 −3
Original line number Diff line number Diff line
@@ -368,10 +368,11 @@ class ContextImpl extends Context {
                            ctx.mMainThread.getHandler());
                }});

        registerService(CONNECTIVITY_SERVICE, new StaticServiceFetcher() {
                public Object createStaticService() {
        registerService(CONNECTIVITY_SERVICE, new ServiceFetcher() {
                public Object createService(ContextImpl ctx) {
                    IBinder b = ServiceManager.getService(CONNECTIVITY_SERVICE);
                    return new ConnectivityManager(IConnectivityManager.Stub.asInterface(b));
                    return new ConnectivityManager(IConnectivityManager.Stub.asInterface(b),
                        ctx.getPackageName());
                }});

        registerService(COUNTRY_DETECTOR, new StaticServiceFetcher() {
+19 −0
Original line number Diff line number Diff line
@@ -30,6 +30,12 @@ interface IWallpaperManager {
     */
    ParcelFileDescriptor setWallpaper(String name);

    /**
     * Set the keyguard wallpaper.
     * @hide
     */
    ParcelFileDescriptor setKeyguardWallpaper(String name);
    
    /**
     * Set the live wallpaper.
     */
@@ -41,6 +47,13 @@ interface IWallpaperManager {
    ParcelFileDescriptor getWallpaper(IWallpaperManagerCallback cb,
            out Bundle outParams);

    /**
     * Get the keyguard wallpaper.
     * @hide
     */
    ParcelFileDescriptor getKeyguardWallpaper(IWallpaperManagerCallback cb,
            out Bundle outParams);
    
    /**
     * Get information about a live wallpaper.
     */
@@ -51,6 +64,12 @@ interface IWallpaperManager {
     */
    void clearWallpaper();

    /*
     * Clear the keyguard wallpaper.
     * @hide
     */
    void clearKeyguardWallpaper();

    /**
     * Return whether there is a wallpaper set with the given name.
     */
+5 −0
Original line number Diff line number Diff line
@@ -28,4 +28,9 @@ oneway interface IWallpaperManagerCallback {
     * Called when the wallpaper has changed
     */
    void onWallpaperChanged();

    /**
     * Called when the keygaurd wallpaper has changed
     */
     void onKeyguardWallpaperChanged();
}
+48 −0
Original line number Diff line number Diff line
@@ -229,6 +229,7 @@ public class ResourcesManager {

            if (config.customTheme != null) {
                attachThemeAssets(assets, config.customTheme);
                attachCommonAssets(assets, config.customTheme);
                attachIconAssets(assets, config.customTheme);
            }
        }
@@ -351,6 +352,7 @@ public class ResourcesManager {
                        detachThemeAssets(am);
                        if (config.customTheme != null) {
                            attachThemeAssets(am, config.customTheme);
                            attachCommonAssets(am, config.customTheme);
                            attachIconAssets(am, config.customTheme);
                            setActivityIcons(r);
                        }
@@ -506,9 +508,49 @@ public class ResourcesManager {
        return true;
    }

    /**
     * Attach the necessary common asset paths. Common assets should be in a different
     * namespace than the standard 0x7F.
     *
     * @param assets
     * @param theme
     * @return true if succes, false otherwise
     */
    private boolean attachCommonAssets(AssetManager assets, CustomTheme theme) {
        PackageInfo piTheme = null;
        try {
            piTheme = getPackageManager().getPackageInfo(theme.getThemePackageName(), 0,
                    UserHandle.myUserId());
        } catch (RemoteException e) {
        }

        if (piTheme == null || piTheme.applicationInfo == null || piTheme.isLegacyThemeApk) {
            return false;
        }

        String themePackageName =
                ThemeUtils.getCommonPackageName(piTheme.applicationInfo.packageName);
        if (themePackageName != null && !themePackageName.isEmpty()) {
            String themePath =  piTheme.applicationInfo.publicSourceDir;
            String prefixPath = ThemeUtils.COMMON_RES_PATH;
            String resCachePath = ThemeUtils.getResDir(ThemeUtils.COMMON_RES_TARGET, piTheme);
            String resTablePath = resCachePath + "/resources.arsc";
            String resApkPath = resCachePath + "/resources.apk";
            int cookie = assets.addCommonOverlayPath(themePath, resTablePath, resApkPath,
                    prefixPath);
            if (cookie != 0) {
                assets.setCommonResCookie(cookie);
                assets.setCommonResPackageName(themePackageName);
            }
        }

        return true;
    }

    private void detachThemeAssets(AssetManager assets) {
        String themePackageName = assets.getThemePackageName();
        String iconPackageName = assets.getIconPackageName();
        String commonResPackageName = assets.getCommonResPackageName();

        //Remove Icon pack if it exists
        if (!TextUtils.isEmpty(iconPackageName) && assets.getIconPackCookie() > 0) {
@@ -516,6 +558,12 @@ public class ResourcesManager {
            assets.setIconPackageName(null);
            assets.setIconPackCookie(0);
        }
        //Remove common resources if it exists
        if (!TextUtils.isEmpty(commonResPackageName) && assets.getCommonResCookie() > 0) {
            assets.removeOverlayPath(commonResPackageName, assets.getCommonResCookie());
            assets.setCommonResPackageName(null);
            assets.setCommonResCookie(0);
        }
        final List<Integer> themeCookies = assets.getThemeCookies();
        if (!TextUtils.isEmpty(themePackageName) && !themeCookies.isEmpty()) {
            // remove overlays in reverse order
Loading