@Override
  protected void onDraw(Canvas canvas) {
    float remainingSectorSweepAngle = (float) (mPhase * 360);
    float remainingSectorStartAngle = 270 - remainingSectorSweepAngle;

    // Draw the sector/filled arc
    // We need to leave the leftmost column and the topmost row out of the drawingRect because
    // in anti-aliased mode drawArc and drawOval use these areas for some reason.

    // Just create the object once, we should prevent creating multiple objects on this function
    if (mDrawingRect == null) {
      mDrawingRect = new RectF(1, 1, getWidth() - 1, getHeight() - 1);
    }

    if (remainingSectorStartAngle < 360) {
      canvas.drawArc(
          mDrawingRect,
          remainingSectorStartAngle,
          remainingSectorSweepAngle,
          true,
          mRemainingSectorPaint);
    } else {
      // 360 degrees is equivalent to 0 degrees for drawArc, hence the drawOval below.
      canvas.drawOval(mDrawingRect, mRemainingSectorPaint);
    }
  }
Countdown phase starting with {@code 1} when a full cycle is remaining and shrinking to {@code
0} the closer the countdown is to zero.
java/com/google/android/apps/authenticator/CountdownIndicator.java