Loading core/java/android/app/Notification.java +5 −2 Original line number Diff line number Diff line Loading @@ -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(); } } /** Loading core/java/android/hardware/usb/UsbConfiguration.java +2 −1 Original line number Diff line number Diff line Loading @@ -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; Loading packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +31 −0 Original line number Diff line number Diff line Loading @@ -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(); Loading Loading @@ -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) Loading packages/SystemUI/src/com/android/systemui/flags/Flags.kt +1 −1 Original line number Diff line number Diff line Loading @@ -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) Loading packages/SystemUI/src/com/android/systemui/shade/NotificationsQuickSettingsContainer.java +6 −0 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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 Loading @@ -101,6 +106,7 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout } public void setQSContainerPaddingBottom(int paddingBottom) { mLastQSPaddingBottom = paddingBottom; if (mQSContainer != null) { mQSContainer.setPadding( mQSContainer.getPaddingLeft(), Loading Loading
core/java/android/app/Notification.java +5 −2 Original line number Diff line number Diff line Loading @@ -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(); } } /** Loading
core/java/android/hardware/usb/UsbConfiguration.java +2 −1 Original line number Diff line number Diff line Loading @@ -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; Loading
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +31 −0 Original line number Diff line number Diff line Loading @@ -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(); Loading Loading @@ -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) Loading
packages/SystemUI/src/com/android/systemui/flags/Flags.kt +1 −1 Original line number Diff line number Diff line Loading @@ -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) Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationsQuickSettingsContainer.java +6 −0 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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 Loading @@ -101,6 +106,7 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout } public void setQSContainerPaddingBottom(int paddingBottom) { mLastQSPaddingBottom = paddingBottom; if (mQSContainer != null) { mQSContainer.setPadding( mQSContainer.getPaddingLeft(), Loading