void restoreState(Bundle inState,long currentId,boolean restoreIncognitoTabs,boolean restoreAll){
  if (currentId == -1) {
    return;
  }
  long[] ids=inState.getLongArray(POSITIONS);
  long maxId=-Long.MAX_VALUE;
  HashMap<Long,Tab> tabMap=new HashMap<Long,Tab>();
  for (  long id : ids) {
    if (id > maxId) {
      maxId=id;
    }
    final String idkey=Long.toString(id);
    Bundle state=inState.getBundle(idkey);
    if (state == null || state.isEmpty()) {
      continue;
    }
 else     if (!restoreIncognitoTabs && state.getBoolean(Tab.INCOGNITO)) {
    }
 else     if (id == currentId || restoreAll) {
      Tab t=null;
      if (state.getLong(SnapshotTab.SNAPSHOT_ID,-1) != -1) {
        t=(SnapshotTab)createSnapshotTab(state.getLong(SnapshotTab.SNAPSHOT_ID),state);
      }
 else {
        t=createNewTab(state,false);
      }
      if (t == null) {
        continue;
      }
      tabMap.put(id,t);
      if (id == currentId) {
        setCurrentTab(t);
      }
    }
 else {
      Tab t=new Tab(mController,state);
      tabMap.put(id,t);
      mTabs.add(t);
      mTabCountObservable.set(mTabs.size());
      mTabQueue.add(0,t);
    }
  }
  sNextId=maxId + 1;
  if (mCurrentTab == -1) {
    if (getTabCount() > 0) {
      setCurrentTab(getTab(0));
    }
  }
  for (  long id : ids) {
    final Tab tab=tabMap.get(id);
    final Bundle b=inState.getBundle(Long.toString(id));
    if ((b != null) && (tab != null)) {
      final long parentId=b.getLong(Tab.PARENTTAB,-1);
      if (parentId != -1) {
        final Tab parent=tabMap.get(parentId);
        if (parent != null) {
          parent.addChildTab(tab);
        }
      }
    }
  }
}

void restoreState ( Bundle inState , long currentId , boolean restoreIncognitoTabs , boolean restoreAll ) { if ( currentId == - 1 ) { return ; } long [ ] ids = inState . getLongArray ( POSITIONS ) ; long maxId = - Long . MAX_VALUE ; HashMap < Long , Tab > tabMap = new HashMap < Long , Tab > ( ) ; for ( long id : ids ) { if ( id > maxId ) { maxId = id ; } final String idkey = Long . toString ( id ) ; Bundle state = inState . getBundle ( idkey ) ; if ( state == null || state . isEmpty ( ) ) { continue ; } else if ( ! restoreIncognitoTabs && state . getBoolean ( Tab . INCOGNITO ) ) { } else if ( id == currentId || restoreAll ) { Tab t = null ; if ( state . getLong ( SnapshotTab . SNAPSHOT_ID , - 1 ) != - 1 ) { t = ( SnapshotTab ) createSnapshotTab ( state . getLong ( SnapshotTab . SNAPSHOT_ID ) , state ) ; } else { t = createNewTab ( state , false ) ; } if ( t == null ) { continue ; } tabMap . put ( id , t ) ; if ( id == currentId ) { setCurrentTab ( t ) ; } } else { Tab t = new Tab ( mController , state ) ; tabMap . put ( id , t ) ; mTabs . add ( t ) ; mTabCountObservable . set ( mTabs . size ( ) ) ; mTabQueue . add ( 0 , t ) ; } } sNextId = maxId + 1 ; if ( mCurrentTab == - 1 ) { if ( getTabCount ( ) > 0 ) { setCurrentTab ( getTab ( 0 ) ) ; } } for ( long id : ids ) { final Tab tab = tabMap . get ( id ) ; final Bundle b = inState . getBundle ( Long . toString ( id ) ) ; if ( ( b != null ) && ( tab != null ) ) { final long parentId = b . getLong ( Tab . PARENTTAB , - 1 ) ; if ( parentId != - 1 ) { final Tab parent = tabMap . get ( parentId ) ; if ( parent != null ) { parent . addChildTab ( tab ) ; } } } } }
restore the state of all the tabs .
