Loading telephony/java/android/telephony/ICellInfoCallback.aidl +1 −2 Original line number Original line Diff line number Diff line Loading @@ -16,7 +16,6 @@ package android.telephony; package android.telephony; import android.os.ParcelableException; import android.telephony.CellInfo; import android.telephony.CellInfo; import java.util.List; import java.util.List; Loading @@ -28,5 +27,5 @@ import java.util.List; oneway interface ICellInfoCallback oneway interface ICellInfoCallback { { void onCellInfo(in List<CellInfo> state); void onCellInfo(in List<CellInfo> state); void onError(in int errorCode, in ParcelableException detail); void onError(in int errorCode, in String exceptionName, in String message); } } telephony/java/android/telephony/TelephonyManager.java +22 −5 Original line number Original line Diff line number Diff line Loading @@ -5570,18 +5570,20 @@ public class TelephonyManager { telephony.requestCellInfoUpdate( telephony.requestCellInfoUpdate( getSubId(), getSubId(), new ICellInfoCallback.Stub() { new ICellInfoCallback.Stub() { @Override public void onCellInfo(List<CellInfo> cellInfo) { public void onCellInfo(List<CellInfo> cellInfo) { Binder.withCleanCallingIdentity(() -> Binder.withCleanCallingIdentity(() -> executor.execute(() -> callback.onCellInfo(cellInfo))); executor.execute(() -> callback.onCellInfo(cellInfo))); } } public void onError(int errorCode, android.os.ParcelableException detail) { @Override public void onError(int errorCode, String exceptionName, String message) { Binder.withCleanCallingIdentity(() -> Binder.withCleanCallingIdentity(() -> executor.execute(() -> callback.onError( executor.execute(() -> callback.onError( errorCode, detail.getCause()))); errorCode, createThrowableByClassName(exceptionName, message)))); } } }, getOpPackageName()); }, getOpPackageName()); } catch (RemoteException ex) { } catch (RemoteException ex) { } } } } Loading Loading @@ -5610,21 +5612,36 @@ public class TelephonyManager { telephony.requestCellInfoUpdateWithWorkSource( telephony.requestCellInfoUpdateWithWorkSource( getSubId(), getSubId(), new ICellInfoCallback.Stub() { new ICellInfoCallback.Stub() { @Override public void onCellInfo(List<CellInfo> cellInfo) { public void onCellInfo(List<CellInfo> cellInfo) { Binder.withCleanCallingIdentity(() -> Binder.withCleanCallingIdentity(() -> executor.execute(() -> callback.onCellInfo(cellInfo))); executor.execute(() -> callback.onCellInfo(cellInfo))); } } public void onError(int errorCode, android.os.ParcelableException detail) { @Override public void onError(int errorCode, String exceptionName, String message) { Binder.withCleanCallingIdentity(() -> Binder.withCleanCallingIdentity(() -> executor.execute(() -> callback.onError( executor.execute(() -> callback.onError( errorCode, detail.getCause()))); errorCode, createThrowableByClassName(exceptionName, message)))); } } }, getOpPackageName(), workSource); }, getOpPackageName(), workSource); } catch (RemoteException ex) { } catch (RemoteException ex) { } } } } private static Throwable createThrowableByClassName(String className, String message) { if (className == null) { return null; } try { Class<?> c = Class.forName(className); return (Throwable) c.getConstructor(String.class).newInstance(message); } catch (ReflectiveOperationException | ClassCastException e) { } return new RuntimeException(className + ": " + message); } /** /** * Sets the minimum time in milli-seconds between {@link PhoneStateListener#onCellInfoChanged * Sets the minimum time in milli-seconds between {@link PhoneStateListener#onCellInfoChanged * PhoneStateListener.onCellInfoChanged} will be invoked. * PhoneStateListener.onCellInfoChanged} will be invoked. Loading Loading
telephony/java/android/telephony/ICellInfoCallback.aidl +1 −2 Original line number Original line Diff line number Diff line Loading @@ -16,7 +16,6 @@ package android.telephony; package android.telephony; import android.os.ParcelableException; import android.telephony.CellInfo; import android.telephony.CellInfo; import java.util.List; import java.util.List; Loading @@ -28,5 +27,5 @@ import java.util.List; oneway interface ICellInfoCallback oneway interface ICellInfoCallback { { void onCellInfo(in List<CellInfo> state); void onCellInfo(in List<CellInfo> state); void onError(in int errorCode, in ParcelableException detail); void onError(in int errorCode, in String exceptionName, in String message); } }
telephony/java/android/telephony/TelephonyManager.java +22 −5 Original line number Original line Diff line number Diff line Loading @@ -5570,18 +5570,20 @@ public class TelephonyManager { telephony.requestCellInfoUpdate( telephony.requestCellInfoUpdate( getSubId(), getSubId(), new ICellInfoCallback.Stub() { new ICellInfoCallback.Stub() { @Override public void onCellInfo(List<CellInfo> cellInfo) { public void onCellInfo(List<CellInfo> cellInfo) { Binder.withCleanCallingIdentity(() -> Binder.withCleanCallingIdentity(() -> executor.execute(() -> callback.onCellInfo(cellInfo))); executor.execute(() -> callback.onCellInfo(cellInfo))); } } public void onError(int errorCode, android.os.ParcelableException detail) { @Override public void onError(int errorCode, String exceptionName, String message) { Binder.withCleanCallingIdentity(() -> Binder.withCleanCallingIdentity(() -> executor.execute(() -> callback.onError( executor.execute(() -> callback.onError( errorCode, detail.getCause()))); errorCode, createThrowableByClassName(exceptionName, message)))); } } }, getOpPackageName()); }, getOpPackageName()); } catch (RemoteException ex) { } catch (RemoteException ex) { } } } } Loading Loading @@ -5610,21 +5612,36 @@ public class TelephonyManager { telephony.requestCellInfoUpdateWithWorkSource( telephony.requestCellInfoUpdateWithWorkSource( getSubId(), getSubId(), new ICellInfoCallback.Stub() { new ICellInfoCallback.Stub() { @Override public void onCellInfo(List<CellInfo> cellInfo) { public void onCellInfo(List<CellInfo> cellInfo) { Binder.withCleanCallingIdentity(() -> Binder.withCleanCallingIdentity(() -> executor.execute(() -> callback.onCellInfo(cellInfo))); executor.execute(() -> callback.onCellInfo(cellInfo))); } } public void onError(int errorCode, android.os.ParcelableException detail) { @Override public void onError(int errorCode, String exceptionName, String message) { Binder.withCleanCallingIdentity(() -> Binder.withCleanCallingIdentity(() -> executor.execute(() -> callback.onError( executor.execute(() -> callback.onError( errorCode, detail.getCause()))); errorCode, createThrowableByClassName(exceptionName, message)))); } } }, getOpPackageName(), workSource); }, getOpPackageName(), workSource); } catch (RemoteException ex) { } catch (RemoteException ex) { } } } } private static Throwable createThrowableByClassName(String className, String message) { if (className == null) { return null; } try { Class<?> c = Class.forName(className); return (Throwable) c.getConstructor(String.class).newInstance(message); } catch (ReflectiveOperationException | ClassCastException e) { } return new RuntimeException(className + ": " + message); } /** /** * Sets the minimum time in milli-seconds between {@link PhoneStateListener#onCellInfoChanged * Sets the minimum time in milli-seconds between {@link PhoneStateListener#onCellInfoChanged * PhoneStateListener.onCellInfoChanged} will be invoked. * PhoneStateListener.onCellInfoChanged} will be invoked. Loading