Use new mechanism to get messenger to StateTracker
bug:8445208
Change-Id: Ice7dfb0b50c9481d359aed14a51372878185171c
diff --git a/src/java/com/android/internal/telephony/dataconnection/DcTracker.java b/src/java/com/android/internal/telephony/dataconnection/DcTracker.java
index 8878a31..ad9f4a5 100644
--- a/src/java/com/android/internal/telephony/dataconnection/DcTracker.java
+++ b/src/java/com/android/internal/telephony/dataconnection/DcTracker.java
@@ -35,6 +35,7 @@
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Message;
+import android.os.Messenger;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.provider.Settings;
@@ -138,7 +139,17 @@
Telephony.Carriers.CONTENT_URI, true, mApnObserver);
initApnContextsAndDataConnection();
- broadcastMessenger();
+
+ ConnectivityManager cm = (ConnectivityManager)p.getContext().getSystemService(
+ Context.CONNECTIVITY_SERVICE);
+ cm.supplyMessenger(ConnectivityManager.TYPE_MOBILE, new Messenger(this));
+ cm.supplyMessenger(ConnectivityManager.TYPE_MOBILE_MMS, new Messenger(this));
+ cm.supplyMessenger(ConnectivityManager.TYPE_MOBILE_SUPL, new Messenger(this));
+ cm.supplyMessenger(ConnectivityManager.TYPE_MOBILE_DUN, new Messenger(this));
+ cm.supplyMessenger(ConnectivityManager.TYPE_MOBILE_HIPRI, new Messenger(this));
+ cm.supplyMessenger(ConnectivityManager.TYPE_MOBILE_FOTA, new Messenger(this));
+ cm.supplyMessenger(ConnectivityManager.TYPE_MOBILE_IMS, new Messenger(this));
+ cm.supplyMessenger(ConnectivityManager.TYPE_MOBILE_CBS, new Messenger(this));
}
@Override
diff --git a/src/java/com/android/internal/telephony/dataconnection/DcTrackerBase.java b/src/java/com/android/internal/telephony/dataconnection/DcTrackerBase.java
index b3f1c47..3030706 100644
--- a/src/java/com/android/internal/telephony/dataconnection/DcTrackerBase.java
+++ b/src/java/com/android/internal/telephony/dataconnection/DcTrackerBase.java
@@ -518,12 +518,6 @@
mDcTesterFailBringUpAll.dispose();
}
- protected void broadcastMessenger() {
- Intent intent = new Intent(DctConstants.ACTION_DATA_CONNECTION_TRACKER_MESSENGER);
- intent.putExtra(DctConstants.EXTRA_MESSENGER, new Messenger(this));
- mPhone.getContext().sendBroadcast(intent);
- }
-
public DctConstants.Activity getActivity() {
return mActivity;
}