Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
[Android] Fix AccountStore.Delete
Browse files Browse the repository at this point in the history
Fixes #43
  • Loading branch information
ermau committed Aug 23, 2013
1 parent b43fea8 commit 6c763f7
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/Xamarin.Auth.Android/AndroidAccountStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,24 @@ public override void Save (Account account, string serviceId)
var entry = new KeyStore.SecretKeyEntry (secretKey);
ks.SetEntry (alias, entry, prot);

lock (fileLock) {
using (var s = context.OpenFileOutput (FileName, FileCreationMode.Private)) {
ks.Store (s, Password);
}
}
Save();
}

public override void Delete (Account account, string serviceId)
{
var alias = MakeAlias (account, serviceId);

ks.DeleteEntry (alias);
Save();
}

void Save()
{
lock (fileLock) {
using (var s = context.OpenFileOutput (FileName, FileCreationMode.Private)) {
ks.Store (s, Password);
}
}
}

static string MakeAlias (Account account, string serviceId)
Expand Down

0 comments on commit 6c763f7

Please sign in to comment.