Skip to content

Commit

Permalink
Merge pull request #3306 from deltachat/adb/issue-3305
Browse files Browse the repository at this point in the history
log notifications permission status
  • Loading branch information
adbenitez authored Sep 19, 2024
2 parents 91467e5 + 1757c41 commit ca74afb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/org/thoughtcrime/securesms/LogViewFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.thoughtcrime.securesms;

import android.Manifest;
import android.annotation.TargetApi;
import android.app.ActivityManager;
import android.content.Context;
Expand All @@ -35,6 +36,7 @@
import android.widget.EditText;

import androidx.annotation.NonNull;
import androidx.core.content.PermissionChecker;
import androidx.fragment.app.Fragment;

import com.b44t.messenger.DcContext;
Expand Down Expand Up @@ -256,6 +258,8 @@ private static String buildDescription(LogViewFragment fragment) {
}

final String token = FcmReceiveService.getToken();
boolean notifPermGranted = PermissionChecker.checkSelfPermission(context, Manifest.permission.POST_NOTIFICATIONS) == PermissionChecker.PERMISSION_GRANTED;
builder.append("post-notifications-granted=").append(notifPermGranted).append("\n");
builder.append("push-enabled=").append(Prefs.isPushEnabled(context)).append("\n");
builder.append("push-token=").append(token == null ? "<empty>" : token).append("\n");
} catch (Exception e) {
Expand Down

0 comments on commit ca74afb

Please sign in to comment.