Android Open Source - JobSchedulerCompat Receiver Utils From Project Back to project page JobSchedulerCompat .
License The source code is released under:
Apache License
If you think the Android project JobSchedulerCompat listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code package me.tatarka.support.internal.receivers;
/ * w w w . j a v a 2 s . c o m * /
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageManager;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
import static android.content.pm.PackageManager.DONT_KILL_APP;
/** @hide */
public final class ReceiverUtils {
private ReceiverUtils() {}
public static <T extends BroadcastReceiver> void enable(Context context, Class<T> receiverClass) {
ComponentName receiver = new ComponentName(context, receiverClass);
PackageManager pm = context.getPackageManager();
pm.setComponentEnabledSetting(receiver, COMPONENT_ENABLED_STATE_ENABLED, DONT_KILL_APP);
}
public static <T extends BroadcastReceiver> void disable(Context context, Class<T> receiverClass) {
ComponentName receiver = new ComponentName(context, receiverClass);
PackageManager pm = context.getPackageManager();
pm.setComponentEnabledSetting(receiver, COMPONENT_ENABLED_STATE_DISABLED, DONT_KILL_APP);
}
}
Java Source Code List me.tatarka.support.internal.IJobServiceCompat.java me.tatarka.support.internal.IoThread.java me.tatarka.support.internal.JobSchedulerCompat.java me.tatarka.support.internal.JobSchedulerLollipopDelegate.java me.tatarka.support.internal.job.JobSchedulerService.java me.tatarka.support.internal.job.JobServiceCompat.java me.tatarka.support.internal.job.JobStore.java me.tatarka.support.internal.receivers.BootReceiver.java me.tatarka.support.internal.receivers.ControllerPrefs.java me.tatarka.support.internal.receivers.IdleReceiver.java me.tatarka.support.internal.receivers.JobStatus.java me.tatarka.support.internal.receivers.NetworkReceiver.java me.tatarka.support.internal.receivers.PowerReceiver.java me.tatarka.support.internal.receivers.ReceiverUtils.java me.tatarka.support.internal.receivers.TimeReceiver.java me.tatarka.support.internal.util.ArraySet.java me.tatarka.support.internal.util.ContainerHelpers.java me.tatarka.support.internal.util.EmptyArray.java me.tatarka.support.internal.util.FastXmlSerializer.java me.tatarka.support.internal.util.MapCollections.java me.tatarka.support.internal.util.XmlUtils.java me.tatarka.support.job.ApplicationTest.java me.tatarka.support.job.JobInfo.java me.tatarka.support.job.JobParameters.java me.tatarka.support.job.JobScheduler.java me.tatarka.support.job.JobService.java me.tatarka.support.job.sample.MainActivity.java me.tatarka.support.job.sample.service.TestJobService.java me.tatarka.support.os.PersistableBundleCompat.java me.tatarka.support.os.PersistableBundle.java