Loading api/current.txt +3 −0 Original line number Original line Diff line number Diff line Loading @@ -44778,6 +44778,9 @@ package android.telephony { public static abstract class TelephonyManager.CellInfoCallback { public static abstract class TelephonyManager.CellInfoCallback { ctor public TelephonyManager.CellInfoCallback(); ctor public TelephonyManager.CellInfoCallback(); method public abstract void onCellInfo(java.util.List<android.telephony.CellInfo>); method public abstract void onCellInfo(java.util.List<android.telephony.CellInfo>); method public void onError(int, java.lang.Throwable); field public static final int ERROR_MODEM_ERROR = 2; // 0x2 field public static final int ERROR_TIMEOUT = 1; // 0x1 } } public static abstract class TelephonyManager.UssdResponseCallback { public static abstract class TelephonyManager.UssdResponseCallback { core/java/android/os/ParcelableException.aidl 0 → 100644 +18 −0 Original line number Original line Diff line number Diff line /* Copyright 2018, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ package android.os; parcelable ParcelableException; telephony/java/android/telephony/ICellInfoCallback.aidl +2 −0 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,7 @@ 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 @@ -27,4 +28,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); } } telephony/java/android/telephony/TelephonyManager.java +50 −4 Original line number Original line Diff line number Diff line Loading @@ -4898,19 +4898,53 @@ public class TelephonyManager { /** Callback for providing asynchronous {@link CellInfo} on request */ /** Callback for providing asynchronous {@link CellInfo} on request */ public abstract static class CellInfoCallback { public abstract static class CellInfoCallback { /** /** * Response to * Success response to * {@link android.telephony.TelephonyManager#requestCellInfoUpdate requestCellInfoUpdate()}. * {@link android.telephony.TelephonyManager#requestCellInfoUpdate requestCellInfoUpdate()}. * * * <p>Invoked when there is a response to * Invoked when there is a response to * {@link android.telephony.TelephonyManager#requestCellInfoUpdate requestCellInfoUpdate()} * {@link android.telephony.TelephonyManager#requestCellInfoUpdate requestCellInfoUpdate()} * to provide a list of {@link CellInfo}. If no {@link CellInfo} is available then an empty * to provide a list of {@link CellInfo}. If no {@link CellInfo} is available then an empty * list will be provided. If an error occurs, null will be provided. * list will be provided. If an error occurs, null will be provided unless the onError * callback is overridden. * * * @param cellInfo a list of {@link CellInfo}, an empty list, or null. * @param cellInfo a list of {@link CellInfo}, an empty list, or null. * * * {@see android.telephony.TelephonyManager#getAllCellInfo getAllCellInfo()} * {@see android.telephony.TelephonyManager#getAllCellInfo getAllCellInfo()} */ */ public abstract void onCellInfo(List<CellInfo> cellInfo); public abstract void onCellInfo(@NonNull List<CellInfo> cellInfo); /** @hide */ @Retention(RetentionPolicy.SOURCE) @IntDef(prefix = {"ERROR_"}, value = {ERROR_TIMEOUT, ERROR_MODEM_ERROR}) public @interface CellInfoCallbackError {} /** * The system timed out waiting for a response from the Radio. */ public static final int ERROR_TIMEOUT = 1; /** * The modem returned a failure. */ public static final int ERROR_MODEM_ERROR = 2; /** * Error response to * {@link android.telephony.TelephonyManager#requestCellInfoUpdate requestCellInfoUpdate()}. * * Invoked when an error condition prevents updated {@link CellInfo} from being fetched * and returned from the modem. Callers of requestCellInfoUpdate() should override this * function to receive detailed status information in the event of an error. By default, * this function will invoke onCellInfo() with null. * * @param errorCode an error code indicating the type of failure. * @param detail a Throwable object with additional detail regarding the failure if * available, otherwise null. */ public void onError(@CellInfoCallbackError int errorCode, @Nullable Throwable detail) { // By default, simply invoke the success callback with an empty list. onCellInfo(new ArrayList<CellInfo>()); } }; }; /** /** Loading @@ -4937,6 +4971,12 @@ public class TelephonyManager { Binder.withCleanCallingIdentity(() -> Binder.withCleanCallingIdentity(() -> executor.execute(() -> callback.onCellInfo(cellInfo))); executor.execute(() -> callback.onCellInfo(cellInfo))); } } public void onError(int errorCode, android.os.ParcelableException detail) { Binder.withCleanCallingIdentity(() -> executor.execute(() -> callback.onError( errorCode, detail.getCause()))); } }, getOpPackageName()); }, getOpPackageName()); } catch (RemoteException ex) { } catch (RemoteException ex) { Loading Loading @@ -4971,6 +5011,12 @@ public class TelephonyManager { Binder.withCleanCallingIdentity(() -> Binder.withCleanCallingIdentity(() -> executor.execute(() -> callback.onCellInfo(cellInfo))); executor.execute(() -> callback.onCellInfo(cellInfo))); } } public void onError(int errorCode, android.os.ParcelableException detail) { Binder.withCleanCallingIdentity(() -> executor.execute(() -> callback.onError( errorCode, detail.getCause()))); } }, getOpPackageName(), workSource); }, getOpPackageName(), workSource); } catch (RemoteException ex) { } catch (RemoteException ex) { } } Loading Loading
api/current.txt +3 −0 Original line number Original line Diff line number Diff line Loading @@ -44778,6 +44778,9 @@ package android.telephony { public static abstract class TelephonyManager.CellInfoCallback { public static abstract class TelephonyManager.CellInfoCallback { ctor public TelephonyManager.CellInfoCallback(); ctor public TelephonyManager.CellInfoCallback(); method public abstract void onCellInfo(java.util.List<android.telephony.CellInfo>); method public abstract void onCellInfo(java.util.List<android.telephony.CellInfo>); method public void onError(int, java.lang.Throwable); field public static final int ERROR_MODEM_ERROR = 2; // 0x2 field public static final int ERROR_TIMEOUT = 1; // 0x1 } } public static abstract class TelephonyManager.UssdResponseCallback { public static abstract class TelephonyManager.UssdResponseCallback {
core/java/android/os/ParcelableException.aidl 0 → 100644 +18 −0 Original line number Original line Diff line number Diff line /* Copyright 2018, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ package android.os; parcelable ParcelableException;
telephony/java/android/telephony/ICellInfoCallback.aidl +2 −0 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,7 @@ 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 @@ -27,4 +28,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); } }
telephony/java/android/telephony/TelephonyManager.java +50 −4 Original line number Original line Diff line number Diff line Loading @@ -4898,19 +4898,53 @@ public class TelephonyManager { /** Callback for providing asynchronous {@link CellInfo} on request */ /** Callback for providing asynchronous {@link CellInfo} on request */ public abstract static class CellInfoCallback { public abstract static class CellInfoCallback { /** /** * Response to * Success response to * {@link android.telephony.TelephonyManager#requestCellInfoUpdate requestCellInfoUpdate()}. * {@link android.telephony.TelephonyManager#requestCellInfoUpdate requestCellInfoUpdate()}. * * * <p>Invoked when there is a response to * Invoked when there is a response to * {@link android.telephony.TelephonyManager#requestCellInfoUpdate requestCellInfoUpdate()} * {@link android.telephony.TelephonyManager#requestCellInfoUpdate requestCellInfoUpdate()} * to provide a list of {@link CellInfo}. If no {@link CellInfo} is available then an empty * to provide a list of {@link CellInfo}. If no {@link CellInfo} is available then an empty * list will be provided. If an error occurs, null will be provided. * list will be provided. If an error occurs, null will be provided unless the onError * callback is overridden. * * * @param cellInfo a list of {@link CellInfo}, an empty list, or null. * @param cellInfo a list of {@link CellInfo}, an empty list, or null. * * * {@see android.telephony.TelephonyManager#getAllCellInfo getAllCellInfo()} * {@see android.telephony.TelephonyManager#getAllCellInfo getAllCellInfo()} */ */ public abstract void onCellInfo(List<CellInfo> cellInfo); public abstract void onCellInfo(@NonNull List<CellInfo> cellInfo); /** @hide */ @Retention(RetentionPolicy.SOURCE) @IntDef(prefix = {"ERROR_"}, value = {ERROR_TIMEOUT, ERROR_MODEM_ERROR}) public @interface CellInfoCallbackError {} /** * The system timed out waiting for a response from the Radio. */ public static final int ERROR_TIMEOUT = 1; /** * The modem returned a failure. */ public static final int ERROR_MODEM_ERROR = 2; /** * Error response to * {@link android.telephony.TelephonyManager#requestCellInfoUpdate requestCellInfoUpdate()}. * * Invoked when an error condition prevents updated {@link CellInfo} from being fetched * and returned from the modem. Callers of requestCellInfoUpdate() should override this * function to receive detailed status information in the event of an error. By default, * this function will invoke onCellInfo() with null. * * @param errorCode an error code indicating the type of failure. * @param detail a Throwable object with additional detail regarding the failure if * available, otherwise null. */ public void onError(@CellInfoCallbackError int errorCode, @Nullable Throwable detail) { // By default, simply invoke the success callback with an empty list. onCellInfo(new ArrayList<CellInfo>()); } }; }; /** /** Loading @@ -4937,6 +4971,12 @@ public class TelephonyManager { Binder.withCleanCallingIdentity(() -> Binder.withCleanCallingIdentity(() -> executor.execute(() -> callback.onCellInfo(cellInfo))); executor.execute(() -> callback.onCellInfo(cellInfo))); } } public void onError(int errorCode, android.os.ParcelableException detail) { Binder.withCleanCallingIdentity(() -> executor.execute(() -> callback.onError( errorCode, detail.getCause()))); } }, getOpPackageName()); }, getOpPackageName()); } catch (RemoteException ex) { } catch (RemoteException ex) { Loading Loading @@ -4971,6 +5011,12 @@ public class TelephonyManager { Binder.withCleanCallingIdentity(() -> Binder.withCleanCallingIdentity(() -> executor.execute(() -> callback.onCellInfo(cellInfo))); executor.execute(() -> callback.onCellInfo(cellInfo))); } } public void onError(int errorCode, android.os.ParcelableException detail) { Binder.withCleanCallingIdentity(() -> executor.execute(() -> callback.onError( errorCode, detail.getCause()))); } }, getOpPackageName(), workSource); }, getOpPackageName(), workSource); } catch (RemoteException ex) { } catch (RemoteException ex) { } } Loading