From 8216236175c74c4d93e28eb06314b7b22b12df15 Mon Sep 17 00:00:00 2001 From: Nathan Harold Date: Thu, 21 Jan 2016 12:20:26 -0800 Subject: [PATCH] Remove Data RealTime Info Listener Support -Remove Listener from the NetworkManagementService -Remove the callback capability from TelephonyRegistry -Remove the callback capbility from PhoneStateListener Because of intractable problems with power consumption and consistency, this signal is removed and should not be used. Bug: 23319188 Change-Id: I99383075bbd5604cc801deab6de94ac97fc17bfd --- .../server/NetworkManagementService.java | 17 --------- .../com/android/server/TelephonyRegistry.java | 36 ------------------- .../android/telephony/PhoneStateListener.java | 4 ++- .../telephony/ITelephonyRegistry.aidl | 2 -- 4 files changed, 3 insertions(+), 56 deletions(-) diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java index dd19c6a91eae4..95f57346dcfcc 100644 --- a/services/core/java/com/android/server/NetworkManagementService.java +++ b/services/core/java/com/android/server/NetworkManagementService.java @@ -186,7 +186,6 @@ public class NetworkManagementService extends INetworkManagementService.Stub private final Handler mFgHandler; private final Handler mDaemonHandler; - private final PhoneStateListener mPhoneStateListener; private IBatteryStats mBatteryStats; @@ -283,22 +282,6 @@ public class NetworkManagementService extends INetworkManagementService.Stub mDaemonHandler = new Handler(FgThread.get().getLooper()); - mPhoneStateListener = new PhoneStateListener(SubscriptionManager.DEFAULT_SUBSCRIPTION_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); } diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java index 19a4851525a65..9ee8e773d2cff 100644 --- a/services/core/java/com/android/server/TelephonyRegistry.java +++ b/services/core/java/com/android/server/TelephonyRegistry.java @@ -34,7 +34,6 @@ import android.os.Message; import android.os.RemoteException; import android.os.UserHandle; import android.telephony.CellLocation; -import android.telephony.DataConnectionRealTimeInfo; import android.telephony.Rlog; import android.telephony.TelephonyManager; import android.telephony.SubscriptionManager; @@ -179,8 +178,6 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { private int mDefaultPhoneId = SubscriptionManager.INVALID_PHONE_INDEX; - private DataConnectionRealTimeInfo mDcRtInfo = new DataConnectionRealTimeInfo(); - private int mRingingCallState = PreciseCallState.PRECISE_CALL_STATE_IDLE; private int mForegroundCallState = PreciseCallState.PRECISE_CALL_STATE_IDLE; @@ -624,13 +621,6 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { remove(r.binder); } } - if ((events & PhoneStateListener.LISTEN_DATA_CONNECTION_REAL_TIME_INFO) != 0) { - try { - r.callback.onDataConnectionRealTimeInfoChanged(mDcRtInfo); - } catch (RemoteException ex) { - remove(r.binder); - } - } if ((events & PhoneStateListener.LISTEN_PRECISE_CALL_STATE) != 0) { try { r.callback.onPreciseCallStateChanged(mPreciseCallState); @@ -921,31 +911,6 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { } } - public void notifyDataConnectionRealTimeInfo(DataConnectionRealTimeInfo dcRtInfo) { - if (!checkNotifyPermission("notifyDataConnectionRealTimeInfo()")) { - return; - } - - synchronized (mRecords) { - mDcRtInfo = dcRtInfo; - for (Record r : mRecords) { - if (validateEventsAndUserLocked(r, - PhoneStateListener.LISTEN_DATA_CONNECTION_REAL_TIME_INFO)) { - try { - if (DBG_LOC) { - log("notifyDataConnectionRealTimeInfo: mDcRtInfo=" - + mDcRtInfo + " r=" + r); - } - r.callback.onDataConnectionRealTimeInfoChanged(mDcRtInfo); - } catch (RemoteException ex) { - mRemoveList.add(r.binder); - } - } - } - handleRemoveListLocked(); - } - } - @Override public void notifyMessageWaitingChangedForPhoneId(int phoneId, int subId, boolean mwi) { if (!checkNotifyPermission("notifyMessageWaitingChanged()")) { @@ -1370,7 +1335,6 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { pw.println(" mCellLocation=" + mCellLocation[i]); pw.println(" mCellInfo=" + mCellInfo.get(i)); } - pw.println(" mDcRtInfo=" + mDcRtInfo); pw.println("registrations: count=" + recordCount); for (Record r : mRecords) { pw.println(" " + r); diff --git a/telephony/java/android/telephony/PhoneStateListener.java b/telephony/java/android/telephony/PhoneStateListener.java index 16472c814fc6f..ae130d4ac34fe 100644 --- a/telephony/java/android/telephony/PhoneStateListener.java +++ b/telephony/java/android/telephony/PhoneStateListener.java @@ -194,10 +194,12 @@ public class PhoneStateListener { * {@more} * Requires Permission: {@link android.Manifest.permission#READ_PRECISE_PHONE_STATE * READ_PRECISE_PHONE_STATE} - * * @see #onDataConnectionRealTimeInfoChanged(DataConnectionRealTimeInfo) + * + * @deprecated Use {@link TelephonyManager#getModemActivityInfo()} * @hide */ + @Deprecated public static final int LISTEN_DATA_CONNECTION_REAL_TIME_INFO = 0x00002000; /** diff --git a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl index 76b69cea8ae6b..907d76e816c02 100644 --- a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl @@ -21,7 +21,6 @@ import android.net.LinkProperties; import android.net.NetworkCapabilities; import android.os.Bundle; import android.telephony.CellInfo; -import android.telephony.DataConnectionRealTimeInfo; import android.telephony.ServiceState; import android.telephony.SignalStrength; import android.telephony.CellInfo; @@ -65,7 +64,6 @@ interface ITelephonyRegistry { void notifyPreciseDataConnectionFailed(String reason, String apnType, String apn, String failCause); void notifyCellInfoForSubscriber(in int subId, in List cellInfo); - void notifyDataConnectionRealTimeInfo(in DataConnectionRealTimeInfo dcRtInfo); void notifyVoLteServiceStateChanged(in VoLteServiceState lteState); void notifyOemHookRawEventForSubscriber(in int subId, in byte[] rawData); void notifySubscriptionInfoChanged();