private VUserManagerService(Context context,VPackageManagerService pm,Object installLock,Object packagesLock,File dataDir,File baseUserPath){
  mContext=context;
  mPm=pm;
  mInstallLock=installLock;
  mPackagesLock=packagesLock;
synchronized (mInstallLock) {
synchronized (mPackagesLock) {
      mUsersDir=new File(dataDir,USER_INFO_DIR);
      mUsersDir.mkdirs();
      File userZeroDir=new File(mUsersDir,"0");
      userZeroDir.mkdirs();
      mBaseUserPath=baseUserPath;
      mUserListFile=new File(mUsersDir,USER_LIST_FILENAME);
      readUserListLocked();
      ArrayList<VUserInfo> partials=new ArrayList<VUserInfo>();
      for (int i=0; i < mUsers.size(); i++) {
        VUserInfo ui=mUsers.valueAt(i);
        if (ui.partial && i != 0) {
          partials.add(ui);
        }
      }
      for (int i=0; i < partials.size(); i++) {
        VUserInfo ui=partials.get(i);
        VLog.w(LOG_TAG,"Removing partially created user #" + i + " (name="+ ui.name+ ")");
        removeUserStateLocked(ui.id);
      }
      sInstance=this;
    }
  }
}

private VUserManagerService ( Context context , VPackageManagerService pm , Object installLock , Object packagesLock , File dataDir , File baseUserPath ) { mContext = context ; mPm = pm ; mInstallLock = installLock ; mPackagesLock = packagesLock ; synchronized ( mInstallLock ) { synchronized ( mPackagesLock ) { mUsersDir = new File ( dataDir , USER_INFO_DIR ) ; mUsersDir . mkdirs ( ) ; File userZeroDir = new File ( mUsersDir , "0" ) ; userZeroDir . mkdirs ( ) ; mBaseUserPath = baseUserPath ; mUserListFile = new File ( mUsersDir , USER_LIST_FILENAME ) ; readUserListLocked ( ) ; ArrayList < VUserInfo > partials = new ArrayList < VUserInfo > ( ) ; for ( int i = 0 ; i < mUsers . size ( ) ; i ++ ) { VUserInfo ui = mUsers . valueAt ( i ) ; if ( ui . partial && i != 0 ) { partials . add ( ui ) ; } } for ( int i = 0 ; i < partials . size ( ) ; i ++ ) { VUserInfo ui = partials . get ( i ) ; VLog . w ( LOG_TAG , "Removing partially created user #" + i + " (name=" + ui . name + ")" ) ; removeUserStateLocked ( ui . id ) ; } sInstance = this ; } } }
available for testing purposes .
