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

Remove USE_EXACT_ALARM #1533

Merged
merged 1 commit into from
Aug 15, 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
2 changes: 0 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.VIBRATE" />

<uses-permission android:minSdkVersion="34" android:name="android.permission.USE_EXACT_ALARM" />

<!-- The tools:replace line is needed by background_fetch -->
<!-- requestLegacyExternalStorage is required for saving media to an album in API 29 -->
<application
Expand Down
2 changes: 1 addition & 1 deletion lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -2277,7 +2277,7 @@
"@teal": {
"description": "The color teal"
},
"testBackgroundNotificationDescription": "Thunder will close itself and then attempt to generate a notification in the background. (It may take a few minutes.)",
"testBackgroundNotificationDescription": "Thunder will close itself and then attempt to generate a notification in the background. (It will take at least 15 minutes.)",
"@testBackgroundNotificationDescription": {
"description": "A message describing the background test notification"
},
Expand Down
6 changes: 2 additions & 4 deletions lib/notification/utils/local_notifications.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Future<void> pollRepliesAndShowNotifications() async {
Map<Account, List<CommentReplyView>> notifications = {};

for (final Account account in accounts) {
LemmyClient client = LemmyClient()..changeBaseUrl(account.instance!);
LemmyClient client = LemmyClient()..changeBaseUrl(account.instance);

// Iterate through inbox replies
GetRepliesResponse getRepliesResponse = await client.lemmyApiV3.run(
Expand Down Expand Up @@ -209,11 +209,10 @@ Future<void> initBackgroundFetch() async {
}

/// Initializes BackgroundFetch to send a test notification
/// It uses an interval of 1 and the alarm manager so the user doesn't have to wait too long.
Future<void> initTestBackgroundFetch() async {
await BackgroundFetch.configure(
BackgroundFetchConfig(
minimumFetchInterval: 1,
minimumFetchInterval: 15,
stopOnTerminate: false,
startOnBoot: true,
enableHeadless: true,
Expand All @@ -222,7 +221,6 @@ Future<void> initTestBackgroundFetch() async {
requiresStorageNotLow: false,
requiresCharging: false,
requiresDeviceIdle: false,
forceAlarmManager: true,
),
(String taskId) async {
BackgroundFetch.finish(taskId);
Expand Down
Loading