code: private void updateProgressBars(int value) {
          ProgressBar circularProgressBar = getCircularProgressBar();
          ProgressBar horizontalProgressBar = getHorizontalProgressBar();
  
          if (value == Window.PROGRESS_VISIBILITY_ON) {
              if (mFeatureProgress) {
                  int level = horizontalProgressBar.getProgress();
                  int visibility = (horizontalProgressBar.isIndeterminate() || level < 10000) ?
                          View.VISIBLE : View.INVISIBLE;
                  horizontalProgressBar.setVisibility(visibility);
              }
              if (mFeatureIndeterminateProgress) {
                  circularProgressBar.setVisibility(View.VISIBLE);
              }
          } else if (value == Window.PROGRESS_VISIBILITY_OFF) {
              if (mFeatureProgress) {
                  horizontalProgressBar.setVisibility(View.GONE);
              }
              if (mFeatureIndeterminateProgress) {
                  circularProgressBar.setVisibility(View.GONE);
              }
          } else if (value == Window.PROGRESS_INDETERMINATE_ON) {
              horizontalProgressBar.setIndeterminate(true);
          } else if (value == Window.PROGRESS_INDETERMINATE_OFF) {
              horizontalProgressBar.setIndeterminate(false);
          } else if (Window.PROGRESS_START <= value && value <= Window.PROGRESS_END) {
              // We want to set the progress value before testing for visibility
              // so that when the progress bar becomes visible again, it has the
              // correct level.
              horizontalProgressBar.setProgress(value - Window.PROGRESS_START);
  
              if (value < Window.PROGRESS_END) {
                  showProgressBars(horizontalProgressBar, circularProgressBar);
              } else {
                  hideProgressBars(horizontalProgressBar, circularProgressBar);
              }
          }
      }
docs: Progress Bar function. Mostly extracted from PhoneWindow.java