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

Commit 14816d66 authored by Santos Cordon's avatar Santos Cordon
Browse files

Remove methods added in TelephonyManager.

Change-Id: I771502ab76dfc24eb19b9ff58b029bea45d6832c
parent 4455f54b
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -324,7 +324,6 @@ LOCAL_SRC_FILES += \
	telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl \
	telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \
	telephony/java/com/android/internal/telephony/ITelephony.aidl \
	telephony/java/com/android/internal/telephony/ITelephonyListener.aidl \
	telephony/java/com/android/internal/telephony/IThirdPartyCallListener.aidl \
	telephony/java/com/android/internal/telephony/IThirdPartyCallProvider.aidl \
	telephony/java/com/android/internal/telephony/IThirdPartyCallSendDtmfCallback.aidl \
+0 −36
Original line number Diff line number Diff line
/*
 * Copyright (C) 2014 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;

import android.annotation.PrivateApi;

/** @hide */
@PrivateApi
public interface CallStateListener {
    /**
     * Notify of a new or updated call.
     * Any time the state of a call is updated, it will alert any listeners. This includes changes
     * of state such as when a call is put on hold or conferenced.
     *
     * @param callId a unique ideCntifier for a given call that can be used to track state changes
     * @param state the new state of the call.
     *              {@see com.android.services.telephony.common.Call$State}
     * @param number the phone number of the call. For some states, this may be blank. However, it
     *               will be populated for any initial state.
     */
    public void onCallStateChanged(int callId, int state, String number);
}
+0 −124
Original line number Diff line number Diff line
@@ -82,40 +82,8 @@ public class TelephonyManager {
        static final int NEVER_USE = 2;
    }

    private final HashMap<CallStateListener,Listener> mListeners
            = new HashMap<CallStateListener,Listener>();
    private final Context mContext;

    private static class Listener extends ITelephonyListener.Stub {
        final CallStateListener mListener;
        private static final int WHAT = 1;

        private Handler mHandler = new Handler() {
            @Override
            public void handleMessage(Message msg) {
                mListener.onCallStateChanged(msg.arg1, msg.arg2, (String)msg.obj);
            }
        };

        Listener(CallStateListener listener) {
            mListener = listener;
        }

        @Override
        public void onUpdate(final int callId, final int state, final String number) {
            if (mHandler != null) {
                mHandler.sendMessage(mHandler.obtainMessage(WHAT, callId, state, number));
            }
        }

        void clearQueue() {
            mHandler.removeMessages(WHAT);

            // Don't accept more incoming binder calls either.
            mHandler = null;
        }
    }

    /** @hide */
    public TelephonyManager(Context context) {
        Context appContext = context.getApplicationContext();
@@ -2014,46 +1982,6 @@ public class TelephonyManager {
        }
    }

    /** @hide */
    @PrivateApi
    public void toggleHold() {
        try {
            getITelephony().toggleHold();
        } catch (RemoteException e) {
            Log.e(TAG, "Error calling ITelephony#toggleHold", e);
        }
    }

    /** @hide */
    @PrivateApi
    public void merge() {
        try {
            getITelephony().merge();
        } catch (RemoteException e) {
            Log.e(TAG, "Error calling ITelephony#merge", e);
        }
    }

    /** @hide */
    @PrivateApi
    public void swap() {
        try {
            getITelephony().swap();
        } catch (RemoteException e) {
            Log.e(TAG, "Error calling ITelephony#swap", e);
        }
    }

    /** @hide */
    @PrivateApi
    public void mute(boolean mute) {
        try {
            getITelephony().mute(mute);
        } catch (RemoteException e) {
            Log.e(TAG, "Error calling ITelephony#mute", e);
        }
    }

    /** @hide */
    @PrivateApi
    public void silenceRinger() {
@@ -2291,56 +2219,4 @@ public class TelephonyManager {
        }
        return false;
    }

    /** @hide */
    @PrivateApi
    public void playDtmfTone(char digit, boolean timedShortCode) {
        try {
            getITelephony().playDtmfTone(digit, timedShortCode);
        } catch (RemoteException e) {
            Log.e(TAG, "Error calling ITelephony#playDtmfTone", e);
        }
    }

    /** @hide */
    @PrivateApi
    public void stopDtmfTone() {
        try {
            getITelephony().stopDtmfTone();
        } catch (RemoteException e) {
            Log.e(TAG, "Error calling ITelephony#stopDtmfTone", e);
        }
    }

    /** @hide */
    @PrivateApi
    public void addCallStateListener(CallStateListener listener) {
        try {
            if (listener == null) {
                throw new RuntimeException("Listener can't be null");
            }
            if (!mListeners.containsKey(listener)) {
                final Listener l = new Listener(listener);
                mListeners.put(listener, l);
                getITelephony().addListener(l);
            }
        } catch (RemoteException e) {
            Log.e(TAG, "Error calling ITelephony#addListener", e);
        }
    }

    /** @hide */
    @PrivateApi
    public void removeCallStateListener(CallStateListener listener) {
        try {
            final Listener l = mListeners.remove(listener);
            if (l != null) {
                // Make sure that no callbacks that are already in flight come.
                l.clearQueue();
                getITelephony().removeListener(l);
            }
        } catch (RemoteException e) {
            Log.e(TAG, "Error calling ITelephony#removeListener", e);
        }
    }
}
+0 −45
Original line number Diff line number Diff line
@@ -21,8 +21,6 @@ import android.os.Bundle;
import android.telephony.CellInfo;
import android.telephony.NeighboringCellInfo;

import com.android.internal.telephony.ITelephonyListener;

import java.util.List;

import java.util.List;
@@ -426,47 +424,4 @@ interface ITelephony {
     * @return true on success; false on any failure.
     */
    boolean setPreferredNetworkType(int networkType);

    /**
     * Put a call on hold.
     */
     void toggleHold();

     /**
      * Merge foreground and background calls.
      */
     void merge();

     /**
      * Swap foreground and background calls.
      */
     void swap();

     /**
      * Mute the phone.
      */
     void mute(boolean mute);

    /**
     * Start playing DTMF tone for the specified digit.
     *
     * @param digit the digit that corresponds with the desired tone.
     * @param timedShortcode whether the specified digit should be played as a timed short code.
     */
     void playDtmfTone(char digit, boolean timedShortCode);

     /**
      * Stop playing DTMF tones.
      */
     void stopDtmfTone();

     /**
       * Register a callback.
       */
      void addListener(ITelephonyListener listener);

      /**
       * Unregister a callback.
       */
      void removeListener(ITelephonyListener listener);
}
+0 −27
Original line number Diff line number Diff line
/*
 * Copyright (C) 2014 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 com.android.internal.telephony;

/**
 * Interface used to register a listener that gets more detailed call state information than
 * {@link android.telephony.PhoneStateListener}
 *
 * {@hide}
 */
oneway interface ITelephonyListener {
    void onUpdate(int callId, int state, String number);
}