summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2012-06-06 12:13:30 +0200
committerDanny Baumann <dannybaumann@web.de>2012-06-07 11:32:59 +0200
commit586fba684b23be9fc39d9a44a7f5a10a4de40e2b (patch)
tree95e4f489828930837287f657dffa02ade1cac508
parent8c0e7112c6622d79b1573668901933397031ec65 (diff)
downloadframeworks_base-586fba684b23be9fc39d9a44a7f5a10a4de40e2b.zip
frameworks_base-586fba684b23be9fc39d9a44a7f5a10a4de40e2b.tar.gz
frameworks_base-586fba684b23be9fc39d9a44a7f5a10a4de40e2b.tar.bz2
Send out a MOBILE_DATA_CHANGED intent.
The settings app widget expects that to be done for working properly.
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/powerwidget/MobileDataButton.java5
-rw-r--r--services/java/com/android/server/ConnectivityService.java7
2 files changed, 10 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/powerwidget/MobileDataButton.java b/packages/SystemUI/src/com/android/systemui/statusbar/powerwidget/MobileDataButton.java
index 7dd1c7b..cb0666c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/powerwidget/MobileDataButton.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/powerwidget/MobileDataButton.java
@@ -9,12 +9,13 @@ import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.provider.Settings;
-import com.android.internal.telephony.TelephonyIntents;
import com.android.internal.telephony.Phone;
public class MobileDataButton extends PowerButton {
public static final String ACTION_MODIFY_NETWORK_MODE = "com.android.internal.telephony.MODIFY_NETWORK_MODE";
+ public static final String ACTION_MOBILE_DATA_CHANGED = "com.android.internal.telephony.MOBILE_DATA_CHANGED";
+
public static final String EXTRA_NETWORK_MODE = "networkMode";
public MobileDataButton() { mType = BUTTON_MOBILEDATA; }
@@ -75,7 +76,7 @@ public class MobileDataButton extends PowerButton {
@Override
protected IntentFilter getBroadcastIntentFilter() {
IntentFilter filter = new IntentFilter();
- filter.addAction(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED);
+ filter.addAction(ACTION_MOBILE_DATA_CHANGED);
return filter;
}
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index 204777d..343f4ca 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -74,6 +74,9 @@ public class ConnectivityService extends IConnectivityManager.Stub {
private static final String NETWORK_RESTORE_DELAY_PROP_NAME =
"android.telephony.apn-restore";
+ private static final String ACTION_MOBILE_DATA_CHANGED =
+ "com.android.internal.telephony.MOBILE_DATA_CHANGED";
+ private static final String EXTRA_ENABLED = "enabled";
private Tethering mTethering;
private boolean mTetheringConfigValid = false;
@@ -1014,6 +1017,10 @@ public class ConnectivityService extends IConnectivityManager.Stub {
mNetTrackers[ConnectivityManager.TYPE_WIMAX].teardown();
}
}
+
+ Intent intent = new Intent(ACTION_MOBILE_DATA_CHANGED);
+ intent.putExtra(EXTRA_ENABLED, enabled);
+ mContext.sendBroadcast(intent);
}
private int getNumConnectedNetworks() {