show the Media Management prompt on Android 12+ from time to time

This commit is contained in:
tibbi 2022-04-24 16:55:40 +02:00
parent 0483e30eda
commit 0679b22887

View file

@ -64,6 +64,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
private var mShouldStopFetching = false
private var mIsSearchOpen = false
private var mWasDefaultFolderChecked = false
private var mWasMediaManagementPromptShown = false
private var mLatestMediaId = 0L
private var mLatestMediaDateId = 0L
private var mCurrentPathPrefix = "" // used at "Group direct subfolders" for navigation
@ -158,6 +159,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
callback(granted)
if (granted && isRPlus()) {
handlePermission(PERMISSION_MEDIA_LOCATION) {}
if (!mWasMediaManagementPromptShown && (config.appRunCount == 1 || config.appRunCount % 5 == 0)) {
mWasMediaManagementPromptShown = true
handleMediaManagementPrompt { }
}
}
}
}