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

Commit 379aa438 authored by Jack Yu's avatar Jack Yu Committed by Android Git Automerger
Browse files

am 6b7a0784: Merge "Grant SMS permissions to Cell Broadcast receiver which...

am 6b7a0784: Merge "Grant SMS permissions to Cell Broadcast receiver which emergency/non-emergency broadcast messages from the network." into mnc-dev

* commit '6b7a0784':
  Grant SMS permissions to Cell Broadcast receiver which emergency/non-emergency broadcast messages from the network.
parents 370c27c7 6b7a0784
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.os.UserHandle;
import android.provider.CalendarContract;
import android.provider.ContactsContract;
import android.provider.MediaStore;
import android.provider.Telephony.Sms.Intents;
import android.util.ArraySet;
import android.util.Log;

@@ -340,6 +341,15 @@ final class DefaultPermissionGrantPolicy {
                }
            }

            // Cell Broadcast Receiver
            Intent cbrIntent = new Intent(Intents.SMS_CB_RECEIVED_ACTION);
            PackageParser.Package cbrPackage =
                    getDefaultSystemHandlerActivityPackageLPr(cbrIntent, userId);

            if (cbrPackage != null && doesPackageSupportRuntimePermissions(cbrPackage)) {
                grantRuntimePermissionsLPw(cbrPackage, SMS_PERMISSIONS, false, userId);
            }

            // Calendar
            Intent calendarIntent = new Intent(Intent.ACTION_MAIN);
            calendarIntent.addCategory(Intent.CATEGORY_APP_CALENDAR);