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

Commit b1331b51 authored by Automerger Merge Worker's avatar Automerger Merge Worker Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE: Disable StrictMode VM Policy check. am: f20d333a" into rvc-qpr-dev-plus-aosp

parents e5b4ebe3 3e810388
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.database.DatabaseUtils;
import android.net.Uri;
import android.os.Build;
import android.os.RemoteException;
import android.os.StrictMode;
import android.text.format.DateUtils;
import android.text.format.TimeMigrationUtils;
import android.util.Log;
@@ -2619,7 +2620,13 @@ public final class CalendarContract {
            intent.setData(ContentUris.withAppendedId(CalendarContract.CONTENT_URI, alarmTime));
            intent.putExtra(ALARM_TIME, alarmTime);
            intent.setFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);

            // Disable strict mode VM policy violations temporarily for intents that contain a
            // content URI but don't have FLAG_GRANT_READ_URI_PERMISSION.
            StrictMode.VmPolicy oldVmPolicy = StrictMode.allowVmViolations();
            PendingIntent pi = PendingIntent.getBroadcast(context, 0, intent, 0);
            StrictMode.setVmPolicy(oldVmPolicy);

            manager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, alarmTime, pi);
        }