Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump android-gradle-plugin from 8.6.1 to 8.7.1 #3112

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="com.android.vending.CHECK_LICENSE"/>
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

[versions]
aboutlibraries = "11.2.3"
android-gradle-plugin = "8.6.1"
android-gradle-plugin = "8.7.1"
billing = "7.0.0"
coil = "2.7.0"
compose = "2024.10.00" # https://developer.android.com/jetpack/compose/bom/bom-mapping
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />

<application android:usesCleartextTraffic="true">
<provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ import android.app.AlarmManager
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.os.Build
import android.provider.Settings.ACTION_REQUEST_SCHEDULE_EXACT_ALARM
import android.text.format.DateUtils
import android.widget.Toast
import au.com.shiftyjelly.pocketcasts.analytics.AnalyticsEvent.PLAYER_SLEEP_TIMER_RESTARTED
import au.com.shiftyjelly.pocketcasts.analytics.AnalyticsTracker
import au.com.shiftyjelly.pocketcasts.utils.log.LogBuffer
Expand All @@ -18,7 +15,6 @@ import javax.inject.Singleton
import kotlin.time.Duration
import kotlin.time.Duration.Companion.milliseconds
import kotlin.time.Duration.Companion.minutes
import au.com.shiftyjelly.pocketcasts.localization.R as LR

@Singleton
class SleepTimer @Inject constructor(
Expand Down Expand Up @@ -134,26 +130,15 @@ class SleepTimer @Inject constructor(
val sleepIntent = getSleepIntent()
val alarmManager = getAlarmManager()
alarmManager.cancel(sleepIntent)

return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && !alarmManager.canScheduleExactAlarms()) {
Toast.makeText(context, LR.string.player_sleep_timer_start_failed, Toast.LENGTH_LONG).show()
context.startActivity(
Intent(ACTION_REQUEST_SCHEDULE_EXACT_ALARM)
// Because we're not launching this from an activity context, we must add the FLAG_ACTIVITY_NEW_TASK flag
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK),
)
return try {
LogBuffer.i(TAG, "Starting...")
alarmManager.setAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, timeMs, sleepIntent)
sleepTimeMs = timeMs
lastTimeSleepTimeHasFinished = timeMs.milliseconds
true
} catch (e: Exception) {
LogBuffer.e(LogBuffer.TAG_CRASH, e, "Unable to start sleep timer.")
false
} else {
return try {
LogBuffer.i(TAG, "Starting...")
alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, timeMs, sleepIntent)
sleepTimeMs = timeMs
lastTimeSleepTimeHasFinished = timeMs.milliseconds
true
} catch (e: Exception) {
LogBuffer.e(LogBuffer.TAG_CRASH, e, "Unable to start sleep timer.")
false
}
}
}

Expand Down
1 change: 0 additions & 1 deletion wear/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.android.vending.BILLING" />
Expand Down