diff --git a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/app/UApp.kt b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/app/UApp.kt
index fb83096f..0f869aee 100644
--- a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/app/UApp.kt
+++ b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/app/UApp.kt
@@ -1,6 +1,7 @@
package org.moire.ultrasonic.app
import android.content.Context
+import android.os.StrictMode
import androidx.multidex.MultiDexApplication
import org.koin.android.ext.koin.androidContext
import org.koin.core.context.startKoin
@@ -25,6 +26,8 @@ class UApp : MultiDexApplication() {
init {
instance = this
+ if (BuildConfig.DEBUG)
+ StrictMode.enableDefaults()
}
override fun onCreate() {
diff --git a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/SettingsFragment.kt b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/SettingsFragment.kt
index d7043da0..784059dc 100644
--- a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/SettingsFragment.kt
+++ b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/SettingsFragment.kt
@@ -17,7 +17,6 @@ import androidx.preference.CheckBoxPreference
import androidx.preference.EditTextPreference
import androidx.preference.ListPreference
import androidx.preference.Preference
-import androidx.preference.PreferenceCategory
import androidx.preference.PreferenceFragmentCompat
import java.io.File
import kotlin.math.ceil
@@ -112,10 +111,6 @@ class SettingsFragment :
chatRefreshInterval = findPreference(Constants.PREFERENCES_KEY_CHAT_REFRESH_INTERVAL)
directoryCacheTime = findPreference(Constants.PREFERENCES_KEY_DIRECTORY_CACHE_TIME)
mediaButtonsEnabled = findPreference(Constants.PREFERENCES_KEY_MEDIA_BUTTONS)
- lockScreenEnabled = findPreference(Constants.PREFERENCES_KEY_SHOW_LOCK_SCREEN_CONTROLS)
- sendBluetoothAlbumArt = findPreference(Constants.PREFERENCES_KEY_SEND_BLUETOOTH_ALBUM_ART)
- sendBluetoothNotifications =
- findPreference(Constants.PREFERENCES_KEY_SEND_BLUETOOTH_NOTIFICATIONS)
sharingDefaultDescription =
findPreference(Constants.PREFERENCES_KEY_DEFAULT_SHARE_DESCRIPTION)
sharingDefaultGreeting = findPreference(Constants.PREFERENCES_KEY_DEFAULT_SHARE_GREETING)
@@ -128,21 +123,6 @@ class SettingsFragment :
sharingDefaultGreeting!!.text = shareGreeting
setupClearSearchPreference()
setupCacheLocationPreference()
-
- // After API26 foreground services must be used for music playback, and they must have a notification
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- val notificationsCategory =
- findPreference(Constants.PREFERENCES_KEY_CATEGORY_NOTIFICATIONS)
- var preferenceToRemove =
- findPreference(Constants.PREFERENCES_KEY_SHOW_NOTIFICATION)
- if (preferenceToRemove != null) notificationsCategory!!.removePreference(
- preferenceToRemove
- )
- preferenceToRemove = findPreference(Constants.PREFERENCES_KEY_ALWAYS_SHOW_NOTIFICATION)
- if (preferenceToRemove != null) notificationsCategory!!.removePreference(
- preferenceToRemove
- )
- }
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
@@ -208,9 +188,6 @@ class SettingsFragment :
Constants.PREFERENCES_KEY_HIDE_MEDIA -> {
setHideMedia(sharedPreferences.getBoolean(key, false))
}
- Constants.PREFERENCES_KEY_SEND_BLUETOOTH_NOTIFICATIONS -> {
- setBluetoothPreferences(sharedPreferences.getBoolean(key, true))
- }
Constants.PREFERENCES_KEY_DEBUG_LOG_TO_FILE -> {
setDebugLogToFile(sharedPreferences.getBoolean(key, false))
}
@@ -351,10 +328,6 @@ class SettingsFragment :
toast(activity, R.string.settings_hide_media_toast, false)
}
- private fun setBluetoothPreferences(enabled: Boolean) {
- sendBluetoothAlbumArt!!.isEnabled = enabled
- }
-
private fun setCacheLocation(path: String) {
if (path != "") {
val uri = Uri.parse(path)
diff --git a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/util/Constants.kt b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/util/Constants.kt
index 6fb9efeb..687282b3 100644
--- a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/util/Constants.kt
+++ b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/util/Constants.kt
@@ -74,9 +74,6 @@ object Constants {
const val PREFERENCES_KEY_WIFI_REQUIRED_FOR_DOWNLOAD = "wifiRequiredForDownload"
const val PREFERENCES_KEY_BUFFER_LENGTH = "bufferLength"
const val PREFERENCES_KEY_NETWORK_TIMEOUT = "networkTimeout"
- const val PREFERENCES_KEY_SHOW_NOTIFICATION = "showNotification"
- const val PREFERENCES_KEY_ALWAYS_SHOW_NOTIFICATION = "alwaysShowNotification"
- const val PREFERENCES_KEY_SHOW_LOCK_SCREEN_CONTROLS = "showLockScreen"
const val PREFERENCES_KEY_MAX_ALBUMS = "maxAlbums"
const val PREFERENCES_KEY_MAX_SONGS = "maxSongs"
const val PREFERENCES_KEY_MAX_ARTISTS = "maxArtists"
@@ -84,20 +81,16 @@ object Constants {
const val PREFERENCES_KEY_DEFAULT_SONGS = "defaultSongs"
const val PREFERENCES_KEY_DEFAULT_ARTISTS = "defaultArtists"
const val PREFERENCES_KEY_SHOW_NOW_PLAYING = "showNowPlaying"
- const val PREFERENCES_KEY_PLAYBACK_CONTROL_SETTINGS = "playbackControlSettings"
const val PREFERENCES_KEY_CLEAR_SEARCH_HISTORY = "clearSearchHistory"
const val PREFERENCES_KEY_DOWNLOAD_TRANSITION = "transitionToDownloadOnPlay"
const val PREFERENCES_KEY_INCREMENT_TIME = "incrementTime"
const val PREFERENCES_KEY_SHOW_NOW_PLAYING_DETAILS = "showNowPlayingDetails"
const val PREFERENCES_KEY_ID3_TAGS = "useId3Tags"
const val PREFERENCES_KEY_SHOW_ARTIST_PICTURE = "showArtistPicture"
- const val PREFERENCES_KEY_TEMP_LOSS = "tempLoss"
const val PREFERENCES_KEY_CHAT_REFRESH_INTERVAL = "chatRefreshInterval"
const val PREFERENCES_KEY_DIRECTORY_CACHE_TIME = "directoryCacheTime"
const val PREFERENCES_KEY_CLEAR_BOOKMARK = "clearBookmark"
const val PREFERENCES_KEY_DISC_SORT = "discAndTrackSort"
- const val PREFERENCES_KEY_SEND_BLUETOOTH_NOTIFICATIONS = "sendBluetoothNotifications"
- const val PREFERENCES_KEY_SEND_BLUETOOTH_ALBUM_ART = "sendBluetoothAlbumArt"
const val PREFERENCES_KEY_ASK_FOR_SHARE_DETAILS = "sharingAlwaysAskForDetails"
const val PREFERENCES_KEY_DEFAULT_SHARE_DESCRIPTION = "sharingDefaultDescription"
const val PREFERENCES_KEY_DEFAULT_SHARE_GREETING = "sharingDefaultGreeting"
diff --git a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/util/Settings.kt b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/util/Settings.kt
index 58458f9e..c62e1ce5 100644
--- a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/util/Settings.kt
+++ b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/util/Settings.kt
@@ -183,12 +183,6 @@ object Settings {
var shouldClearBookmark
by BooleanSetting(Constants.PREFERENCES_KEY_CLEAR_BOOKMARK, false)
- // Inverted for readability
- var shouldSendBluetoothNotifications by BooleanSetting(
- Constants.PREFERENCES_KEY_SEND_BLUETOOTH_NOTIFICATIONS,
- true
- )
-
var shouldAskForShareDetails
by BooleanSetting(Constants.PREFERENCES_KEY_ASK_FOR_SHARE_DETAILS, true)
diff --git a/ultrasonic/src/main/res/xml/settings.xml b/ultrasonic/src/main/res/xml/settings.xml
index c03bdc62..7eb7dc81 100644
--- a/ultrasonic/src/main/res/xml/settings.xml
+++ b/ultrasonic/src/main/res/xml/settings.xml
@@ -113,42 +113,6 @@
a:summary="@string/settings.show_now_playing_summary"
a:title="@string/settings.show_now_playing"
app:iconSpaceReserved="false"/>
-
-
-
-
-
-