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

Commit fcf20f4d authored by sync_forks@e's avatar sync_forks@e
Browse files

Merge branch 'lineage-15.1' into eelo-0.2

parents f8e9b5c2 83c4230c
Loading
Loading
Loading
Loading
+34 −19
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Objects;

/**
 * Content providers are one of the primary building blocks of Android applications, providing
@@ -208,7 +209,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
        @Override
        public Cursor query(String callingPkg, Uri uri, @Nullable String[] projection,
                @Nullable Bundle queryArgs, @Nullable ICancellationSignal cancellationSignal) {
            validateIncomingUri(uri);
            uri = validateIncomingUri(uri);
            uri = maybeGetUriWithoutUserId(uri);
            if (enforceReadPermission(callingPkg, uri, null) != AppOpsManager.MODE_ALLOWED) {
                // The caller has no access to the data, so return an empty cursor with
@@ -247,14 +248,14 @@ public abstract class ContentProvider implements ComponentCallbacks2 {

        @Override
        public String getType(Uri uri) {
            validateIncomingUri(uri);
            uri = validateIncomingUri(uri);
            uri = maybeGetUriWithoutUserId(uri);
            return ContentProvider.this.getType(uri);
        }

        @Override
        public Uri insert(String callingPkg, Uri uri, ContentValues initialValues) {
            validateIncomingUri(uri);
            uri = validateIncomingUri(uri);
            int userId = getUserIdFromUri(uri);
            uri = maybeGetUriWithoutUserId(uri);
            if (enforceWritePermission(callingPkg, uri, null) != AppOpsManager.MODE_ALLOWED) {
@@ -270,7 +271,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 {

        @Override
        public int bulkInsert(String callingPkg, Uri uri, ContentValues[] initialValues) {
            validateIncomingUri(uri);
            uri = validateIncomingUri(uri);
            uri = maybeGetUriWithoutUserId(uri);
            if (enforceWritePermission(callingPkg, uri, null) != AppOpsManager.MODE_ALLOWED) {
                return 0;
@@ -292,11 +293,12 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
            for (int i = 0; i < numOperations; i++) {
                ContentProviderOperation operation = operations.get(i);
                Uri uri = operation.getUri();
                validateIncomingUri(uri);
                userIds[i] = getUserIdFromUri(uri);
                if (userIds[i] != UserHandle.USER_CURRENT) {
                    // Removing the user id from the uri.
                    operation = new ContentProviderOperation(operation, true);
                uri = validateIncomingUri(uri);
                uri = maybeGetUriWithoutUserId(uri);
                // Rebuild operation if we changed the Uri above
                if (!Objects.equals(operation.getUri(), uri)) {
                    operation = new ContentProviderOperation(operation, uri);
                    operations.set(i, operation);
                }
                if (operation.isReadOperation()) {
@@ -331,7 +333,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 {

        @Override
        public int delete(String callingPkg, Uri uri, String selection, String[] selectionArgs) {
            validateIncomingUri(uri);
            uri = validateIncomingUri(uri);
            uri = maybeGetUriWithoutUserId(uri);
            if (enforceWritePermission(callingPkg, uri, null) != AppOpsManager.MODE_ALLOWED) {
                return 0;
@@ -347,7 +349,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
        @Override
        public int update(String callingPkg, Uri uri, ContentValues values, String selection,
                String[] selectionArgs) {
            validateIncomingUri(uri);
            uri = validateIncomingUri(uri);
            uri = maybeGetUriWithoutUserId(uri);
            if (enforceWritePermission(callingPkg, uri, null) != AppOpsManager.MODE_ALLOWED) {
                return 0;
@@ -364,7 +366,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
        public ParcelFileDescriptor openFile(
                String callingPkg, Uri uri, String mode, ICancellationSignal cancellationSignal,
                IBinder callerToken) throws FileNotFoundException {
            validateIncomingUri(uri);
            uri = validateIncomingUri(uri);
            uri = maybeGetUriWithoutUserId(uri);
            enforceFilePermission(callingPkg, uri, mode, callerToken);
            final String original = setCallingPackage(callingPkg);
@@ -380,7 +382,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
        public AssetFileDescriptor openAssetFile(
                String callingPkg, Uri uri, String mode, ICancellationSignal cancellationSignal)
                throws FileNotFoundException {
            validateIncomingUri(uri);
            uri = validateIncomingUri(uri);
            uri = maybeGetUriWithoutUserId(uri);
            enforceFilePermission(callingPkg, uri, mode, null);
            final String original = setCallingPackage(callingPkg);
@@ -406,7 +408,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 {

        @Override
        public String[] getStreamTypes(Uri uri, String mimeTypeFilter) {
            validateIncomingUri(uri);
            uri = validateIncomingUri(uri);
            uri = maybeGetUriWithoutUserId(uri);
            return ContentProvider.this.getStreamTypes(uri, mimeTypeFilter);
        }
@@ -415,7 +417,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
        public AssetFileDescriptor openTypedAssetFile(String callingPkg, Uri uri, String mimeType,
                Bundle opts, ICancellationSignal cancellationSignal) throws FileNotFoundException {
            Bundle.setDefusable(opts, true);
            validateIncomingUri(uri);
            uri = validateIncomingUri(uri);
            uri = maybeGetUriWithoutUserId(uri);
            enforceFilePermission(callingPkg, uri, "r", null);
            final String original = setCallingPackage(callingPkg);
@@ -434,7 +436,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 {

        @Override
        public Uri canonicalize(String callingPkg, Uri uri) {
            validateIncomingUri(uri);
            uri = validateIncomingUri(uri);
            int userId = getUserIdFromUri(uri);
            uri = getUriWithoutUserId(uri);
            if (enforceReadPermission(callingPkg, uri, null) != AppOpsManager.MODE_ALLOWED) {
@@ -450,7 +452,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 {

        @Override
        public Uri uncanonicalize(String callingPkg, Uri uri) {
            validateIncomingUri(uri);
            uri = validateIncomingUri(uri);
            int userId = getUserIdFromUri(uri);
            uri = getUriWithoutUserId(uri);
            if (enforceReadPermission(callingPkg, uri, null) != AppOpsManager.MODE_ALLOWED) {
@@ -467,7 +469,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
        @Override
        public boolean refresh(String callingPkg, Uri uri, Bundle args,
                ICancellationSignal cancellationSignal) throws RemoteException {
            validateIncomingUri(uri);
            uri = validateIncomingUri(uri);
            uri = getUriWithoutUserId(uri);
            if (enforceReadPermission(callingPkg, uri, null) != AppOpsManager.MODE_ALLOWED) {
                return false;
@@ -1901,7 +1903,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
         */
        if (mContext == null) {
            mContext = context;
            if (context != null) {
            if (context != null && mTransport != null) {
                mTransport.mAppOpsManager = (AppOpsManager) context.getSystemService(
                        Context.APP_OPS_SERVICE);
            }
@@ -2010,7 +2012,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
    }

    /** @hide */
    private void validateIncomingUri(Uri uri) throws SecurityException {
    public Uri validateIncomingUri(Uri uri) throws SecurityException {
        String auth = uri.getAuthority();
        if (!mSingleUser) {
            int userId = getUserIdFromAuthority(auth, UserHandle.USER_CURRENT);
@@ -2029,6 +2031,19 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
            }
            throw new SecurityException(message);
        }

        // Normalize the path by removing any empty path segments, which can be
        // a source of security issues.
        final String encodedPath = uri.getEncodedPath();
        if (encodedPath != null && encodedPath.indexOf("//") != -1) {
            final Uri normalized = uri.buildUpon()
                    .encodedPath(encodedPath.replaceAll("//+", "/")).build();
            Log.w(TAG, "Normalized " + uri + " to " + normalized
                    + " to avoid possible security issues");
            return normalized;
        } else {
            return uri;
        }
    }

    /** @hide */
+2 −14
Original line number Diff line number Diff line
@@ -94,13 +94,9 @@ public class ContentProviderOperation implements Parcelable {
    }

    /** @hide */
    public ContentProviderOperation(ContentProviderOperation cpo, boolean removeUserIdFromUri) {
    public ContentProviderOperation(ContentProviderOperation cpo, Uri withUri) {
        mType = cpo.mType;
        if (removeUserIdFromUri) {
            mUri = ContentProvider.getUriWithoutUserId(cpo.mUri);
        } else {
            mUri = cpo.mUri;
        }
        mUri = withUri;
        mValues = cpo.mValues;
        mSelection = cpo.mSelection;
        mSelectionArgs = cpo.mSelectionArgs;
@@ -110,14 +106,6 @@ public class ContentProviderOperation implements Parcelable {
        mYieldAllowed = cpo.mYieldAllowed;
    }

    /** @hide */
    public ContentProviderOperation getWithoutUserIdInUri() {
        if (ContentProvider.uriHasUserId(mUri)) {
            return new ContentProviderOperation(this, true);
        }
        return this;
    }

    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(mType);
        Uri.writeToParcel(dest, mUri);
+28 −20
Original line number Diff line number Diff line
@@ -729,7 +729,8 @@
    <string name="permdesc_writeCallLog" product="default">Permite que les aplicaciones modifiquen el rexistru de llamaes del teléfonu, incluyendo datos tocante a llamaes entrantes y salientes.
        Les aplicaciones malicioses podríen usar esto pa desaniciar o modificar el rexistru de de llamaes.</string>
    <!-- Title of the body sensors permission, listed so the user can decide whether to allow the application to access body sensor data. [CHAR LIMIT=80] -->
    <string name="permlab_bodySensors">acceder a sensores corporales</string>
    <string name="permlab_bodySensors">acceder a sensores corporales
    </string>
    <!-- Description of the body sensors permission, listed so the user can decide whether to allow the application to access data from body sensors. [CHAR LIMIT=NONE] -->
    <string name="permdesc_bodySensors" product="default">Permite que l\'aplicación acceda a datos de los sensores
    que supervisen la to condición física como los pulseos.</string>
@@ -1473,15 +1474,18 @@
    <!-- For the unlock screen, informational message shown in dialog when user has exceeded the
        maximum attempts and the device will now be wiped -->
    <string name="lockscreen_failed_attempts_now_wiping" product="tablet">       Tentesti de desbloquiar incorreutamente la tableta <xliff:g id="number">%d</xliff:g> vegaes.
       Agora va reafitase\'l preséu.</string>
       Agora va reafitase\'l preséu.
    </string>
    <!-- For the unlock screen, informational message shown in dialog when user has exceeded the
        maximum attempts and the device will now be wiped -->
    <string name="lockscreen_failed_attempts_now_wiping" product="tv">       Tentesti de desbloquiar incorreutamente la TV <xliff:g id="number">%d</xliff:g> vegaes.
       Agora va reafitase\'l preséu.</string>
       Agora va reafitase\'l preséu.
    </string>
    <!-- For the unlock screen, informational message shown in dialog when user has exceeded the
        maximum attempts and the device will now be wiped -->
    <string name="lockscreen_failed_attempts_now_wiping" product="default">       Tentesti de desbloquiar incorreutamente\'l teléfonu <xliff:g id="number">%d</xliff:g> vegaes.
       Agora va reafitase\'l preséu.</string>
       Agora va reafitase\'l preséu.
    </string>
    <!-- On the unlock screen, countdown message shown while user is waiting to try again after too many
         failed attempts -->
    <string name="lockscreen_too_many_failed_attempts_countdown">Volvi tentalo en <xliff:g id="number">%d</xliff:g> segundos.</string>
@@ -2970,13 +2974,16 @@
    <!-- Message shown when user is almost at the limit of password attempts where the device will be wiped. -->
    <!-- Message shown in dialog when user has exceeded the maximum attempts and the device will now be wiped -->
    <string name="kg_failed_attempts_now_wiping" product="tablet">       Tentesti de desbloquiar incorreutamente la tableta <xliff:g id="number">%d</xliff:g> vegaes.
       Agora va reafitase\'l preséu.</string>
       Agora va reafitase\'l preséu.
    </string>
    <!-- Message shown in dialog when user has exceeded the maximum attempts and the device will now be wiped -->
    <string name="kg_failed_attempts_now_wiping" product="tv">       Tentesti de desbloquiar incorreutamente la TV <xliff:g id="number">%d</xliff:g> vegaes.
       Agora va reafitase\'l preséu.</string>
       Agora va reafitase\'l preséu.
    </string>
    <!-- Message shown in dialog when user has exceeded the maximum attempts and the device will now be wiped -->
    <string name="kg_failed_attempts_now_wiping" product="default">       Tentesti de desbloquiar incorreutamente\'l teléfonu <xliff:g id="number">%d</xliff:g> vegaes.
       Agora va reafitase\'l preséu.</string>
       Agora va reafitase\'l preséu.
    </string>
    <!-- Message shown in dialog when user is almost at the limit where they will be
    locked out and may have to enter an alternate username/password to unlock the phone -->
    <!-- Message shown in dialog when user is almost at the limit where they will be
@@ -2990,7 +2997,8 @@
    <string name="kg_reordering_delete_drop_target_text">Desaniciar</string>
    <!-- Message shown in dialog when user is attempting to set the music volume above the
    recommended maximum level for headphones -->
    <string name="safe_media_volume_warning" product="default">«¿Xubir el volume penriba\'l nivel aconseyáu?\n\nSentir soníos con volume altu demientres periodos de tiempu llargos podría mancate los oyíos.»</string>
    <string name="safe_media_volume_warning" product="default">       «¿Xubir el volume penriba\'l nivel aconseyáu?\n\nSentir soníos con volume altu demientres periodos de tiempu llargos podría mancate los oyíos.»
    </string>
    <!-- Dialog title for dialog shown when the accessibility shortcut is activated, and we want
     to confirm that the user understands what's going to happen-->
    <!-- Message shown in dialog when user is in the process of enabling the accessibility
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@
    <string name="app_ops_access_notifications">прочети известията</string>
    <string name="app_ops_activate_vpn">активиране на VPN</string>
    <string name="app_ops_add_voicemail">добави гласова поща</string>
    <string name="app_ops_app_start_foreground">стартирайте на преден план приложение с мигновено стартиране</string>
    <string name="app_ops_app_start_foreground">стартирайте на преден план инстантно приложение</string>
    <string name="app_ops_assist_screenshot">снимай екрана</string>
    <string name="app_ops_assist_structure">Използвайте структура за подпомагане</string>
    <string name="app_ops_audio_accessibility_volume">достъпност до ниво на звука</string>
+33 −0
Original line number Diff line number Diff line
@@ -2252,6 +2252,7 @@ Bydd y ffôn nawr yn cael ei ailosod nôl i fel yr oedd yn gadael y ffatri. <
    <!-- Title of the media route chooser dialog. [CHAR LIMIT=40] -->
    <string name="media_route_chooser_title">Cysylltu i ddyfais</string>
    <!-- Title of the media route chooser dialog for selecting remote display routes. [CHAR LIMIT=40] -->
    <string name="media_route_chooser_title_for_remote_display">Bwrw\'r sgrin ar ddyfais arall</string>
    <!-- Placeholder text to show when no devices have been found. [CHAR LIMIT=50] -->
    <string name="media_route_chooser_searching">Yn chwilio am ddyfeisiau\u2026</string>
    <!-- Button to access extended settings.  [CHAR LIMIT=30] -->
@@ -2525,9 +2526,41 @@ Rho gynnig arall arni ymhen <xliff:g id="number">%3$d</xliff:g> eiliad. </str
    <!-- [CHAR_LIMIT=16] Data saver: Button to turn it on on first-time dialog -->
    <string name="data_saver_enable_button">Troi ymlaen</string>
    <!-- Zen mode condition - summary: time duration in minutes. [CHAR LIMIT=NONE] -->
    <plurals name="zen_mode_duration_minutes_summary">
        <item quantity="zero">Am %1$d munudau (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
        <item quantity="one">Am un funud (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
        <item quantity="two">Am %1$d funud (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
        <item quantity="few">Am %1$d munud (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
        <item quantity="many">Am %1$d munud (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
        <item quantity="other">Am %1$d munud (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
    </plurals>
    <!-- Zen mode condition - summary: time duration in minutes (short version). [CHAR LIMIT=NONE] -->
    <plurals name="zen_mode_duration_minutes_summary_short">
        <item quantity="zero">Am %1$d mun (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
        <item quantity="one">Am 1 mun (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
        <item quantity="two">Am %1$d fun (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
        <item quantity="few">Am %1$d mun (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
        <item quantity="many">Am %1$d mun (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
        <item quantity="other">Am %1$d mun (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
    </plurals>
    <!-- Zen mode condition - summary: time duration in hours. [CHAR LIMIT=NONE] -->
    <plurals name="zen_mode_duration_hours_summary">
        <item quantity="zero">Am %1$d oriau (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
        <item quantity="one">Am awr (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
        <item quantity="two">Am %1$d awr (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
        <item quantity="few">Am %1$d awr (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
        <item quantity="many">Am %1$d awr (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
        <item quantity="other">Am %1$d awr (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
    </plurals>
    <!-- Zen mode condition - summary: time duration in hours (short version). [CHAR LIMIT=NONE] -->
    <plurals name="zen_mode_duration_hours_summary_short">
        <item quantity="zero">Am %1$d awr (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
        <item quantity="one">Am awr (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
        <item quantity="two">Am %1$d awr (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
        <item quantity="few">Am %1$d awr (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
        <item quantity="many">Am %1$d awr (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
        <item quantity="other">Am %1$d awr (nes <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
    </plurals>
    <!-- Zen mode condition - line one: time duration in minutes. [CHAR LIMIT=NONE] -->
    <!-- Zen mode condition - line one: time duration in minutes (short version). [CHAR LIMIT=NONE] -->
    <!-- Zen mode condition - line one: time duration in hours. [CHAR LIMIT=NONE] -->
Loading