Add cellular data off conditional

Change-Id: I34980f3fc09bf5dd47eb296c5b1c5fccc87b5c90
This commit is contained in:
Jason Monk
2015-12-15 15:54:26 -05:00
parent af24b6377e
commit 70ecea2207
9 changed files with 180 additions and 40 deletions

View File

@@ -16,10 +16,8 @@
package com.android.settings.dashboard.conditional;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.drawable.Icon;
import android.net.ConnectivityManager;
import com.android.settings.R;
@@ -38,13 +36,8 @@ public class AirplaneModeCondition extends Condition {
}
@Override
protected void onSilenceChanged(boolean silenced) {
// Only need to listen for airplane mode changes when its been silenced.
PackageManager pm = mManager.getContext().getPackageManager();
pm.setComponentEnabledSetting(new ComponentName(mManager.getContext(), Receiver.class),
silenced ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
: PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
protected Class<?> getReceiverClass() {
return Receiver.class;
}
@Override