Search in sources :

Example 6 with PreciseCallState

use of android.telephony.PreciseCallState in project platform_frameworks_base by android.

the class TelephonyRegistry method notifyPreciseCallState.

public void notifyPreciseCallState(int ringingCallState, int foregroundCallState, int backgroundCallState) {
    if (!checkNotifyPermission("notifyPreciseCallState()")) {
        return;
    }
    synchronized (mRecords) {
        mRingingCallState = ringingCallState;
        mForegroundCallState = foregroundCallState;
        mBackgroundCallState = backgroundCallState;
        mPreciseCallState = new PreciseCallState(ringingCallState, foregroundCallState, backgroundCallState, DisconnectCause.NOT_VALID, PreciseDisconnectCause.NOT_VALID);
        for (Record r : mRecords) {
            if (r.matchPhoneStateListenerEvent(PhoneStateListener.LISTEN_PRECISE_CALL_STATE)) {
                try {
                    r.callback.onPreciseCallStateChanged(mPreciseCallState);
                } catch (RemoteException ex) {
                    mRemoveList.add(r.binder);
                }
            }
        }
        handleRemoveListLocked();
    }
    broadcastPreciseCallStateChanged(ringingCallState, foregroundCallState, backgroundCallState, DisconnectCause.NOT_VALID, PreciseDisconnectCause.NOT_VALID);
}
Also used : PreciseCallState(android.telephony.PreciseCallState) RemoteException(android.os.RemoteException)

Example 7 with PreciseCallState

use of android.telephony.PreciseCallState in project android_frameworks_base by DirtyUnicorns.

the class TelephonyRegistry method notifyPreciseCallState.

public void notifyPreciseCallState(int ringingCallState, int foregroundCallState, int backgroundCallState) {
    if (!checkNotifyPermission("notifyPreciseCallState()")) {
        return;
    }
    synchronized (mRecords) {
        mRingingCallState = ringingCallState;
        mForegroundCallState = foregroundCallState;
        mBackgroundCallState = backgroundCallState;
        mPreciseCallState = new PreciseCallState(ringingCallState, foregroundCallState, backgroundCallState, DisconnectCause.NOT_VALID, PreciseDisconnectCause.NOT_VALID);
        for (Record r : mRecords) {
            if (r.matchPhoneStateListenerEvent(PhoneStateListener.LISTEN_PRECISE_CALL_STATE)) {
                try {
                    r.callback.onPreciseCallStateChanged(mPreciseCallState);
                } catch (RemoteException ex) {
                    mRemoveList.add(r.binder);
                }
            }
        }
        handleRemoveListLocked();
    }
    broadcastPreciseCallStateChanged(ringingCallState, foregroundCallState, backgroundCallState, DisconnectCause.NOT_VALID, PreciseDisconnectCause.NOT_VALID);
}
Also used : PreciseCallState(android.telephony.PreciseCallState) RemoteException(android.os.RemoteException)

Example 8 with PreciseCallState

use of android.telephony.PreciseCallState in project android_frameworks_base by AOSPA.

the class TelephonyRegistry method notifyDisconnectCause.

public void notifyDisconnectCause(int disconnectCause, int preciseDisconnectCause) {
    if (!checkNotifyPermission("notifyDisconnectCause()")) {
        return;
    }
    synchronized (mRecords) {
        mPreciseCallState = new PreciseCallState(mRingingCallState, mForegroundCallState, mBackgroundCallState, disconnectCause, preciseDisconnectCause);
        for (Record r : mRecords) {
            if (r.matchPhoneStateListenerEvent(PhoneStateListener.LISTEN_PRECISE_CALL_STATE)) {
                try {
                    r.callback.onPreciseCallStateChanged(mPreciseCallState);
                } catch (RemoteException ex) {
                    mRemoveList.add(r.binder);
                }
            }
        }
        handleRemoveListLocked();
    }
    broadcastPreciseCallStateChanged(mRingingCallState, mForegroundCallState, mBackgroundCallState, disconnectCause, preciseDisconnectCause);
}
Also used : PreciseCallState(android.telephony.PreciseCallState) RemoteException(android.os.RemoteException)

Example 9 with PreciseCallState

use of android.telephony.PreciseCallState in project android_frameworks_base by AOSPA.

the class TelephonyRegistry method notifyPreciseCallState.

public void notifyPreciseCallState(int ringingCallState, int foregroundCallState, int backgroundCallState) {
    if (!checkNotifyPermission("notifyPreciseCallState()")) {
        return;
    }
    synchronized (mRecords) {
        mRingingCallState = ringingCallState;
        mForegroundCallState = foregroundCallState;
        mBackgroundCallState = backgroundCallState;
        mPreciseCallState = new PreciseCallState(ringingCallState, foregroundCallState, backgroundCallState, DisconnectCause.NOT_VALID, PreciseDisconnectCause.NOT_VALID);
        for (Record r : mRecords) {
            if (r.matchPhoneStateListenerEvent(PhoneStateListener.LISTEN_PRECISE_CALL_STATE)) {
                try {
                    r.callback.onPreciseCallStateChanged(mPreciseCallState);
                } catch (RemoteException ex) {
                    mRemoveList.add(r.binder);
                }
            }
        }
        handleRemoveListLocked();
    }
    broadcastPreciseCallStateChanged(ringingCallState, foregroundCallState, backgroundCallState, DisconnectCause.NOT_VALID, PreciseDisconnectCause.NOT_VALID);
}
Also used : PreciseCallState(android.telephony.PreciseCallState) RemoteException(android.os.RemoteException)

Example 10 with PreciseCallState

use of android.telephony.PreciseCallState in project android_frameworks_base by ResurrectionRemix.

the class TelephonyRegistry method notifyDisconnectCause.

public void notifyDisconnectCause(int disconnectCause, int preciseDisconnectCause) {
    if (!checkNotifyPermission("notifyDisconnectCause()")) {
        return;
    }
    synchronized (mRecords) {
        mPreciseCallState = new PreciseCallState(mRingingCallState, mForegroundCallState, mBackgroundCallState, disconnectCause, preciseDisconnectCause);
        for (Record r : mRecords) {
            if (r.matchPhoneStateListenerEvent(PhoneStateListener.LISTEN_PRECISE_CALL_STATE)) {
                try {
                    r.callback.onPreciseCallStateChanged(mPreciseCallState);
                } catch (RemoteException ex) {
                    mRemoveList.add(r.binder);
                }
            }
        }
        handleRemoveListLocked();
    }
    broadcastPreciseCallStateChanged(mRingingCallState, mForegroundCallState, mBackgroundCallState, disconnectCause, preciseDisconnectCause);
}
Also used : PreciseCallState(android.telephony.PreciseCallState) RemoteException(android.os.RemoteException)

Aggregations

PreciseCallState (android.telephony.PreciseCallState)13 RemoteException (android.os.RemoteException)10 Parcel (android.os.Parcel)3 CallAttributes (android.telephony.CallAttributes)3 CallQuality (android.telephony.CallQuality)3 SmallTest (android.test.suitebuilder.annotation.SmallTest)3