Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1db86047 authored by wangqi's avatar wangqi Committed by android-build-merger
Browse files

Merge "Enable timer in emergency call." am: 226b01b4

am: 683e0868

Change-Id: Ib7ed49c3e67befb54ef675dcec1f3b892b9a5f36
parents 635e5a99 683e0868
Loading
Loading
Loading
Loading
+19 −12
Original line number Diff line number Diff line
@@ -212,7 +212,7 @@ public class CallCardPresenter

    // Showing the location may have been skipped if the UI wasn't ready during previous layout.
    if (shouldShowLocation()) {
      updatePrimaryDisplayInfo();
      mInCallScreen.showLocationUi(getLocationFragment());

      // Log location impressions
      if (!hasLocationPermission()) {
@@ -801,40 +801,47 @@ public class CallCardPresenter
  }

  private Fragment getLocationFragment() {
    if (!shouldShowLocation()) {
      return null;
    }
    LogUtil.i("CallCardPresenter.getLocationFragment", "returning location fragment");
    return callLocation.getLocationFragment(mContext);
  }

  private boolean shouldShowLocation() {
    if (!ConfigProviderBindings.get(mContext)
        .getBoolean(CONFIG_ENABLE_EMERGENCY_LOCATION, CONFIG_ENABLE_EMERGENCY_LOCATION_DEFAULT)) {
      LogUtil.i("CallCardPresenter.getLocationFragment", "disabled by config.");
      return null;
      return false;
    }
    if (!shouldShowLocation()) {
    if (!isPotentialEmergencyCall()) {
      LogUtil.i("CallCardPresenter.getLocationFragment", "shouldn't show location");
      return null;
      return false;
    }
    if (!hasLocationPermission()) {
      LogUtil.i("CallCardPresenter.getLocationFragment", "no location permission.");
      return null;
      return false;
    }
    if (isBatteryTooLowForEmergencyLocation()) {
      LogUtil.i("CallCardPresenter.getLocationFragment", "low battery.");
      return null;
      return false;
    }
    if (ActivityCompat.isInMultiWindowMode(mInCallScreen.getInCallScreenFragment().getActivity())) {
      LogUtil.i("CallCardPresenter.getLocationFragment", "in multi-window mode");
      return null;
      return false;
    }
    if (mPrimary.isVideoCall()) {
      LogUtil.i("CallCardPresenter.getLocationFragment", "emergency video calls not supported");
      return null;
      return false;
    }
    if (!callLocation.canGetLocation(mContext)) {
      LogUtil.i("CallCardPresenter.getLocationFragment", "can't get current location");
      return null;
      return false;
    }
    LogUtil.i("CallCardPresenter.getLocationFragment", "returning location fragment");
    return callLocation.getLocationFragment(mContext);
    return true;
  }

  private boolean shouldShowLocation() {
  private boolean isPotentialEmergencyCall() {
    if (isOutgoingEmergencyCall(mPrimary)) {
      LogUtil.i("CallCardPresenter.shouldShowLocation", "new emergency call");
      return true;
+3 −1
Original line number Diff line number Diff line
@@ -694,6 +694,8 @@ public class AnswerFragment extends Fragment
    updateImportanceBadgeVisibility();

    contactGridManager = new ContactGridManager(view, null, 0, false /* showAnonymousAvatar */);
    boolean isInMultiWindowMode = ActivityCompat.isInMultiWindowMode(getActivity());
    contactGridManager.onMultiWindowModeChanged(isInMultiWindowMode);

    Fragment answerMethod =
        getChildFragmentManager().findFragmentById(R.id.answer_method_container);
@@ -712,7 +714,7 @@ public class AnswerFragment extends Fragment
    initSecondaryButton();

    int flags = View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
    if (!ActivityCompat.isInMultiWindowMode(getActivity())
    if (!isInMultiWindowMode
        && (getActivity().checkSelfPermission(permission.STATUS_BAR)
            == PackageManager.PERMISSION_GRANTED)) {
      LogUtil.i("AnswerFragment.onCreateView", "STATUS_BAR permission granted, disabling nav bar");
+5 −0
Original line number Diff line number Diff line
@@ -131,6 +131,11 @@
          android:layout_width="match_parent"
          android:layout_height="wrap_content"/>

      <include
          layout="@layout/device_number_row"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"/>

      <FrameLayout
          android:id="@+id/incall_data_container"
          android:layout_width="match_parent"
+90 −91
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="16dp"
  android:layout_marginBottom="16dp"
    android:background="@drawable/bg_location_card"
    android:elevation="2dp"
    android:inAnimation="@android:anim/fade_in"
+0 −4
Original line number Diff line number Diff line
@@ -97,10 +97,6 @@ public class BottomRow {
      if (TextUtils.isEmpty(label)) {
        label = context.getString(R.string.incall_call_ended);
      }
    } else if (!TextUtils.isEmpty(state.callbackNumber)) {
      // This is used for carriers like Project Fi to show the callback number for emergency calls.
      label = context.getString(R.string.contact_grid_callback_number, state.callbackNumber);
      isTimerVisible = false;
    } else {
      label = getLabelForPhoneNumber(primaryInfo);
      shouldPopulateAccessibilityEvent = primaryInfo.nameIsNumber;
Loading