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

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

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

parents a473a80c 98703630
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1540,8 +1540,8 @@ public final class ActivityThread {
     */
    Resources getTopLevelResources(String resDir, String[] overlayDirs,
            int displayId, Configuration overrideConfiguration,
            LoadedApk pkgInfo, Context context) {
        return mResourcesManager.getTopLevelResources(resDir, overlayDirs, displayId, pkgInfo.mPackageName,
            LoadedApk pkgInfo, Context context, String pkgName) {
        return mResourcesManager.getTopLevelResources(resDir, overlayDirs, displayId, pkgName,
                overrideConfiguration, pkgInfo.getCompatibilityInfo(), null, context);
    }

+2 −1
Original line number Diff line number Diff line
@@ -774,7 +774,8 @@ final class ApplicationPackageManager extends PackageManager {

        Resources r = mContext.mMainThread.getTopLevelResources(
                app.uid == Process.myUid() ? app.sourceDir : app.publicSourceDir,
                app.resourceDirs, Display.DEFAULT_DISPLAY, null, mContext.mPackageInfo, mContext);
                app.resourceDirs, Display.DEFAULT_DISPLAY, null, mContext.mPackageInfo, mContext,
                app.packageName);
        if (r != null) {
            return r;
        }
+40 −0
Original line number Diff line number Diff line
@@ -266,6 +266,13 @@ public class DownloadManager {
     */
    public final static int PAUSED_UNKNOWN = 4;

   /**
    * Value of {@link #COLUMN_REASON} when the download is paused by manual.
    *
    * @hide
    */
    public final static int PAUSED_BY_MANUAL = 5;

    /**
     * Broadcast intent action sent by the download manager when a download completes.
     */
@@ -865,6 +872,7 @@ public class DownloadManager {
                    parts.add(statusClause("=", Downloads.Impl.STATUS_WAITING_TO_RETRY));
                    parts.add(statusClause("=", Downloads.Impl.STATUS_WAITING_FOR_NETWORK));
                    parts.add(statusClause("=", Downloads.Impl.STATUS_QUEUED_FOR_WIFI));
                    parts.add(statusClause("=", Downloads.Impl.STATUS_PAUSED_BY_MANUAL));
                }
                if ((mStatusFlags & STATUS_SUCCESSFUL) != 0) {
                    parts.add(statusClause("=", Downloads.Impl.STATUS_SUCCESS));
@@ -1124,6 +1132,34 @@ public class DownloadManager {
        mResolver.update(mBaseUri, values, getWhereClauseForIds(ids), getWhereArgsForIds(ids));
    }

    /**
     * Pause the given running download by manual.
     *
     * @param id the ID of the download to be paused
     * @return the number of downloads actually updated
     * @hide
     */
    public int pauseDownload(long id) {
        ContentValues values = new ContentValues();
        values.put(Downloads.Impl.COLUMN_STATUS, Downloads.Impl.STATUS_PAUSED_BY_MANUAL);

        return mResolver.update(ContentUris.withAppendedId(mBaseUri, id), values, null, null);
    }

    /**
     * Resume the given paused download by manual.
     *
     * @param id the ID of the download to be resumed
     * @return the number of downloads actually updated
     * @hide
     */
    public int resumeDownload(long id) {
       ContentValues values = new ContentValues();
       values.put(Downloads.Impl.COLUMN_STATUS, Downloads.Impl.STATUS_RUNNING);

       return mResolver.update(ContentUris.withAppendedId(mBaseUri, id), values, null, null);
    }

    /**
     * Returns maximum size, in bytes, of downloads that may go over a mobile connection; or null if
     * there's no limit
@@ -1360,6 +1396,9 @@ public class DownloadManager {
                case Downloads.Impl.STATUS_QUEUED_FOR_WIFI:
                    return PAUSED_QUEUED_FOR_WIFI;

                case Downloads.Impl.STATUS_PAUSED_BY_MANUAL:
                    return PAUSED_BY_MANUAL;

                default:
                    return PAUSED_UNKNOWN;
            }
@@ -1415,6 +1454,7 @@ public class DownloadManager {
                case Downloads.Impl.STATUS_WAITING_TO_RETRY:
                case Downloads.Impl.STATUS_WAITING_FOR_NETWORK:
                case Downloads.Impl.STATUS_QUEUED_FOR_WIFI:
                case Downloads.Impl.STATUS_PAUSED_BY_MANUAL:
                    return STATUS_PAUSED;

                case Downloads.Impl.STATUS_SUCCESS:
+1 −1
Original line number Diff line number Diff line
@@ -493,7 +493,7 @@ public final class LoadedApk {
    public Resources getResources(ActivityThread mainThread) {
        if (mResources == null) {
            mResources = mainThread.getTopLevelResources(mResDir, mOverlayDirs,
                    Display.DEFAULT_DISPLAY, null, this, mainThread.getSystemContext());
                    Display.DEFAULT_DISPLAY, null, this, mainThread.getSystemContext(), mPackageName);
        }
        return mResources;
    }
+2 −9
Original line number Diff line number Diff line
@@ -193,6 +193,7 @@ public class ResourcesManager {
        //}

        AssetManager assets = new AssetManager();
        assets.setAppName(packageName);
        assets.setThemeSupport(compatInfo.isThemeable);
        if (assets.addAssetPath(resDir) == 0) {
            return null;
@@ -268,18 +269,10 @@ public class ResourcesManager {
     */
    private void setActivityIcons(Resources r) {
        SparseArray<PackageItemInfo> iconResources = new SparseArray<PackageItemInfo>();
        String pkgName = null;
        String pkgName = r.getAssets().getAppName();
        PackageInfo pkgInfo = null;
        ApplicationInfo appInfo = null;

        int count = r.getAssets().getBasePackageCount();
        if (count > 1) {
            pkgName = r.getAssets().getBasePackageName(1);
        } else if (count <= 1) {
            return;
        }


        try {
            pkgInfo = getPackageManager().getPackageInfo(pkgName, PackageManager.GET_ACTIVITIES, UserHandle.myUserId());
        } catch (RemoteException e1) {
Loading