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

Commit e47d6dba authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes Ia154343c,Idff45359,Ia5ee9865

* changes:
  Internal change
  UI refresh for ringing screen.
  Ignore display cutout for in call UI.
parents 1432364e 988dac56
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@
    <item name="colorControlActivated">?android:attr/colorPrimary</item>

    <!-- Dialer specific attributes. -->
    <item name="colorIcon">?android:attr/textColorSecondary</item>
    <item name="colorIcon">@color/google_grey_400</item>
    <item name="colorIconSecondary">?android:attr/textColorSecondary</item>
    <item name="colorTextOnUnthemedDarkBackground">@android:color/white</item>
    <item name="colorIconOnUnthemedDarkBackground">@android:color/white</item>
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
  -->
<!-- The colors in this file aren't configured at the theme level. -->
<resources>
  <color name="dialer_call_green">#00C853</color>
  <color name="dialer_call_green">#34A853</color>
  <color name="dialer_end_call_button_color">#BD2A2A</color>
  <color name="dialer_divider_line_color">#D8D8D8</color>
  <color name="dialer_link_color">#2A56C6</color>
+0 −9
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.incallui;

import android.content.Context;
import android.os.SystemClock;
import android.support.annotation.FloatRange;
import android.support.annotation.NonNull;
import android.support.v4.os.UserManagerCompat;
import android.telecom.VideoProfile;
@@ -216,14 +215,6 @@ public class AnswerScreenPresenter
    }
  }

  @Override
  public void updateWindowBackgroundColor(@FloatRange(from = -1f, to = 1.0f) float progress) {
    InCallActivity activity = (InCallActivity) answerScreen.getAnswerScreenFragment().getActivity();
    if (activity != null) {
      activity.updateWindowBackgroundColor(progress);
    }
  }

  private class AnswerOnDisconnected implements DialerCallListener {

    private final DialerCall disconnectingCall;
+0 −4
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.incallui;

import android.support.annotation.FloatRange;
import com.android.incallui.answer.protocol.AnswerScreenDelegate;
import com.android.incallui.incalluilock.InCallUiLock;

@@ -49,9 +48,6 @@ public class AnswerScreenPresenterStub implements AnswerScreenDelegate {
  @Override
  public void onAnswerAndReleaseButtonDisabled() {}

  @Override
  public void updateWindowBackgroundColor(@FloatRange(from = -1f, to = 1.0f) float progress) {}

  @Override
  public boolean isActionTimeout() {
    return false;
+0 −64
Original line number Diff line number Diff line
@@ -25,12 +25,8 @@ import android.app.KeyguardManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.GradientDrawable.Orientation;
import android.os.Bundle;
import android.os.Trace;
import android.support.annotation.ColorInt;
import android.support.annotation.FloatRange;
import android.support.annotation.IntDef;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
@@ -40,7 +36,6 @@ import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.content.res.ResourcesCompat;
import android.support.v4.graphics.ColorUtils;
import android.telecom.Call;
import android.telecom.CallAudioState;
import android.telecom.PhoneAccountHandle;
@@ -137,7 +132,6 @@ public class InCallActivity extends TransactionSafeFragmentActivity
  private Animation dialpadSlideInAnimation;
  private Animation dialpadSlideOutAnimation;
  private Dialog errorDialog;
  private GradientDrawable backgroundDrawable;
  private InCallOrientationEventListener inCallOrientationEventListener;
  private View pseudoBlackScreenOverlay;
  private SelectPhoneAccountDialogFragment selectPhoneAccountDialogFragment;
@@ -156,7 +150,6 @@ public class InCallActivity extends TransactionSafeFragmentActivity
  private boolean isVisible;
  private boolean needDismissPendingDialogs;
  private boolean touchDownWhenPseudoScreenOff;
  private int[] backgroundDrawableColors;
  @DialpadRequestType private int showDialpadRequest = DIALPAD_REQUEST_NONE;
  private SpeakEasyCallManager speakEasyCallManager;
  private DialogFragment rttRequestDialogFragment;
@@ -874,11 +867,6 @@ public class InCallActivity extends TransactionSafeFragmentActivity

  public void onForegroundCallChanged(DialerCall newForegroundCall) {
    updateTaskDescription();

    if (newForegroundCall == null || !didShowAnswerScreen) {
      LogUtil.v("InCallActivity.onForegroundCallChanged", "resetting background color");
      updateWindowBackgroundColor(0 /* progress */);
    }
  }

  private void updateTaskDescription() {
@@ -892,58 +880,6 @@ public class InCallActivity extends TransactionSafeFragmentActivity
            getResources().getString(R.string.notification_ongoing_call), null /* icon */, color));
  }

  public void updateWindowBackgroundColor(@FloatRange(from = -1f, to = 1.0f) float progress) {
    ThemeColorManager themeColorManager = InCallPresenter.getInstance().getThemeColorManager();
    @ColorInt int top;
    @ColorInt int middle;
    @ColorInt int bottom;
    @ColorInt int gray = 0x66000000;

    if (isInMultiWindowMode()) {
      top = themeColorManager.getBackgroundColorSolid();
      middle = themeColorManager.getBackgroundColorSolid();
      bottom = themeColorManager.getBackgroundColorSolid();
    } else {
      top = themeColorManager.getBackgroundColorTop();
      middle = themeColorManager.getBackgroundColorMiddle();
      bottom = themeColorManager.getBackgroundColorBottom();
    }

    if (progress < 0) {
      float correctedProgress = Math.abs(progress);
      top = ColorUtils.blendARGB(top, gray, correctedProgress);
      middle = ColorUtils.blendARGB(middle, gray, correctedProgress);
      bottom = ColorUtils.blendARGB(bottom, gray, correctedProgress);
    }

    boolean backgroundDirty = false;
    if (backgroundDrawable == null) {
      backgroundDrawableColors = new int[] {top, middle, bottom};
      backgroundDrawable = new GradientDrawable(Orientation.TOP_BOTTOM, backgroundDrawableColors);
      backgroundDirty = true;
    } else {
      if (backgroundDrawableColors[0] != top) {
        backgroundDrawableColors[0] = top;
        backgroundDirty = true;
      }
      if (backgroundDrawableColors[1] != middle) {
        backgroundDrawableColors[1] = middle;
        backgroundDirty = true;
      }
      if (backgroundDrawableColors[2] != bottom) {
        backgroundDrawableColors[2] = bottom;
        backgroundDirty = true;
      }
      if (backgroundDirty) {
        backgroundDrawable.setColors(backgroundDrawableColors);
      }
    }

    if (backgroundDirty) {
      getWindow().setBackgroundDrawable(backgroundDrawable);
    }
  }

  public boolean isVisible() {
    return isVisible;
  }
Loading