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

Unverified Commit b957c694 authored by Kevin F. Haggerty's avatar Kevin F. Haggerty
Browse files

Merge tag 'android-security-11.0.0_r72' of...

Merge tag 'android-security-11.0.0_r72' of https://android.googlesource.com/platform/frameworks/base into staging/lineage-18.1_merge_android-security-11.0.0_r72

Android Security 11.0.0 Release 72 (10763435)

* tag 'android-security-11.0.0_r72' of https://android.googlesource.com/platform/frameworks/base:
  Revert "DO NOT MERGE Dismiss keyguard when simpin auth'd and..."
  [RESTRICT AUTOMERGE] Ignore small source rect hint
  RESTRICT AUTOMERGE: SettingsProvider: exclude secure_frp_mode from resets
  Add userId check before loading icon in Device Controls
  Fixing DatabaseUtils to detect malformed UTF-16 strings
  Disallow loading icon from content URI to PipMenu
  Fix KCM key mapping cloning
  [DO NOT MERGE] Verify URI Permissions in Autofill RemoteViews
  Do not share key mappings with JNI object
  Verify URI permissions for EXTRA_REMOTE_INPUT_HISTORY_ITEMS.
  Import translations. DO NOT MERGE ANYWHERE
  Add placeholder when media control title is blank
  RingtoneManager: verify default ringtone is audio

Conflicts:
	packages/SystemUI/src/com/android/systemui/controls/management/ControlAdapter.kt
	packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt
	packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java

