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

Commit a73cde3d authored by James Lin's avatar James Lin Committed by Automerger Merge Worker
Browse files

Merge "[RCS UCE] Remove the unused class RcsPresenceExchangeImplBase and...

Merge "[RCS UCE] Remove the unused class RcsPresenceExchangeImplBase and RcsSipOptionsImplBase" am: cb50d9f7 am: efbc1deb am: 83196b18

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1517977

Change-Id: I1b445c557db138b676df7b626a26970814038480
parents eacbb416 83196b18
Loading
Loading
Loading
Loading
+0 −12
Original line number Original line Diff line number Diff line
@@ -22,7 +22,6 @@ import android.telephony.ims.aidl.ICapabilityExchangeEventListener;
import android.telephony.ims.aidl.IImsCapabilityCallback;
import android.telephony.ims.aidl.IImsCapabilityCallback;
import android.telephony.ims.aidl.IOptionsResponseCallback;
import android.telephony.ims.aidl.IOptionsResponseCallback;
import android.telephony.ims.aidl.IPublishResponseCallback;
import android.telephony.ims.aidl.IPublishResponseCallback;
import android.telephony.ims.aidl.IRcsFeatureListener;
import android.telephony.ims.aidl.ISubscribeResponseCallback;
import android.telephony.ims.aidl.ISubscribeResponseCallback;
import android.telephony.ims.feature.CapabilityChangeRequest;
import android.telephony.ims.feature.CapabilityChangeRequest;


@@ -34,7 +33,6 @@ import java.util.List;
 */
 */
