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

Commit 3e810388 authored by Varun Shah's avatar Varun Shah Committed by Automerger Merge Worker
Browse files

DO NOT MERGE: Disable StrictMode VM Policy check. am: f20d333a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13286399

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7276ffe8b50b5668cf21166a9ff9fad725d6fc6a
parents 76b29b2b f20d333a
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -40,6 +40,7 @@ import android.database.DatabaseUtils;
import android.net.Uri;
import android.net.Uri;
import android.os.Build;
import android.os.Build;
import android.os.RemoteException;
import android.os.RemoteException;
import android.os.StrictMode;
import android.text.format.DateUtils;
import android.text.format.DateUtils;
import android.text.format.TimeMigrationUtils;
import android.text.format.TimeMigrationUtils;
import android.util.Log;
import android.util.Log;
@@ -2619,7 +2620,13 @@ public final class CalendarContract {
            intent.setData(ContentUris.withAppendedId(CalendarContract.CONTENT_URI, alarmTime));
            intent.setData(ContentUris.withAppendedId(CalendarContract.CONTENT_URI, alarmTime));
            intent.putExtra(ALARM_TIME, alarmTime);
            intent.putExtra(ALARM_TIME, alarmTime);
            intent.setFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
            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);
            PendingIntent pi = PendingIntent.getBroadcast(context, 0, intent, 0);
            StrictMode.setVmPolicy(oldVmPolicy);

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