Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b5348b4 authored by Andrew Flynn's avatar Andrew Flynn
Browse files

Revert "notifyCarrierNetworkChange:TelephonyManager->CarrierService"

This reverts commit 7f8be9d8.

Change-Id: Ib99d2b8f83c2775cf5df4330a4f20bc791a83e5e
parent 7f8be9d8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -28651,8 +28651,7 @@ package android.service.carrier {
  public abstract class CarrierService extends android.app.Service {
    ctor public CarrierService();
    method public final void notifyCarrierNetworkChange(boolean);
    method public android.os.IBinder onBind(android.content.Intent);
    method public final android.os.IBinder onBind(android.content.Intent);
    method public abstract android.os.PersistableBundle onLoadConfig(android.service.carrier.CarrierIdentifier);
    field public static final java.lang.String BIND_SERVICE_INTERFACE = "android.service.carrier.BindService";
    field public static final java.lang.String CONFIG_SERVICE_INTERFACE = "android.service.carrier.ConfigService";
@@ -31216,6 +31215,7 @@ package android.telephony {
    method public boolean isVoiceCapable();
    method public boolean isWorldPhone();
    method public void listen(android.telephony.PhoneStateListener, int);
    method public void notifyCarrierNetworkChange(boolean);
    method public java.lang.String sendEnvelopeWithStatus(java.lang.String);
    method public boolean setLine1NumberForDisplay(java.lang.String, java.lang.String);
    method public boolean setOperatorBrandOverride(java.lang.String);
+2 −2
Original line number Diff line number Diff line
@@ -30684,8 +30684,7 @@ package android.service.carrier {
  public abstract class CarrierService extends android.app.Service {
    ctor public CarrierService();
    method public final void notifyCarrierNetworkChange(boolean);
    method public android.os.IBinder onBind(android.content.Intent);
    method public final android.os.IBinder onBind(android.content.Intent);
    method public abstract android.os.PersistableBundle onLoadConfig(android.service.carrier.CarrierIdentifier);
    field public static final java.lang.String BIND_SERVICE_INTERFACE = "android.service.carrier.BindService";
    field public static final java.lang.String CONFIG_SERVICE_INTERFACE = "android.service.carrier.ConfigService";
@@ -33460,6 +33459,7 @@ package android.telephony {
    method public boolean isWorldPhone();
    method public void listen(android.telephony.PhoneStateListener, int);
    method public boolean needsOtaServiceProvisioning();
    method public void notifyCarrierNetworkChange(boolean);
    method public java.lang.String sendEnvelopeWithStatus(java.lang.String);
    method public void setDataEnabled(boolean);
    method public void setDataEnabled(int, boolean);
+5 −43
Original line number Diff line number Diff line
@@ -14,15 +14,10 @@

package android.service.carrier;

import android.annotation.CallSuper;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.PersistableBundle;
import android.os.RemoteException;
import android.os.ServiceManager;

import com.android.internal.telephony.ITelephonyRegistry;

/**
 * A service that exposes carrier-specific functionality to the system.
@@ -50,16 +45,10 @@ public abstract class CarrierService extends Service {
    public static final String CONFIG_SERVICE_INTERFACE = "android.service.carrier.ConfigService";
    public static final String BIND_SERVICE_INTERFACE = "android.service.carrier.BindService";

    private static ITelephonyRegistry sRegistry;

    private final ICarrierService.Stub mStubWrapper;

    public CarrierService() {
        mStubWrapper = new ICarrierServiceWrapper();
        if (sRegistry == null) {
            sRegistry = ITelephonyRegistry.Stub.asInterface(
                    ServiceManager.getService("telephony.registry"));
        }
    }

    /**
@@ -94,39 +83,9 @@ public abstract class CarrierService extends Service {
     */
    public abstract PersistableBundle onLoadConfig(CarrierIdentifier id);

    /**
     * Informs the system of an intentional upcoming carrier network change by
     * a carrier app. This call is optional and is only used to allow the
     * system to provide alternative UI while telephony is performing an action
     * that may result in intentional, temporary network lack of connectivity.
     * <p>
     * Based on the active parameter passed in, this method will either show or
     * hide the alternative UI. There is no timeout associated with showing
     * this UX, so a carrier app must be sure to call with active set to false
     * sometime after calling with it set to true.
     * <p>
     * Requires Permission:
     *   {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
     * Or the calling app has carrier privileges.
     *   @see {@link android.telephony.TelephonyManager#hasCarrierPrivileges}
     *
     * @param active Whether the carrier network change is or shortly will be
     *               active. Set this value to true to begin showing
     *               alternative UI and false to stop.
     */
    public final void notifyCarrierNetworkChange(boolean active) {
        try {
            if (sRegistry != null) sRegistry.notifyCarrierNetworkChange(active);
        } catch (RemoteException | NullPointerException ex) {}
    }

    /**
     * If overriding this method, call through to the super method for any unknown actions.
     * {@inheritDoc}
     */
    /** @hide */
    @Override
    @CallSuper
    public IBinder onBind(Intent intent) {
    public final IBinder onBind(Intent intent) {
        switch (intent.getAction()) {
            case CONFIG_SERVICE_INTERFACE:
            case BIND_SERVICE_INTERFACE:
@@ -139,8 +98,11 @@ public abstract class CarrierService extends Service {
    /**
     * A wrapper around ICarrierService that forwards calls to implementations of
     * {@link CarrierService}.
     *
     * @hide
     */
    private class ICarrierServiceWrapper extends ICarrierService.Stub {

        @Override
        public PersistableBundle getCarrierConfig(CarrierIdentifier id) {
            return CarrierService.this.onLoadConfig(id);
+29 −0
Original line number Diff line number Diff line
@@ -2059,6 +2059,35 @@ public class TelephonyManager {
        return false;
    }

    /**
     * Informs the system of an intentional upcoming carrier network change by
     * a carrier app. This call is optional and is only used to allow the
     * system to provide alternative UI while telephony is performing an action
     * that may result in intentional, temporary network lack of connectivity.
     * <p>
     * Based on the active parameter passed in, this method will either show or
     * hide the alternative UI. There is no timeout associated with showing
     * this UX, so a carrier app must be sure to call with active set to false
     * sometime after calling with it set to true.
     * <p>
     * Requires Permission:
     *   {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
     * Or the calling app has carrier privileges.
     *   @see #hasCarrierPrivileges
     *
     * @param active Whether the carrier network change is or shortly will be
     *               active. Set this value to true to begin showing
     *               alternative UI and false to stop.
     */
    public void notifyCarrierNetworkChange(boolean active) {
        try {
            if (sRegistry != null)
                sRegistry.notifyCarrierNetworkChange(active);
        } catch (RemoteException ex) {
        } catch (NullPointerException ex) {
        }
    }

    /**
     * Returns the alphabetic identifier associated with the line 1 number.
     * Return null if it is unavailable.