Loading core/java/android/telephony/TelephonyRegistryManager.java +15 −0 Original line number Diff line number Diff line Loading @@ -786,6 +786,21 @@ public class TelephonyRegistryManager { } } /** * Notify that the data enabled has changed. * * @param enabled True if data is enabled, otherwise disabled. * @param reason Reason for data enabled/disabled. See {@code REASON_*} in * {@link TelephonyManager}. */ public void notifyDataEnabled(boolean enabled, @TelephonyManager.DataEnabledReason int reason) { try { sRegistry.notifyDataEnabled(enabled, reason); } catch (RemoteException ex) { // system server crash } } public @NonNull Set<Integer> getEventsFromListener(@NonNull PhoneStateListener listener) { Set<Integer> eventList = new ArraySet<>(); Loading core/java/com/android/internal/telephony/ITelephonyRegistry.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -94,4 +94,5 @@ interface ITelephonyRegistry { void notifyBarringInfoChanged(int slotIndex, int subId, in BarringInfo barringInfo); void notifyPhysicalChannelConfigForSubscriber(in int subId, in List<PhysicalChannelConfig> configs); void notifyDataEnabled(boolean enabled, int reason); } services/core/java/com/android/server/TelephonyRegistry.java +36 −0 Original line number Diff line number Diff line Loading @@ -2361,6 +2361,40 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { } } /** * Notify that the data enabled has changed. * * @param enabled True if data is enabled, otherwise disabled. * @param reason Reason for data enabled/disabled. See {@code DATA_*} in * {@link TelephonyManager}. */ public void notifyDataEnabled(boolean enabled, @TelephonyManager.DataEnabledReason int reason) { if (!checkNotifyPermission("notifyDataEnabled()")) { return; } if (VDBG) { log("notifyDataEnabled: enabled=" + enabled + " reason=" + reason); } mIsDataEnabled = enabled; mDataEnabledReason = reason; synchronized (mRecords) { for (Record r : mRecords) { if (r.matchPhoneStateListenerEvent( PhoneStateListener.EVENT_DATA_ENABLED_CHANGED)) { try { r.callback.onDataEnabledChanged(enabled, reason); } catch (RemoteException ex) { mRemoveList.add(r.binder); } } } handleRemoveListLocked(); } } @Override public void dump(FileDescriptor fd, PrintWriter writer, String[] args) { final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " "); Loading Loading @@ -2413,6 +2447,8 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { pw.println("mDefaultPhoneId=" + mDefaultPhoneId); pw.println("mDefaultSubId=" + mDefaultSubId); pw.println("mPhysicalChannelConfigs=" + mPhysicalChannelConfigs); pw.println("mIsDataEnabled=" + mIsDataEnabled); pw.println("mDataEnabledReason=" + mDataEnabledReason); pw.decreaseIndent(); Loading Loading
core/java/android/telephony/TelephonyRegistryManager.java +15 −0 Original line number Diff line number Diff line Loading @@ -786,6 +786,21 @@ public class TelephonyRegistryManager { } } /** * Notify that the data enabled has changed. * * @param enabled True if data is enabled, otherwise disabled. * @param reason Reason for data enabled/disabled. See {@code REASON_*} in * {@link TelephonyManager}. */ public void notifyDataEnabled(boolean enabled, @TelephonyManager.DataEnabledReason int reason) { try { sRegistry.notifyDataEnabled(enabled, reason); } catch (RemoteException ex) { // system server crash } } public @NonNull Set<Integer> getEventsFromListener(@NonNull PhoneStateListener listener) { Set<Integer> eventList = new ArraySet<>(); Loading
core/java/com/android/internal/telephony/ITelephonyRegistry.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -94,4 +94,5 @@ interface ITelephonyRegistry { void notifyBarringInfoChanged(int slotIndex, int subId, in BarringInfo barringInfo); void notifyPhysicalChannelConfigForSubscriber(in int subId, in List<PhysicalChannelConfig> configs); void notifyDataEnabled(boolean enabled, int reason); }
services/core/java/com/android/server/TelephonyRegistry.java +36 −0 Original line number Diff line number Diff line Loading @@ -2361,6 +2361,40 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { } } /** * Notify that the data enabled has changed. * * @param enabled True if data is enabled, otherwise disabled. * @param reason Reason for data enabled/disabled. See {@code DATA_*} in * {@link TelephonyManager}. */ public void notifyDataEnabled(boolean enabled, @TelephonyManager.DataEnabledReason int reason) { if (!checkNotifyPermission("notifyDataEnabled()")) { return; } if (VDBG) { log("notifyDataEnabled: enabled=" + enabled + " reason=" + reason); } mIsDataEnabled = enabled; mDataEnabledReason = reason; synchronized (mRecords) { for (Record r : mRecords) { if (r.matchPhoneStateListenerEvent( PhoneStateListener.EVENT_DATA_ENABLED_CHANGED)) { try { r.callback.onDataEnabledChanged(enabled, reason); } catch (RemoteException ex) { mRemoveList.add(r.binder); } } } handleRemoveListLocked(); } } @Override public void dump(FileDescriptor fd, PrintWriter writer, String[] args) { final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " "); Loading Loading @@ -2413,6 +2447,8 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { pw.println("mDefaultPhoneId=" + mDefaultPhoneId); pw.println("mDefaultSubId=" + mDefaultSubId); pw.println("mPhysicalChannelConfigs=" + mPhysicalChannelConfigs); pw.println("mIsDataEnabled=" + mIsDataEnabled); pw.println("mDataEnabledReason=" + mDataEnabledReason); pw.decreaseIndent(); Loading