interface IImsRcsFeature {
interface IImsRcsFeature {
    // Not oneway because we need to verify this completes before doing anything else.
    // Not oneway because we need to verify this completes before doing anything else.
    void setListener(IRcsFeatureListener listener);
    int queryCapabilityStatus();
    int queryCapabilityStatus();
    // Inherited from ImsFeature
    // Inherited from ImsFeature
    int getFeatureState();
    int getFeatureState();
@@ -50,14 +48,4 @@ interface IImsRcsFeature {
    oneway void subscribeForCapabilities(in List<Uri> uris, ISubscribeResponseCallback cb);
    oneway void subscribeForCapabilities(in List<Uri> uris, ISubscribeResponseCallback cb);
    oneway void sendOptionsCapabilityRequest(in Uri contactUri,
    oneway void sendOptionsCapabilityRequest(in Uri contactUri,
            in List<String> myCapabilities, IOptionsResponseCallback cb);
            in List<String> myCapabilities, IOptionsResponseCallback cb);
    // RcsPresenceExchangeImplBase specific api
    oneway void requestCapabilities(in List<Uri> uris, int operationToken);
    oneway void updateCapabilities(in RcsContactUceCapability capabilities, int operationToken);
    // RcsSipOptionsImplBase specific api
    oneway void sendCapabilityRequest(in Uri contactUri,
            in RcsContactUceCapability capabilities, int operationToken);
    oneway void respondToCapabilityRequest(in String contactUri,
            in RcsContactUceCapability ownCapabilities, int operationToken);
    oneway void respondToCapabilityRequestWithError(in Uri contactUri, int code, in String reason,
            int operationToken);
}
}
+0 −42
Original line number Original line Diff line number Diff line
/*
 * Copyright (c) 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.telephony.ims.aidl;

import android.net.Uri;
import android.telephony.ims.RcsContactUceCapability;

import java.util.List;

/**
 * Listener interface for updates from the RcsFeature back to the framework.
 * {@hide}
 */
interface IRcsFeatureListener {
    //RcsCapabilityExchange specific
    oneway void onCommandUpdate(int commandCode, int operationToken);
    // RcsPresenceExchangeImplBase Specific
    oneway void onNetworkResponse(int code, in String reason, int operationToken);
    oneway void onCapabilityRequestResponsePresence(in List<RcsContactUceCapability> infos,
    int operationToken);
    oneway void onNotifyUpdateCapabilities(int publishTriggerType);
    oneway void onUnpublish();
    // RcsSipOptionsImplBase specific
    oneway void onCapabilityRequestResponseOptions(int code, in String reason,
            in RcsContactUceCapability info, int operationToken);
    oneway void onRemoteCapabilityRequest(in Uri contactUri, in RcsContactUceCapability remoteInfo,
            int operationToken);
}
+2 −41
Original line number Original line Diff line number Diff line
@@ -19,17 +19,16 @@ package android.telephony.ims.feature;
import android.annotation.CallbackExecutor;
import android.annotation.CallbackExecutor;
import android.annotation.IntDef;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.SystemApi;
import android.net.Uri;
import android.net.Uri;
import android.os.RemoteException;
import android.os.RemoteException;
import android.telephony.ims.RcsContactUceCapability;
import android.telephony.ims.RcsUceAdapter;
import android.telephony.ims.RcsUceAdapter;
import android.telephony.ims.aidl.ICapabilityExchangeEventListener;
import android.telephony.ims.aidl.ICapabilityExchangeEventListener;
import android.telephony.ims.aidl.IImsCapabilityCallback;
import android.telephony.ims.aidl.IImsCapabilityCallback;
import android.telephony.ims.aidl.IImsRcsFeature;
import android.telephony.ims.aidl.IImsRcsFeature;
import android.telephony.ims.aidl.IOptionsResponseCallback;
import android.telephony.ims.aidl.IOptionsResponseCallback;
import android.telephony.ims.aidl.IPublishResponseCallback;
import android.telephony.ims.aidl.IPublishResponseCallback;
import android.telephony.ims.aidl.IRcsFeatureListener;
import android.telephony.ims.aidl.ISubscribeResponseCallback;
import android.telephony.ims.aidl.ISubscribeResponseCallback;
import android.telephony.ims.aidl.RcsOptionsResponseAidlWrapper;
import android.telephony.ims.aidl.RcsOptionsResponseAidlWrapper;
import android.telephony.ims.aidl.RcsPublishResponseAidlWrapper;
import android.telephony.ims.aidl.RcsPublishResponseAidlWrapper;
@@ -74,16 +73,6 @@ public class RcsFeature extends ImsFeature {
            mExecutor = executor;
            mExecutor = executor;
        }
        }


        /**
         * @deprecated This method is deprecated. Please call the method
         * setCapabilityExchangeEventListener instead.
         */
        @Override
        @Deprecated
        public void setListener(IRcsFeatureListener listener) {
            Log.w(LOG_TAG, "The method setListener is deprecated");
        }

        @Override
        @Override
        public int queryCapabilityStatus() throws RemoteException {
        public int queryCapabilityStatus() throws RemoteException {
            return executeMethodAsyncForResult(
            return executeMethodAsyncForResult(
@@ -124,7 +113,7 @@ public class RcsFeature extends ImsFeature {
        // RcsCapabilityExchangeImplBase specific APIs
        // RcsCapabilityExchangeImplBase specific APIs
        @Override
        @Override
        public void setCapabilityExchangeEventListener(
        public void setCapabilityExchangeEventListener(
                @NonNull ICapabilityExchangeEventListener listener) throws RemoteException {
                @Nullable ICapabilityExchangeEventListener listener) throws RemoteException {
            executeMethodAsync(() -> mReference.setCapabilityExchangeEventListener(listener),
            executeMethodAsync(() -> mReference.setCapabilityExchangeEventListener(listener),
                    "setCapabilityExchangeEventListener");
                    "setCapabilityExchangeEventListener");
        }
        }
@@ -155,34 +144,6 @@ public class RcsFeature extends ImsFeature {
                    "sendOptionsCapabilityRequest");
                    "sendOptionsCapabilityRequest");
        }
        }


        // RcsPresenceExchangeImplBase specific APIS
        @Override
        public void requestCapabilities(List<Uri> uris, int operationToken) throws RemoteException {
            throw new RemoteException("Unsupported operation: requestCapabilities");
        }
        @Override
        public void updateCapabilities(RcsContactUceCapability capabilities, int operationToken)
                throws RemoteException {
            throw new RemoteException("Unsupported operation: updateCapabilities");
        }
        // RcsSipOptionsImplBase specific APIS
        @Override
        public void sendCapabilityRequest(Uri contactUri, RcsContactUceCapability capabilities,
                int operationToken) throws RemoteException {
            throw new RemoteException("Unsupported operation: sendCapabilityRequest");
        }
        @Override
        public void respondToCapabilityRequest(String contactUri,
                RcsContactUceCapability ownCapabilities, int operationToken)
                throws RemoteException {
            throw new RemoteException("Unsupported operation: respondToCapabilityRequest");
        }
        @Override
        public void respondToCapabilityRequestWithError(Uri contactUri, int code, String reason,
                int operationToken) throws RemoteException {
            throw new RemoteException("Unsupported operation: respondToCapabilityRequestWithError");
        }

        // Call the methods with a clean calling identity on the executor and wait indefinitely for
        // Call the methods with a clean calling identity on the executor and wait indefinitely for
        // the future to return.
        // the future to return.
        private void executeMethodAsync(Runnable r, String errorLogName)
        private void executeMethodAsync(Runnable r, String errorLogName)
+0 −118
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 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.telephony.ims.stub;

import android.annotation.IntDef;
import android.os.RemoteException;
import android.telephony.ims.ImsException;
import android.telephony.ims.aidl.IRcsFeatureListener;
import android.telephony.ims.feature.ImsFeature;
import android.telephony.ims.feature.RcsFeature;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Base class for different types of Capability exchange, presence using
 * {@link RcsPresenceExchangeImplBase} and SIP OPTIONS exchange using {@link RcsSipOptionsImplBase}.
 *
 * @hide
 */
public class RcsCapabilityExchange {

    /**  Service is unknown. */
    public static final int COMMAND_CODE_SERVICE_UNKNOWN = 0;
    /** The command completed successfully. */
    public static final int COMMAND_CODE_SUCCESS = 1;
    /** The command failed with an unknown error. */
    public static final int COMMAND_CODE_GENERIC_FAILURE = 2;
    /**  Invalid parameter(s). */
    public static final int COMMAND_CODE_INVALID_PARAM = 3;
    /**  Fetch error. */
    public static final int COMMAND_CODE_FETCH_ERROR = 4;
    /**  Request timed out. */
    public static final int COMMAND_CODE_REQUEST_TIMEOUT = 5;
    /**  Failure due to insufficient memory available. */
    public static final int COMMAND_CODE_INSUFFICIENT_MEMORY = 6;
    /**  Network connection is lost. */
    public static final int COMMAND_CODE_LOST_NETWORK_CONNECTION = 7;
    /**  Requested feature/resource is not supported. */
    public static final int COMMAND_CODE_NOT_SUPPORTED = 8;
    /**  Contact or resource is not found. */
    public static final int COMMAND_CODE_NOT_FOUND = 9;
    /**  Service is not available. */
    public static final int COMMAND_CODE_SERVICE_UNAVAILABLE = 10;
    /**  No Change in Capabilities */
    public static final int COMMAND_CODE_NO_CHANGE_IN_CAP = 11;

    /** @hide*/
    @Retention(RetentionPolicy.SOURCE)
    @IntDef(prefix = "COMMAND_CODE_", value = {
            COMMAND_CODE_SERVICE_UNKNOWN,
            COMMAND_CODE_SUCCESS,
            COMMAND_CODE_GENERIC_FAILURE,
            COMMAND_CODE_INVALID_PARAM,
            COMMAND_CODE_FETCH_ERROR,
            COMMAND_CODE_REQUEST_TIMEOUT,
            COMMAND_CODE_INSUFFICIENT_MEMORY,
            COMMAND_CODE_LOST_NETWORK_CONNECTION,
            COMMAND_CODE_NOT_SUPPORTED,
            COMMAND_CODE_NOT_FOUND,
            COMMAND_CODE_SERVICE_UNAVAILABLE,
            COMMAND_CODE_NO_CHANGE_IN_CAP
    })
    public @interface CommandCode {}


    private RcsFeature mFeature;

    /** @hide */
    public final void initialize(RcsFeature feature) {
        mFeature = feature;
    }

    /** @hide */
    protected final IRcsFeatureListener getListener() throws ImsException {
        throw new ImsException("This method is deprecated.",
                ImsException.CODE_ERROR_UNSUPPORTED_OPERATION);
    }

    /**
     * Provides the framework with an update as to whether or not a command completed successfully
     * locally. This includes capabilities requests and updates from the network. If it does not
     * complete successfully, then the framework may retry the command again later, depending on the
     * error. If the command does complete successfully, the framework will then wait for network
     * updates.
     *
     * @param code The result of the pending command. If {@link #COMMAND_CODE_SUCCESS}, further
     *             updates will be sent for this command using the associated operationToken.
     * @param operationToken the token associated with the pending command.
     * @throws ImsException If this {@link RcsCapabilityExchange} instance is not currently
     * connected to the framework. This can happen if the {@link RcsFeature} is not
     * {@link ImsFeature#STATE_READY} and the {@link RcsFeature} has not received the
     * {@link ImsFeature#onFeatureReady()} callback. This may also happen in rare cases when the
     * Telephony stack has crashed.
     */
    public final void onCommandUpdate(@CommandCode int code, int operationToken)
            throws ImsException {
        try {
            getListener().onCommandUpdate(code, operationToken);
        } catch (RemoteException e) {
            throw new ImsException(e.getMessage(), ImsException.CODE_ERROR_SERVICE_UNAVAILABLE);
        }
    }
}
+0 −294

File deleted.

Preview size limit exceeded, changes collapsed.

Loading