예제 #1
0
 public static GeckoProfile createGuestProfile(Context context) {
   try {
     removeGuestProfile(context);
     // We need to force the creation of a new guest profile if we want it outside of the normal
     // profile path,
     // otherwise GeckoProfile.getDir will try to be smart and build it for us in the normal
     // profiles dir.
     getGuestDir(context).mkdir();
     GeckoProfile profile = getGuestProfile(context);
     profile.lock();
     return profile;
   } catch (Exception ex) {
     Log.e(LOGTAG, "Error creating guest profile", ex);
   }
   return null;
 }
예제 #2
0
  public static GeckoProfile createGuestProfile(Context context) {
    try {
      removeGuestProfile(context);
      // We need to force the creation of a new guest profile if we want it outside of the normal
      // profile path,
      // otherwise GeckoProfile.getDir will try to be smart and build it for us in the normal
      // profiles dir.
      getGuestDir(context).mkdir();
      GeckoProfile profile = getGuestProfile(context);
      profile.lock();

      /*
       * Now do the things that createProfileDirectory normally does --
       * right now that's kicking off DB init.
       */
      profile.enqueueInitialization();

      return profile;
    } catch (Exception ex) {
      Log.e(LOGTAG, "Error creating guest profile", ex);
    }
    return null;
  }