mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 906030 - Part 1: Don't always create the guest profile at startup. r=wesj
This commit is contained in:
parent
bc9b0f4103
commit
8341c442fa
@ -171,23 +171,24 @@ public final class GeckoProfile {
|
||||
private static GeckoProfile getGuestProfile(Context context) {
|
||||
if (mGuestProfile == null) {
|
||||
File guestDir = getGuestDir(context);
|
||||
mGuestProfile = get(context, "guest", guestDir);
|
||||
mGuestProfile.mInGuestMode = true;
|
||||
if (guestDir.exists()) {
|
||||
mGuestProfile = get(context, "guest", guestDir);
|
||||
mGuestProfile.mInGuestMode = true;
|
||||
}
|
||||
}
|
||||
|
||||
return mGuestProfile;
|
||||
}
|
||||
|
||||
public static boolean maybeCleanupGuestProfile(final Context context) {
|
||||
// Don't use profile.getDir() here, so that we don't accidently create the dir
|
||||
File guestDir = getGuestDir(context);
|
||||
if (!guestDir.exists()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final GeckoProfile profile = getGuestProfile(context);
|
||||
if (!profile.locked()) {
|
||||
// if the guest dir exists, but its unlocked, delete it
|
||||
|
||||
if (profile == null) {
|
||||
return false;
|
||||
} else if (!profile.locked()) {
|
||||
profile.mInGuestMode = false;
|
||||
|
||||
// If the guest dir exists, but it's unlocked, delete it
|
||||
ThreadUtils.postToBackgroundThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
Loading…
Reference in New Issue
Block a user