use of android.telephony.PreciseCallState in project android_frameworks_base by crdroidandroid.
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);
}
use of android.telephony.PreciseCallState in project android_frameworks_base by crdroidandroid.
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);
}
use of android.telephony.PreciseCallState in project android_frameworks_opt_telephony by LineageOS.
the class CallAttributesTest method testParcelUnparcelCallQuality.
@SmallTest
public void testParcelUnparcelCallQuality() {
CallQuality quality = new CallQuality();
PreciseCallState pcs = new PreciseCallState();
CallAttributes data = new CallAttributes(pcs, 10, quality);
Parcel parcel = Parcel.obtain();
data.writeToParcel(parcel, 0);
parcel.setDataPosition(0);
CallAttributes unparceledData = CallAttributes.CREATOR.createFromParcel(parcel);
parcel.recycle();
assertEquals("CallQuality is not equal after parceled/unparceled", data.getCallQuality(), unparceledData.getCallQuality());
}
Aggregations