use of android.telephony.PreciseCallState in project android_frameworks_base by ResurrectionRemix.
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_base by DirtyUnicorns.
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 platform_frameworks_base by android.
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_opt_telephony by LineageOS.
the class CallAttributesTest method testParcelUnparcelPreciseCallState.
@SmallTest
public void testParcelUnparcelPreciseCallState() {
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("PreciseCallState is not equal after parceled/unparceled", data.getPreciseCallState(), unparceledData.getPreciseCallState());
}
use of android.telephony.PreciseCallState in project android_frameworks_opt_telephony by LineageOS.
the class CallAttributesTest method testParcelUnparcelNetworkType.
@SmallTest
public void testParcelUnparcelNetworkType() {
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("NetworkType is not equal after parceled/unparceled", data.getNetworkType(), unparceledData.getNetworkType());
}
Aggregations