Change-Id: Icf9a002c965930f95e3be5c7a23954143ab35c96
parents ef438ae1 9213632d
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -2533,6 +2533,17 @@ public class Notification implements Parcelable
            if (person != null && person.getIconUri() != null) {
            if (person != null && person.getIconUri() != null) {
                visitor.accept(person.getIconUri());
                visitor.accept(person.getIconUri());
            }
            }

            final RemoteInputHistoryItem[] history = getParcelableArrayFromBundle(extras,
                Notification.EXTRA_REMOTE_INPUT_HISTORY_ITEMS, RemoteInputHistoryItem.class);
            if (history != null) {
                for (int i = 0; i < history.length; i++) {
                    RemoteInputHistoryItem item = history[i];
                    if (item.getUri() != null) {
                        visitor.accept(item.getUri());
                    }
                }
            }
        }
        }


        if (MessagingStyle.class.equals(getNotificationStyle()) && extras != null) {
        if (MessagingStyle.class.equals(getNotificationStyle()) && extras != null) {
+23 −9
Original line number Original line Diff line number Diff line
@@ -511,17 +511,31 @@ public class DatabaseUtils {
     */
     */
    public static void appendEscapedSQLString(StringBuilder sb, String sqlString) {
    public static void appendEscapedSQLString(StringBuilder sb, String sqlString) {
        sb.append('\'');
        sb.append('\'');
        if (sqlString.indexOf('\'') != -1) {
        int length = sqlString.length();
        int length = sqlString.length();
        for (int i = 0; i < length; i++) {
        for (int i = 0; i < length; i++) {
            char c = sqlString.charAt(i);
            char c = sqlString.charAt(i);
            if (Character.isHighSurrogate(c)) {
                if (i == length - 1) {
                    continue;
                }
                if (Character.isLowSurrogate(sqlString.charAt(i + 1))) {
                    // add them both
                    sb.append(c);
                    sb.append(sqlString.charAt(i + 1));
                    continue;
                } else {
                    // this is a lone surrogate, skip it
                    continue;
                }
            }
            if (Character.isLowSurrogate(c)) {
                continue;
            }
            if (c == '\'') {
            if (c == '\'') {
                sb.append('\'');
                sb.append('\'');
            }
            }
            sb.append(c);
            sb.append(c);
        }
        }
        } else
            sb.append(sqlString);
        sb.append('\'');
        sb.append('\'');
    }
    }


+11 −2
Original line number Original line Diff line number Diff line
@@ -14,6 +14,7 @@
 * limitations under the License.
 * limitations under the License.
 */
 */


#include <binder/Parcel.h>
#include <input/Input.h>
#include <input/Input.h>


#include <android_runtime/AndroidRuntime.h>
#include <android_runtime/AndroidRuntime.h>
@@ -48,9 +49,17 @@ jobject android_view_InputDevice_create(JNIEnv* env, const InputDeviceInfo& devi
        return NULL;
        return NULL;
    }
    }


    sp<KeyCharacterMap> map = deviceInfo.getKeyCharacterMap();
    if (map != nullptr) {
        Parcel parcel;
        map->writeToParcel(&parcel);
        parcel.setDataPosition(0);
        map = map->readFromParcel(&parcel);
    }

    ScopedLocalRef<jobject> kcmObj(env,
    ScopedLocalRef<jobject> kcmObj(env,
                                   android_view_KeyCharacterMap_create(env, deviceInfo.getId(),
                                   android_view_KeyCharacterMap_create(env, deviceInfo.getId(),
            deviceInfo.getKeyCharacterMap()));
                                                                       map));
    if (!kcmObj.get()) {
    if (!kcmObj.get()) {
        return NULL;
        return NULL;
    }
    }
+17 −2
Original line number Original line Diff line number Diff line
@@ -825,6 +825,21 @@ public class RingtoneManager {
        if(!isInternalRingtoneUri(ringtoneUri)) {
        if(!isInternalRingtoneUri(ringtoneUri)) {
            ringtoneUri = ContentProvider.maybeAddUserId(ringtoneUri, context.getUserId());
            ringtoneUri = ContentProvider.maybeAddUserId(ringtoneUri, context.getUserId());
        }
        }

        if (ringtoneUri != null) {
            final String mimeType = resolver.getType(ringtoneUri);
            if (mimeType == null) {
                Log.e(TAG, "setActualDefaultRingtoneUri for URI:" + ringtoneUri
                        + " ignored: failure to find mimeType (no access from this context?)");
                return;
            }
            if (!(mimeType.startsWith("audio/") || mimeType.equals("application/ogg"))) {
                Log.e(TAG, "setActualDefaultRingtoneUri for URI:" + ringtoneUri
                        + " ignored: associated mimeType:" + mimeType + " is not an audio type");
                return;
            }
        }

        Settings.System.putStringForUser(resolver, setting,
        Settings.System.putStringForUser(resolver, setting,
                ringtoneUri != null ? ringtoneUri.toString() : null, context.getUserId());
                ringtoneUri != null ? ringtoneUri.toString() : null, context.getUserId());


+13 −4
Original line number Original line Diff line number Diff line
@@ -2955,6 +2955,15 @@ public class SettingsProvider extends ContentProvider {
            return settingsState.getSettingLocked(name);
            return settingsState.getSettingLocked(name);
        }
        }


        private boolean shouldExcludeSettingFromReset(Setting setting, String prefix) {
            // If a prefix was specified, exclude settings whose names don't start with it.
            if (prefix != null && !setting.getName().startsWith(prefix)) {
                return true;
            }
            // Never reset SECURE_FRP_MODE, as it could be abused to bypass FRP via RescueParty.
            return Secure.SECURE_FRP_MODE.equals(setting.getName());
        }

        public void resetSettingsLocked(int type, int userId, String packageName, int mode,
        public void resetSettingsLocked(int type, int userId, String packageName, int mode,
                String tag) {
                String tag) {
            resetSettingsLocked(type, userId, packageName, mode, tag, /*prefix=*/
            resetSettingsLocked(type, userId, packageName, mode, tag, /*prefix=*/
@@ -2977,7 +2986,7 @@ public class SettingsProvider extends ContentProvider {
                        Setting setting = settingsState.getSettingLocked(name);
                        Setting setting = settingsState.getSettingLocked(name);
                        if (packageName.equals(setting.getPackageName())) {
                        if (packageName.equals(setting.getPackageName())) {
                            if ((tag != null && !tag.equals(setting.getTag()))
                            if ((tag != null && !tag.equals(setting.getTag()))
                                    || (prefix != null && !setting.getName().startsWith(prefix))) {
                                    || shouldExcludeSettingFromReset(setting, prefix)) {
                                continue;
                                continue;
                            }
                            }
                            if (settingsState.resetSettingLocked(name)) {
                            if (settingsState.resetSettingLocked(name)) {
@@ -2997,7 +3006,7 @@ public class SettingsProvider extends ContentProvider {
                        Setting setting = settingsState.getSettingLocked(name);
                        Setting setting = settingsState.getSettingLocked(name);
                        if (!SettingsState.isSystemPackage(getContext(),
                        if (!SettingsState.isSystemPackage(getContext(),
                                setting.getPackageName(), INVALID_UID, userId)) {
                                setting.getPackageName(), INVALID_UID, userId)) {
                            if (prefix != null && !setting.getName().startsWith(prefix)) {
                            if (shouldExcludeSettingFromReset(setting, prefix)) {
                                continue;
                                continue;
                            }
                            }
                            if (settingsState.resetSettingLocked(name)) {
                            if (settingsState.resetSettingLocked(name)) {
@@ -3017,7 +3026,7 @@ public class SettingsProvider extends ContentProvider {
                        Setting setting = settingsState.getSettingLocked(name);
                        Setting setting = settingsState.getSettingLocked(name);
                        if (!SettingsState.isSystemPackage(getContext(),
                        if (!SettingsState.isSystemPackage(getContext(),
                                setting.getPackageName(), INVALID_UID, userId)) {
                                setting.getPackageName(), INVALID_UID, userId)) {
                            if (prefix != null && !setting.getName().startsWith(prefix)) {
                            if (shouldExcludeSettingFromReset(setting, prefix)) {
                                continue;
                                continue;
                            }
                            }
                            if (setting.isDefaultFromSystem()) {
                            if (setting.isDefaultFromSystem()) {
@@ -3040,7 +3049,7 @@ public class SettingsProvider extends ContentProvider {
                    for (String name : settingsState.getSettingNamesLocked()) {
                    for (String name : settingsState.getSettingNamesLocked()) {
                        Setting setting = settingsState.getSettingLocked(name);
                        Setting setting = settingsState.getSettingLocked(name);
                        boolean someSettingChanged = false;
                        boolean someSettingChanged = false;
                        if (prefix != null && !setting.getName().startsWith(prefix)) {
                        if (shouldExcludeSettingFromReset(setting, prefix)) {
                            continue;
                            continue;
                        }
                        }
                        if (setting.isDefaultFromSystem()) {
                        if (setting.isDefaultFromSystem()) {
Loading