From 2f51c8326f2ec023675d3b40e7b757c2165deead Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 3 Sep 2024 10:35:34 -0500 Subject: [PATCH] Hide sticker dir setting on lower android (cherry picked from commit f9562238fc2905211cbd1384caa37b520c69a2ac) --- .../settings/AttachmentsSettingsFragment.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/fragment/settings/AttachmentsSettingsFragment.java b/src/main/java/eu/siacs/conversations/ui/fragment/settings/AttachmentsSettingsFragment.java index 4d42edcdd3..da2ea674f4 100644 --- a/src/main/java/eu/siacs/conversations/ui/fragment/settings/AttachmentsSettingsFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/fragment/settings/AttachmentsSettingsFragment.java @@ -44,12 +44,16 @@ public class AttachmentsSettingsFragment extends XmppPreferenceFragment { final var p = PreferenceManager.getDefaultSharedPreferences(requireActivity()); final var stickerDir = findPreference("sticker_directory"); - stickerDir.setSummary(p.getString("sticker_directory", "Pictures/Stickers")); - stickerDir.setOnPreferenceClickListener((pref) -> { - final var intent = ((StorageManager) requireActivity().getSystemService(Context.STORAGE_SERVICE)).getPrimaryStorageVolume().createOpenDocumentTreeIntent(); - startActivityForResult(Intent.createChooser(intent, "Choose sticker location"), 0); - return true; - }); + if (Build.VERSION.SDK_INT >= 29) { + stickerDir.setSummary(p.getString("sticker_directory", "Pictures/Stickers")); + stickerDir.setOnPreferenceClickListener((pref) -> { + final var intent = ((StorageManager) requireActivity().getSystemService(Context.STORAGE_SERVICE)).getPrimaryStorageVolume().createOpenDocumentTreeIntent(); + startActivityForResult(Intent.createChooser(intent, "Choose sticker location"), 0); + return true; + }); + } else { + stickerDir.setVisible(false); + } final var downloadDefaultStickers = findPreference("download_default_stickers"); downloadDefaultStickers.setOnPreferenceClickListener((pref) -> {