diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/controllers/StorageDirsControllerImpl.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/controllers/StorageDirsControllerImpl.kt index 1c61d029..4a3bdd65 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/controllers/StorageDirsControllerImpl.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/controllers/StorageDirsControllerImpl.kt @@ -21,10 +21,7 @@ class StorageDirsControllerImpl @Inject constructor() : StorageDirsController { @Named(ACTIVITY) lateinit var activity: BaseActivity - /** - * Return all storage directories. - * Inspired by AOSP (API 18) and the Amaze File Manager sourcecode - */ + // return all storage directories (inspired by AOSP API 18 and the Amaze File Manager sourcecode) override fun getStorageDirectories(): Collection { return mutableSetOf().apply { if (VERSION.SDK_INT < VERSION_CODES.M) { @@ -37,7 +34,9 @@ class StorageDirsControllerImpl @Inject constructor() : StorageDirsController { } @Suppress("DEPRECATION") - // TODO replace getExternalStorageDirectory calls when target API > 29 + // TODO getExternalStorageDirectory and requestLegacyExternalStorage only work with targetSdk <= 29 + // If we want to raise the targetSdk we would have to switch to Androids Scoped storage API, which doesn not + // offer access to all folders private fun getExtSdCardPathsDeprecated(): Collection { val dirs = mutableListOf() val rawExternalStorage = System.getenv("EXTERNAL_STORAGE") diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/DayNightControllerImpl.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/DayNightControllerImpl.kt index 36512ef9..18fa1f48 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/DayNightControllerImpl.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/DayNightControllerImpl.kt @@ -6,7 +6,6 @@ import android.os.Build.VERSION import android.os.Build.VERSION_CODES import androidx.appcompat.app.AppCompatDelegate import androidx.core.content.edit -import com.g00fy2.developerwidget.R import com.g00fy2.developerwidget.di.annotations.APPLICATION import com.g00fy2.developerwidget.receiver.widget.WidgetProviderImpl import javax.inject.Inject @@ -18,9 +17,6 @@ class DayNightControllerImpl @Inject constructor() : DayNightController { @Named(APPLICATION) lateinit var context: Context - @Inject - lateinit var toastController: ToastController - private val defaultMode = if (VERSION.SDK_INT >= VERSION_CODES.P) AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM else AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY private val sharedPreference by lazy { @@ -39,8 +35,6 @@ class DayNightControllerImpl @Inject constructor() : DayNightController { AppCompatDelegate.MODE_NIGHT_NO -> AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM else -> AppCompatDelegate.MODE_NIGHT_YES }.let { - // TODO remove if https://issuetracker.google.com/issues/131851825 is fixed - if (VERSION.SDK_INT <= VERSION_CODES.M) toastController.showToast(R.string.day_night_issue) saveCustomDefaultMode(it) applyMode(it) updateWidgetTheme() diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/di/ControllerModule.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/di/ControllerModule.kt index 8a693d2b..52ef2960 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/di/ControllerModule.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/di/ControllerModule.kt @@ -18,7 +18,6 @@ import com.g00fy2.developerwidget.di.annotations.ActivityScope import dagger.Binds import dagger.Module import dagger.Reusable -import javax.inject.Singleton @Module abstract class GlobalControllerModule { @@ -26,10 +25,6 @@ abstract class GlobalControllerModule { @Binds @Reusable abstract fun providesDayNightController(dayNightControllerImpl: DayNightControllerImpl): DayNightController - - @Binds - @Singleton - abstract fun provideToastController(toastControllerImpl: ToastControllerImpl): ToastController } @Module @@ -54,4 +49,8 @@ abstract class ActivityControllerModule { @Binds @ActivityScope abstract fun providePreferenceController(preferenceControllerImpl: PreferenceControllerImpl): PreferenceController + + @Binds + @ActivityScope + abstract fun provideToastController(toastControllerImpl: ToastControllerImpl): ToastController } \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8e61a990..acc5fc9e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -63,7 +63,6 @@ Show all %s apps Show all You have to manually add a new widget using your launcher. - You may need to restart the app to fully take effect. Share device data Potentially harmful app This app contains code that attempts to bypass Android\'s security protections.