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

Commit b8d890eb authored by Steve Howard's avatar Steve Howard Committed by Android (Google) Code Review
Browse files

Merge "Initial implementation of the download manager public API." into gingerbread

parents 8e886be4 a2709360
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ import android.location.LocationManager;
import android.media.AudioManager;
import android.net.ConnectivityManager;
import android.net.IConnectivityManager;
import android.net.DownloadManager;
import android.net.ThrottleManager;
import android.net.IThrottleManager;
import android.net.Uri;
@@ -199,6 +200,7 @@ class ContextImpl extends Context {
    private DropBoxManager mDropBoxManager = null;
    private DevicePolicyManager mDevicePolicyManager = null;
    private UiModeManager mUiModeManager = null;
    private DownloadManager mDownloadManager = null;

    private final Object mSync = new Object();

@@ -973,6 +975,8 @@ class ContextImpl extends Context {
            return getDevicePolicyManager();
        } else if (UI_MODE_SERVICE.equals(name)) {
            return getUiModeManager();
        } else if (DOWNLOAD_SERVICE.equals(name)) {
            return getDownloadManager();
        }

        return null;
@@ -1191,6 +1195,15 @@ class ContextImpl extends Context {
        return mUiModeManager;
    }

    private DownloadManager getDownloadManager() {
        synchronized (mSync) {
            if (mDownloadManager == null) {
                mDownloadManager = new DownloadManager(getContentResolver());
            }
        }
        return mDownloadManager;
    }

    @Override
    public int checkPermission(String permission, int pid, int uid) {
        if (permission == null) {
+9 −0
Original line number Diff line number Diff line
@@ -1534,6 +1534,15 @@ public abstract class Context {
     */
    public static final String UI_MODE_SERVICE = "uimode";

    /**
     * Use with {@link #getSystemService} to retrieve a
     * {@link android.net.DownloadManager} for requesting HTTP downloads.
     *
     * @see #getSystemService
     * @hide (TODO) for now
     */
    public static final String DOWNLOAD_SERVICE = "download";

    /**
     * Determine whether the given permission is allowed for a particular
     * process and user ID running in the system.
+719 −0

File added.

Preview size limit exceeded, changes collapsed.