What is the purpose of InCallUI

Browse files

InCallUI: add Incoming Call Background (non-Intrusive InCall improvem…

…ent) last week, as we know we have bug with non-Intrusive Incall on Back pressed and we already fix that by disabled Back pressed while non-Intrusive InCall enabled instead disabled Back pressed, this patch introduce non-Intrusive Incall will go to background mode using Notification on Statusbar Based on SlimRoms patch https://gerrit.slimroms.net/1857 with changes to follow Intrusive Incall ps5 - allow flip actions while call is in statusbar/notification area (background) - show the navbar so devices without hardware keys can actually have the back button there Change-Id: Id9456a48fc767a7a3fe46912c7cba0d3dee93991
@@ -21,6 +21,7 @@
importandroid.content.Context;
importandroid.content.Intent;
importandroid.content.res.Configuration;
importandroid.os.UserHandle;

/**
* Top-level Application class for the InCall app.
@@ -35,6 +36,18 @@
publicstaticfinalStringACTION_HANG_UP_ONGOING_CALL=
"com.android.incallui.ACTION_HANG_UP_ONGOING_CALL";

/**
* Intent Action used for dismiss the current incoming call from Notification bar.
*/
publicstaticfinalStringACTION_DISMISS_ICOMING_CALL=
"com.android.incallui.ACTION_DISMISS_ICOMING_CALL";

/**
* Intent Action used for answer the current incoming call from Notification bar.
*/
publicstaticfinalStringACTION_ANSWER_ICOMING_CALL=
"com.android.incallui.ACTION_ANSWER_ICOMING_CALL";

publicInCallApp() {
}

@@ -64,7 +77,20 @@ public void onReceive(Context context, Intent intent) {
// CallController class that has access to CallCommandClient and
// CallList.
InCallPresenter.getInstance().hangUpOngoingCall(context);
} elseif (action.equals(ACTION_DISMISS_ICOMING_CALL)) {
CallCommandClient.getInstance().rejectCall(
CallList.getInstance().getIncomingCall(), false, null);
} elseif (action.equals(ACTION_ANSWER_ICOMING_CALL)) {
closeSystemDialogs(context);
CallCommandClient.getInstance().answerCall(
CallList.getInstance().getIncomingCall().getCallId());
InCallPresenter.getInstance().startIncomingCallUi();
}
}
}

privatestaticvoidcloseSystemDialogs(Contextcontext) {
Intent intent =newIntent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
context.sendBroadcastAsUser(intent, UserHandle.CURRENT_OR_SELF);
}
}