这个是早期客制化需求 , 当时我记得是需要拨号的同时需要禁止系统通话被拉起 , 意思就是
电话过来了, 不能显示UI的同时还在通话 , 然后我做个了自定义的APP去控制通话。
这个修改主要是在Dialer应用的几个文件中修改了一些函数的逻辑,使得在特定条件下,不再显示拨号界面或者通知。
修改的文件:
- vendor/mediatek/proprietary/packages/apps/Dialer/java/com/android/incallui/InCallActivity.java
- vendor/mediatek/proprietary/packages/apps/Dialer/java/com/android/incallui/InCallPresenter.java
- vendor/mediatek/proprietary/packages/apps/Dialer/java/com/android/incallui/StatusBarNotifier.java
文件修改说明:
1. InCallActivity.java
在这个文件中,修改了getIntent
函数的逻辑。原先的逻辑是根据传入的参数来设置Intent的一些属性。现在的逻辑是,直接设置了一些固定的属性值。
2. InCallPresenter.java
在这个文件中,修改了几个函数的逻辑。原先的逻辑是在满足一定条件时,显示拨号界面。现在的逻辑是,注释掉了显示拨号界面的代码,使得在满足条件时,不再显示拨号界面。
3. StatusBarNotifier.java
在这个文件中,修改了updateInCallNotification
函数的逻辑。原先的逻辑是在满足一定条件时,显示通知。现在的逻辑是,注释掉了显示通知的代码,使得在满足条件时,不再显示通知。
--- .../java/com/android/incallui/InCallActivity.java | 2 +- .../java/com/android/incallui/InCallPresenter.java | 10 +++++----- .../java/com/android/incallui/StatusBarNotifier.java | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/vendor/mediatek/proprietary/packages/apps/Dialer/java/com/android/incallui/InCallActivity.java b/vendor/mediatek/proprietary/packages/apps/Dialer/java/com/android/incallui/InCallActivity.java index 0c56bdb28be..f1932d6b836 100755 --- a/vendor/mediatek/proprietary/packages/apps/Dialer/java/com/android/incallui/InCallActivity.java +++ b/vendor/mediatek/proprietary/packages/apps/Dialer/java/com/android/incallui/InCallActivity.java @@ -103,7 +103,7 @@ public class InCallActivity extends TransactionSafeFragmentActivity Intent intent = new Intent(Intent.ACTION_MAIN, null); intent.setFlags(Intent.FLAG_ACTIVITY_NO_USER_ACTION | Intent.FLAG_ACTIVITY_NEW_TASK); intent.setClass(context, InCallActivity.class); - InCallActivityCommon.setIntentExtras(intent, showDialpad, newOutgoingCall, isForFullScreen); + InCallActivityCommon.setIntentExtras(intent, false, newOutgoingCall, false); return intent; } diff --git a/vendor/mediatek/proprietary/packages/apps/Dialer/java/com/android/incallui/InCallPresenter.java b/vendor/mediatek/proprietary/packages/apps/Dialer/java/com/android/incallui/InCallPresenter.java index 013b1055280..e8ba1439a06 100755 --- a/vendor/mediatek/proprietary/packages/apps/Dialer/java/com/android/incallui/InCallPresenter.java +++ b/vendor/mediatek/proprietary/packages/apps/Dialer/java/com/android/incallui/InCallPresenter.java @@ -1271,7 +1271,7 @@ public class InCallPresenter implements CallList.Listener { // present (e.g. a call was accepted by a bluetooth or wired headset), we want to // bring it up the UI regardless. if (!isShowingInCallUi() && mInCallState != InCallState.NO_CALLS) { - showInCall(showDialpad, false /* newOutgoingCall */); + //showInCall(showDialpad, false /* newOutgoingCall */); } /// M: For CR ALPS02853151. Dismiss add member screen while return to InCall.@{ else if (AddMemberScreenController.getInstance().IsAddMemberScreenShown()) { @@ -1571,8 +1571,8 @@ public class InCallPresenter implements CallList.Listener { } if (showCallUi || showAccountPicker) { - LogUtil.i("InCallPresenter.startOrFinishUi", "Start in call UI"); - showInCall(false /* showDialpad */, !showAccountPicker /* newOutgoingCall */); + LogUtil.i("InCallPresenter.startOrFinishUi", "leon Start in call UI"); + // showInCall(false /* showDialpad */, !showAccountPicker /* newOutgoingCall */); } else if (startIncomingCallSequence) { LogUtil.i("InCallPresenter.startOrFinishUi", "Start Full Screen in call UI"); @@ -1744,7 +1744,7 @@ public class InCallPresenter implements CallList.Listener { final Intent activityIntent = InCallActivity.getIntent(mContext, false, true, false /* forFullScreen */); activityIntent.putExtra(TouchPointManager.TOUCH_POINT, touchPoint); - mContext.startActivity(activityIntent); + //mContext.startActivity(activityIntent); } /** @@ -2297,7 +2297,7 @@ public class InCallPresenter implements CallList.Listener { return false; } else { Log.i(this, "show InCallActivity for waiting call"); - showInCall(false, false); + //showInCall(false, false); } } else { mStatusBarNotifier.updateNotification(mCallList); diff --git a/vendor/mediatek/proprietary/packages/apps/Dialer/java/com/android/incallui/StatusBarNotifier.java b/vendor/mediatek/proprietary/packages/apps/Dialer/java/com/android/incallui/StatusBarNotifier.java index 59ddfe2bb0f..dd1c5d5af9b 100755 --- a/vendor/mediatek/proprietary/packages/apps/Dialer/java/com/android/incallui/StatusBarNotifier.java +++ b/vendor/mediatek/proprietary/packages/apps/Dialer/java/com/android/incallui/StatusBarNotifier.java @@ -258,14 +258,14 @@ public class StatusBarNotifier */ @RequiresPermission(Manifest.permission.READ_PHONE_STATE) private void updateInCallNotification(CallList callList) { - LogUtil.d("StatusBarNotifier.updateInCallNotification", ""); + LogUtil.d("StatusBarNotifier.updateInCallNotification", "updateInCallNotification call"); final DialerCall call = getCallToShow(callList); if (call != null) { - showNotification(callList, call); + // showNotification(callList, call); } else { - cancelNotification(); + // cancelNotification(); } /// M: add for OP02 plugin. @{ -- 2.29.0