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

Commit 47b46648 authored by Steve Howard's avatar Steve Howard Committed by Android Git Automerger
Browse files

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

Merge commit 'b8d890eb' into gingerbread-plus-aosp

* commit 'b8d890eb':
  Initial implementation of the download manager public API.
parents 10dde211 b8d890eb
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -66,6 +66,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;
@@ -196,6 +197,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();

@@ -970,6 +972,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;
@@ -1188,6 +1192,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.