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

Commit 74f4c0e6 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Merge cherrypicks of [9427496, 9427497, 9427498, 9427499, 9427540, 9427541,...

Merge cherrypicks of [9427496, 9427497, 9427498, 9427499, 9427540, 9427541, 9427522, 9427523, 9427525, 9427526, 9427527, 9427504, 9427542, 9427505, 9427468, 9427469, 9427506, 9427236, 9427238, 9427239, 9427454, 9427455, 9427561, 9427390, 9427470, 9427456, 9427472, 9427393, 9427531, 9427213, 9427459, 94275813, 9427583, 9427545, 9427362, 9427563, 9427564, 9427533, 9427534, 9427546, 9427395, 9427397, 9427475, 9427565, 9427535] into qt-release

Change-Id: Ic48d55b2e6c7cf93103cb75daf0a4fe05296ae72
parents 5960d27c 36a5c576
Loading
Loading
Loading
Loading
+22 −20
Original line number Diff line number Diff line
@@ -132,6 +132,9 @@ public class DownloadManager {
     */
    public final static String COLUMN_STATUS = Downloads.Impl.COLUMN_STATUS;

    /** {@hide} */
    public static final String COLUMN_FILE_NAME_HINT = Downloads.Impl.COLUMN_FILE_NAME_HINT;

    /**
     * Provides more detail on the status of the download.  Its meaning depends on the value of
     * {@link #COLUMN_STATUS}.
@@ -173,6 +176,9 @@ public class DownloadManager {
    @TestApi
    public static final String COLUMN_MEDIASTORE_URI = Downloads.Impl.COLUMN_MEDIASTORE_URI;

    /** {@hide} */
    public static final String COLUMN_DESTINATION = Downloads.Impl.COLUMN_DESTINATION;

    /**
     * @hide
     */
@@ -340,26 +346,22 @@ public class DownloadManager {
     */
    @UnsupportedAppUsage
    public static final String[] UNDERLYING_COLUMNS = new String[] {
        Downloads.Impl._ID,
        Downloads.Impl._DATA + " AS " + COLUMN_LOCAL_FILENAME,
        Downloads.Impl.COLUMN_MEDIAPROVIDER_URI,
        Downloads.Impl.COLUMN_DESTINATION,
        Downloads.Impl.COLUMN_TITLE,
        Downloads.Impl.COLUMN_DESCRIPTION,
        Downloads.Impl.COLUMN_URI,
        Downloads.Impl.COLUMN_STATUS,
        Downloads.Impl.COLUMN_FILE_NAME_HINT,
        Downloads.Impl.COLUMN_MIME_TYPE + " AS " + COLUMN_MEDIA_TYPE,
        Downloads.Impl.COLUMN_TOTAL_BYTES + " AS " + COLUMN_TOTAL_SIZE_BYTES,
        Downloads.Impl.COLUMN_LAST_MODIFICATION + " AS " + COLUMN_LAST_MODIFIED_TIMESTAMP,
        Downloads.Impl.COLUMN_CURRENT_BYTES + " AS " + COLUMN_BYTES_DOWNLOADED_SO_FAR,
        Downloads.Impl.COLUMN_ALLOW_WRITE,
        /* add the following 'computed' columns to the cursor.
         * they are not 'returned' by the database, but their inclusion
         * eliminates need to have lot of methods in CursorTranslator
         */
        "'placeholder' AS " + COLUMN_LOCAL_URI,
        "'placeholder' AS " + COLUMN_REASON
        DownloadManager.COLUMN_ID,
        DownloadManager.COLUMN_LOCAL_FILENAME,
        DownloadManager.COLUMN_MEDIAPROVIDER_URI,
        DownloadManager.COLUMN_DESTINATION,
        DownloadManager.COLUMN_TITLE,
        DownloadManager.COLUMN_DESCRIPTION,
        DownloadManager.COLUMN_URI,
        DownloadManager.COLUMN_STATUS,
        DownloadManager.COLUMN_FILE_NAME_HINT,
        DownloadManager.COLUMN_MEDIA_TYPE,
        DownloadManager.COLUMN_TOTAL_SIZE_BYTES,
        DownloadManager.COLUMN_LAST_MODIFIED_TIMESTAMP,
        DownloadManager.COLUMN_BYTES_DOWNLOADED_SO_FAR,
        DownloadManager.COLUMN_ALLOW_WRITE,
        DownloadManager.COLUMN_LOCAL_URI,
        DownloadManager.COLUMN_REASON
    };

    /**
+14 −6
Original line number Diff line number Diff line
@@ -355,7 +355,8 @@ public abstract class SliceProvider extends ContentProvider {
    @Override
    public Bundle call(String method, String arg, Bundle extras) {
        if (method.equals(METHOD_SLICE)) {
            Uri uri = getUriWithoutUserId(extras.getParcelable(EXTRA_BIND_URI));
            Uri uri = getUriWithoutUserId(validateIncomingUriOrNull(
                    extras.getParcelable(EXTRA_BIND_URI)));
            List<SliceSpec> supportedSpecs = extras.getParcelableArrayList(EXTRA_SUPPORTED_SPECS);

            String callingPackage = getCallingPackage();
@@ -369,7 +370,7 @@ public abstract class SliceProvider extends ContentProvider {
        } else if (method.equals(METHOD_MAP_INTENT)) {
            Intent intent = extras.getParcelable(EXTRA_INTENT);
            if (intent == null) return null;
            Uri uri = onMapIntentToUri(intent);
            Uri uri = validateIncomingUriOrNull(onMapIntentToUri(intent));
            List<SliceSpec> supportedSpecs = extras.getParcelableArrayList(EXTRA_SUPPORTED_SPECS);
            Bundle b = new Bundle();
            if (uri != null) {
@@ -383,24 +384,27 @@ public abstract class SliceProvider extends ContentProvider {
        } else if (method.equals(METHOD_MAP_ONLY_INTENT)) {
            Intent intent = extras.getParcelable(EXTRA_INTENT);
            if (intent == null) return null;
            Uri uri = onMapIntentToUri(intent);
            Uri uri = validateIncomingUriOrNull(onMapIntentToUri(intent));
            Bundle b = new Bundle();
            b.putParcelable(EXTRA_SLICE, uri);
            return b;
        } else if (method.equals(METHOD_PIN)) {
            Uri uri = getUriWithoutUserId(extras.getParcelable(EXTRA_BIND_URI));
            Uri uri = getUriWithoutUserId(validateIncomingUriOrNull(
                    extras.getParcelable(EXTRA_BIND_URI)));
            if (Binder.getCallingUid() != Process.SYSTEM_UID) {
                throw new SecurityException("Only the system can pin/unpin slices");
            }
            handlePinSlice(uri);
        } else if (method.equals(METHOD_UNPIN)) {
            Uri uri = getUriWithoutUserId(extras.getParcelable(EXTRA_BIND_URI));
            Uri uri = getUriWithoutUserId(validateIncomingUriOrNull(
                    extras.getParcelable(EXTRA_BIND_URI)));
            if (Binder.getCallingUid() != Process.SYSTEM_UID) {
                throw new SecurityException("Only the system can pin/unpin slices");
            }
            handleUnpinSlice(uri);
        } else if (method.equals(METHOD_GET_DESCENDANTS)) {
            Uri uri = getUriWithoutUserId(extras.getParcelable(EXTRA_BIND_URI));
            Uri uri = getUriWithoutUserId(
                    validateIncomingUriOrNull(extras.getParcelable(EXTRA_BIND_URI)));
            Bundle b = new Bundle();
            b.putParcelableArrayList(EXTRA_SLICE_DESCENDANTS,
                    new ArrayList<>(handleGetDescendants(uri)));
@@ -416,6 +420,10 @@ public abstract class SliceProvider extends ContentProvider {
        return super.call(method, arg, extras);
    }

    private Uri validateIncomingUriOrNull(Uri uri) {
        return uri == null ? null : validateIncomingUri(uri);
    }

    private Collection<Uri> handleGetDescendants(Uri uri) {
        mCallback = "onGetSliceDescendants";
        return onGetSliceDescendants(uri);
+327 −78

File changed.

Preview size limit exceeded, changes collapsed.

+297 −0

File added.

Preview size limit exceeded, changes collapsed.

+12 −0

File changed.

Preview size limit exceeded, changes collapsed.

Loading