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

Commit cdec2a3a authored by /e/ robot's avatar /e/ robot
Browse files

Merge remote-tracking branch 'origin/lineage-20.0' into v1-t

parents 5f53bff1 b2a98be7
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -3404,8 +3404,11 @@ public class Notification implements Parcelable
     *
     * @hide
     */
    public void setAllowlistToken(@Nullable IBinder token) {
        mAllowlistToken = token;
    public void clearAllowlistToken() {
        mAllowlistToken = null;
        if (publicVersion != null) {
            publicVersion.clearAllowlistToken();
        }
    }
    /**
+2 −1
Original line number Diff line number Diff line
@@ -172,7 +172,8 @@ public class UsbConfiguration implements Parcelable {
            String name = in.readString();
            int attributes = in.readInt();
            int maxPower = in.readInt();
            Parcelable[] interfaces = in.readParcelableArray(UsbInterface.class.getClassLoader());
            Parcelable[] interfaces = in.readParcelableArray(
                    UsbInterface.class.getClassLoader(), UsbInterface.class);
            UsbConfiguration configuration = new UsbConfiguration(id, name, attributes, maxPower);
            configuration.setInterfaces(interfaces);
            return configuration;
+31 −0
Original line number Diff line number Diff line
@@ -1928,6 +1928,9 @@ public class SettingsProvider extends ContentProvider {
            cacheName = Settings.System.ALARM_ALERT_CACHE;
        }
        if (cacheName != null) {
            if (!isValidAudioUri(name, value)) {
                return false;
            }
            final File cacheFile = new File(
                    getRingtoneCacheDir(owningUserId), cacheName);
            cacheFile.delete();
@@ -1960,6 +1963,34 @@ public class SettingsProvider extends ContentProvider {
        }
    }

    private boolean isValidAudioUri(String name, String uri) {
        if (uri != null) {
            Uri audioUri = Uri.parse(uri);
            if (Settings.AUTHORITY.equals(
                    ContentProvider.getAuthorityWithoutUserId(audioUri.getAuthority()))) {
                // Don't accept setting the default uri to self-referential URIs like
                // Settings.System.DEFAULT_RINGTONE_URI, which is an alias to the value of this
                // setting.
                return false;
            }
            final String mimeType = getContext().getContentResolver().getType(audioUri);
            if (mimeType == null) {
                Slog.e(LOG_TAG,
                        "mutateSystemSetting for setting: " + name + " URI: " + audioUri
                        + " ignored: failure to find mimeType (no access from this context?)");
                return false;
            }
            if (!(mimeType.startsWith("audio/") || mimeType.equals("application/ogg")
                    || mimeType.equals("application/x-flac"))) {
                Slog.e(LOG_TAG,
                        "mutateSystemSetting for setting: " + name + " URI: " + audioUri
                        + " ignored: associated mimeType: " + mimeType + " is not an audio type");
                return false;
            }
        }
        return true;
    }

    private boolean hasWriteSecureSettingsPermission() {
        // Write secure settings is a more protected permission. If caller has it we are good.
        return getContext().checkCallingOrSelfPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
+1 −1
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ object Flags {
    // TODO(b/260335638): Tracking Bug
    @JvmField
    val NOTIFICATION_INLINE_REPLY_ANIMATION =
        releasedFlag(174148361, "notification_inline_reply_animation")
        unreleasedFlag(174148361, "notification_inline_reply_animation")

    val FILTER_UNSEEN_NOTIFS_ON_KEYGUARD =
        releasedFlag(254647461, "filter_unseen_notifs_on_keyguard", teamfood = true)
+6 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout
    private Consumer<QS> mQSFragmentAttachedListener = qs -> {};
    private QS mQs;
    private View mQSContainer;
    private int mLastQSPaddingBottom;

    @Nullable
    private Consumer<Configuration> mConfigurationChangedListener;
@@ -75,6 +76,10 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout
        mQs = (QS) fragment;
        mQSFragmentAttachedListener.accept(mQs);
        mQSContainer = mQs.getView().findViewById(R.id.quick_settings_container);
        // We need to restore the bottom padding as the fragment may have been recreated due to
        // some special Configuration change, so we apply the last known padding (this will be
        // correct even if it has changed while the fragment was destroyed and re-created).
        setQSContainerPaddingBottom(mLastQSPaddingBottom);
    }

    @Override
@@ -101,6 +106,7 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout
    }

    public void setQSContainerPaddingBottom(int paddingBottom) {
        mLastQSPaddingBottom = paddingBottom;
        if (mQSContainer != null) {
            mQSContainer.setPadding(
                    mQSContainer.getPaddingLeft(),
Loading