Skip to content

Commit

Permalink
Fixes #469
Browse files Browse the repository at this point in the history
Signed-off-by: enricocid <enrico2588@gmail.com>
  • Loading branch information
enricocid committed Sep 11, 2022
1 parent 8c96a6a commit d323e83
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Expand Up @@ -848,6 +848,7 @@ class MediaPlayerHolder:

fun cancelSleepTimer() {
mSleepTimer?.cancel()
mSleepTimer = null
}

fun pauseBySleepTimer(minutes: Long) : Boolean {
Expand All @@ -868,6 +869,7 @@ class MediaPlayerHolder:
}.start()
true
} else {
mSleepTimer = null
false
}
}
Expand Down
Expand Up @@ -261,6 +261,15 @@ class MainActivity : AppCompatActivity(), UIControlInterface, MediaControlInterf
}
}

override fun onStart() {
super.onStart()
if (Permissions.hasToAskForReadStoragePermission(this)) {
Permissions.manageAskForReadStoragePermission(this)
} else {
doBindService()
}
}

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

Expand All @@ -285,12 +294,6 @@ class MainActivity : AppCompatActivity(), UIControlInterface, MediaControlInterf
if (intent.hasExtra(GoConstants.RESTORE_FRAGMENT) && mTabToRestore == -1) {
mTabToRestore = intent.getIntExtra(GoConstants.RESTORE_FRAGMENT, -1)
}

if (Permissions.hasToAskForReadStoragePermission(this)) {
Permissions.manageAskForReadStoragePermission(this)
} else {
doBindService()
}
}

private fun notifyError(errorType: String) {
Expand Down Expand Up @@ -971,9 +974,6 @@ class MainActivity : AppCompatActivity(), UIControlInterface, MediaControlInterf
getString(R.string.sleeptimer_enabled, value),
Toast.LENGTH_SHORT
).show()
} else {
Toast.makeText(this@MainActivity, getString(R.string.error_bad_id), Toast.LENGTH_SHORT)
.show()
}
}
onSleepTimerDialogCancelled = {
Expand Down

0 comments on commit d323e83

Please sign in to comment.