static void TryDeleteAccount (Session session)
        {
            try {
#if PLATFORM_ANDROID
                session.Service.DeleteAccount (session.Account, Application.Context);
#else
                session.Service.DeleteAccount (session.Account);
#endif
            } catch {
                // Account doesn't exist, or operation isn't supported by service
            }
        }
        internal void SetSession (Session session, bool saveAccount)
        {
            Utils.EnsureMainThread ();

            if (session == null)
                throw new ArgumentNullException ("session");

            CloseSession ();


            if (saveAccount && session.Service.SupportsSave) {
#if PLATFORM_ANDROID
                session.Service.SaveAccount (session.Account, Application.Context);
#else
                session.Service.SaveAccount (session.Account);
#endif
            }

            GetSessionAsync (_ => Task.FromResult (session));
        }