protected void setDisabledFlags(int disabledFlags, boolean force) {
    if (!force && mDisabledFlags == disabledFlags) return;

    mDisabledFlags = disabledFlags;

    final boolean disableHome = ((disabledFlags & View.STATUS_BAR_DISABLE_HOME) != 0);
    final boolean disableRecent = ((disabledFlags & View.STATUS_BAR_DISABLE_RECENT) != 0);
    final boolean disableBack =
        ((disabledFlags & View.STATUS_BAR_DISABLE_BACK) != 0)
            && ((mNavigationIconHints & StatusBarManager.NAVIGATION_HINT_BACK_ALT) == 0);

    PieItem item;
    for (int j = 0; j < 2; j++) {
      item = findItem(ActionConstants.ACTION_BACK, j);
      if (item != null) {
        item.show(!disableBack);
      }
      item = findItem(ActionConstants.ACTION_HOME, j);
      if (item != null) {
        item.show(!disableHome);
        // If the homebutton exists we can assume that the keyguard
        // search button exists as well.
        item = findItem(ActionConstants.ACTION_KEYGUARD_SEARCH, j);
        item.show(disableHome);
      }
      item = findItem(ActionConstants.ACTION_RECENTS, j);
      if (item != null) {
        item.show(!disableRecent);
      }
    }
    setMenuVisibility(mShowMenu, true);
  }
  protected void setNavigationIconHints(int hints, boolean force) {
    if (!force && hints == mNavigationIconHints) return;

    if (DEBUG) Slog.v(TAG, "Pie navigation hints: " + hints);

    mNavigationIconHints = hints;
    PieItem item;

    for (int j = 0; j < 2; j++) {
      item = findItem(ActionConstants.ACTION_BACK, j);
      if (item != null) {
        boolean isAlt = (hints & StatusBarManager.NAVIGATION_HINT_BACK_ALT) != 0;
        item.setImageDrawable(isAlt ? mBackAltIcon : mBackIcon);
      }
    }
    setDisabledFlags(mDisabledFlags, true);
  }
 private PieItem constructItem(
     int width, String clickAction, String longPressAction, String iconUri, int minimumImageSize) {
   ImageView view = new ImageView(mContext);
   int iconType = setPieItemIcon(view, iconUri, clickAction);
   view.setMinimumWidth(minimumImageSize);
   view.setMinimumHeight(minimumImageSize);
   LayoutParams lp = new LayoutParams(minimumImageSize, minimumImageSize);
   view.setLayoutParams(lp);
   PieItem item =
       new PieItem(
           mContext, mPieContainer, 0, width, clickAction, longPressAction, view, iconType);
   item.setOnClickListener(this);
   if (!longPressAction.equals(ActionConstants.ACTION_NULL)) {
     item.setOnLongClickListener(this);
   }
   return item;
 }
 private void setMenuVisibility(boolean showMenu, boolean force) {
   if (!force && mShowMenu == showMenu) {
     return;
   }
   if (mMenuButton != null) {
     final boolean disableRecent = ((mDisabledFlags & View.STATUS_BAR_DISABLE_RECENT) != 0);
     mMenuButton.show(
         (showMenu || mShowMenuVisibility == MENU_VISIBILITY_ALWAYS)
             && mShowMenuVisibility != MENU_VISIBILITY_NEVER
             && !disableRecent);
   }
   mShowMenu = showMenu;
 }