summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CleanSpec.mk1
-rw-r--r--services/core/java/com/android/server/NetworkManagementService.java12
2 files changed, 11 insertions, 2 deletions
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 1968a78..b6a47f2 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -202,6 +202,7 @@ $(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framew
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes/android/app/maintenance)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/classes/android/app/maintenance)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/android/app/maintenance)
+$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/services_intermediates)
# ******************************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST ABOVE THIS BANNER
diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java
index 7022294..f9c7a78 100644
--- a/services/core/java/com/android/server/NetworkManagementService.java
+++ b/services/core/java/com/android/server/NetworkManagementService.java
@@ -63,6 +63,7 @@ import android.os.SystemProperties;
import android.telephony.DataConnectionRealTimeInfo;
import android.telephony.PhoneStateListener;
import android.telephony.SubscriptionManager;
+import android.telephony.TelephonyManager;
import android.util.Log;
import android.util.Slog;
import android.util.SparseBooleanArray;
@@ -240,15 +241,22 @@ public class NetworkManagementService extends INetworkManagementService.Stub
mThread = new Thread(mConnector, NETD_TAG);
mDaemonHandler = new Handler(FgThread.get().getLooper());
- mPhoneStateListener = new PhoneStateListener(
- SubscriptionManager.DEFAULT_SUB_ID, // FIXME: What Subscription should be used??
+
+ mPhoneStateListener = new PhoneStateListener(SubscriptionManager.DEFAULT_SUB_ID,
mDaemonHandler.getLooper()) {
+ @Override
public void onDataConnectionRealTimeInfoChanged(
DataConnectionRealTimeInfo dcRtInfo) {
+ if (DBG) Slog.d(TAG, "onDataConnectionRealTimeInfoChanged: " + dcRtInfo);
notifyInterfaceClassActivity(ConnectivityManager.TYPE_MOBILE,
dcRtInfo.getDcPowerState(), dcRtInfo.getTime(), true);
}
};
+ TelephonyManager tm = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
+ if (tm != null) {
+ tm.listen(mPhoneStateListener,
+ PhoneStateListener.LISTEN_DATA_CONNECTION_REAL_TIME_INFO);
+ }
// Add ourself to the Watchdog monitors.
Watchdog.getInstance().addMonitor(this);