Skip to content

Commit

Permalink
Remove USE_EXACT_ALARM permission (#1533)
Browse files Browse the repository at this point in the history
  • Loading branch information
micahmo authored Aug 15, 2024
1 parent 3b57b2c commit f02fbfa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
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

0 comments on commit f02fbfa

Please sign in to comment.