Android8.1 MTK platform Dialer modified (full screen calls, displaying attribution)

Calls default fullscreen

By default, the form calls android notification window is displayed, only the top of the screen display, is now full screen

Modify Location

alps\vendor\mediatek\proprietary\packages\apps\Dialer\java\com\android\incallui\InCallPresenter.java

private boolean startUi(InCallState inCallState) {
      boolean isCallWaiting = mCallList.getActiveOrBackgroundCall() != null &&
              mCallList.getIncomingCall() != null;
        Log.e(this, "isCallWaiting=="+isCallWaiting + "  inCallState="+inCallState);
        Log.i(this, "  isIncoming="+inCallState.isIncoming());

      // If the screen is off, we need to make sure it gets turned on for incoming calls.
      // This normally works just fine thanks to FLAG_TURN_SCREEN_ON but that only works
      // when the activity is first created. Therefore, to ensure the screen is turned on
      // for the call waiting case, we finish() the current activity and start a new one.
      // There should be no jank from this since the screen is already off and will remain so
      // until our new activity is up.
      if (isCallWaiting) {
          if (mProximitySensor.isScreenReallyOff() && isActivityStarted()) {
              Log.i(this, "Restarting InCallActivity to turn screen on for call waiting");
              mInCallActivity.finish();
              return false;
          } else {
              Log.i(this, "show InCallActivity for waiting call");
              showInCall(false, false);
          }
      } else {
           ////cczheng add show Full Screen in call UI replace incall notification  
          //mStatusBarNotifier.updateNotification(mCallList);
          mContext.startActivity(InCallActivity.getIntent(
                    mContext, false/*showDialpad*/, false/*newOutgoingCall*/, true /* forFullScreen */));
      }
      return true;
   }

Will replace updateNotification way to start InCallActivity

When contact has been saved calls, an increase of attribution show

android original home display conditions, when the caller's number is not stored for a contact, that is, the page is displayed as caller number, the number will be displayed below the electric attribution

When the number has been saved as a contact, call the contact page displays the name, does not show calls attribution. Demand, the contact situation but also show calls attribution.

Process calls back home will introduce separate queries, this can look at the number identifying the home phone application -Android

14390242-94364c531d64f42d
image

Renderings

Modify Location

1、alps\vendor\mediatek\proprietary\packages\apps\Dialer\java\com\android\incallui\CallerInfoAsyncQuery.java

    void updateData(int token, Object cookie, Cursor cursor) {
    .....
    if (true/*TextUtils.isEmpty(mCallerInfo.name)*/) {//cczheng change true
        // Actually when no contacts match the incoming phone number,
        // the CallerInfo object is totally blank here (i.e. no name
        // *or* phoneNumber).  So we need to pass in cw.number as
        // a fallback number.
        mCallerInfo.updateGeoDescription(mQueryContext, cw.number);
     
    }
    ......
}

Case number and the name of the query go home

2、alps\vendor\mediatek\proprietary\packages\apps\Dialer\java\com\android\incallui\CallCardPresenter.java

private void updatePrimaryDisplayInfo() {

......

mInCallScreen.setPrimary(
      new PrimaryInfo(
          number,
          mPrimary.updateNameIfRestricted(name),
          nameIsNumber,
          shouldShowLocationAsLabel(nameIsNumber, mPrimaryContactInfo.shouldShowLocation)
              ? mPrimaryContactInfo.location
              : number + "\n" + mPrimaryContactInfo.location/*null*/,/*cczheng change null to locationlabel*/
          isChildNumberShown || isCallSubjectShown ? null : mPrimaryContactInfo.label,
          mPrimaryContactInfo.photo,
          mPrimaryContactInfo.photoType,
          mPrimaryContactInfo.isSipCall,
          showContactPhoto,
          hasWorkCallProperty || isWorkContact,
          mPrimary.isSpam(),
          mPrimary.answeringDisconnectsForegroundVideoCall(),
          shouldShowLocation(),
          mPrimaryContactInfo.lookupKey,
          multimediaData,
          mPrimary.getNumberPresentation()));
.....
}

The original number is null and alternative splicing home, \ n shown with a line

3、alps\vendor\mediatek\proprietary\packages\apps\Dialer\java\com\android\incallui\contactgrid\res\layout\incall_contactgrid_bottom_row.xml

The id of the contactgrid_forwardNumber and contactgrid_bottom_text android: singleLine = "true" to false, to wrap the display

Modify these three places recompile Dialer, push to see the effect ok

Reproduced in: https: //www.jianshu.com/p/f83f27c15b1c

Guess you like

Origin blog.csdn.net/weixin_34419321/article/details/91232611