Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 26cf055a authored by Fynn Godau's avatar Fynn Godau Committed by Marvin W.
Browse files

Check for `POST_NOTIFICATIONS` permission

parent 3d48fcc3
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
package com.android.vending.licensing;

import android.Manifest;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
@@ -8,10 +9,11 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Build;
import android.util.Log;

import androidx.annotation.CallSuper;
import androidx.core.app.ActivityCompat;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;

@@ -92,8 +94,10 @@ public class LicenseServiceNotificationRunnable implements Runnable {
            .build();

        NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
        if (ActivityCompat.checkSelfPermission(context, Manifest.permission.POST_NOTIFICATIONS) ==
            PackageManager.PERMISSION_GRANTED) {
            notificationManager.notify(callerUid, notification);

        }
    }

    private void registerNotificationChannel() {