Java Code Examples for org.chromium.chrome.browser.signin.SigninHelper#markAccountsChangedPref()

The following examples show how to use org.chromium.chrome.browser.signin.SigninHelper#markAccountsChangedPref() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AccountsChangedReceiver.java    From delion with Apache License 2.0 5 votes vote down vote up
private void continueHandleAccountChangeIfNeeded(final Context context, final Intent intent) {
    if (!AccountManager.LOGIN_ACCOUNTS_CHANGED_ACTION.equals(intent.getAction())) return;

    AccountTrackerService.get(context).invalidateAccountSeedStatus(
            false /* don't refresh right now */);
    boolean isChromeVisible = ApplicationStatus.hasVisibleActivities();
    if (isChromeVisible) {
        startBrowserIfNeededAndValidateAccounts(context);
    } else {
        // Notify SigninHelper of changed accounts (via shared prefs).
        SigninHelper.markAccountsChangedPref(context);
    }
    notifyAccountsChangedOnBrowserStartup(context, intent);
}
 
Example 2
Source File: AccountsChangedReceiver.java    From delion with Apache License 2.0 5 votes vote down vote up
@SuppressFBWarnings("DM_EXIT")
private static void startBrowserIfNeededAndValidateAccounts(final Context context) {
    BrowserParts parts = new EmptyBrowserParts() {
        @Override
        public void finishNativeInitialization() {
            ThreadUtils.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    SigninHelper.get(context).validateAccountSettings(true);
                }
            });
        }

        @Override
        public void onStartupFailure() {
            // Startup failed. So notify SigninHelper of changed accounts via
            // shared prefs.
            SigninHelper.markAccountsChangedPref(context);
        }
    };
    try {
        ChromeBrowserInitializer.getInstance(context).handlePreNativeStartup(parts);
        ChromeBrowserInitializer.getInstance(context).handlePostNativeStartup(true, parts);
    } catch (ProcessInitException e) {
        Log.e(TAG, "Unable to load native library.", e);
        ChromeApplication.reportStartupErrorAndExit(e);
    }
}
 
Example 3
Source File: AccountsChangedReceiver.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
private void continueHandleAccountChangeIfNeeded(final Context context, final Intent intent) {
    if (!AccountManager.LOGIN_ACCOUNTS_CHANGED_ACTION.equals(intent.getAction())) return;

    AccountTrackerService.get(context).invalidateAccountSeedStatus(
            false /* don't refresh right now */);
    boolean isChromeVisible = ApplicationStatus.hasVisibleActivities();
    if (isChromeVisible) {
        startBrowserIfNeededAndValidateAccounts(context);
    } else {
        // Notify SigninHelper of changed accounts (via shared prefs).
        SigninHelper.markAccountsChangedPref(context);
    }
    notifyAccountsChangedOnBrowserStartup(context, intent);
}
 
Example 4
Source File: AccountsChangedReceiver.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@SuppressFBWarnings("DM_EXIT")
private static void startBrowserIfNeededAndValidateAccounts(final Context context) {
    BrowserParts parts = new EmptyBrowserParts() {
        @Override
        public void finishNativeInitialization() {
            ThreadUtils.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    SigninHelper.get(context).validateAccountSettings(true);
                }
            });
        }

        @Override
        public void onStartupFailure() {
            // Startup failed. So notify SigninHelper of changed accounts via
            // shared prefs.
            SigninHelper.markAccountsChangedPref(context);
        }
    };
    try {
        ChromeBrowserInitializer.getInstance(context).handlePreNativeStartup(parts);
        ChromeBrowserInitializer.getInstance(context).handlePostNativeStartup(true, parts);
    } catch (ProcessInitException e) {
        Log.e(TAG, "Unable to load native library.", e);
        ChromeApplication.reportStartupErrorAndExit(e);
    }
}
 
Example 5
Source File: AccountsChangedReceiver.java    From 365browser with Apache License 2.0 5 votes vote down vote up
private void continueHandleAccountChangeIfNeeded(final Context context) {
    AccountTrackerService.get().invalidateAccountSeedStatus(
            false /* don't refresh right now */);
    boolean isChromeVisible = ApplicationStatus.hasVisibleActivities();
    if (isChromeVisible) {
        startBrowserIfNeededAndValidateAccounts(context);
    } else {
        // Notify SigninHelper of changed accounts (via shared prefs).
        SigninHelper.markAccountsChangedPref(context);
    }
    notifyAccountsChangedOnBrowserStartup(context);
}
 
Example 6
Source File: AccountsChangedReceiver.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@SuppressFBWarnings("DM_EXIT")
private static void startBrowserIfNeededAndValidateAccounts(final Context context) {
    BrowserParts parts = new EmptyBrowserParts() {
        @Override
        public void finishNativeInitialization() {
            ThreadUtils.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    SigninHelper.get(context).validateAccountSettings(true);
                }
            });
        }

        @Override
        public void onStartupFailure() {
            // Startup failed. So notify SigninHelper of changed accounts via
            // shared prefs.
            SigninHelper.markAccountsChangedPref(context);
        }
    };
    try {
        ChromeBrowserInitializer.getInstance(context).handlePreNativeStartup(parts);
        ChromeBrowserInitializer.getInstance(context).handlePostNativeStartup(true, parts);
    } catch (ProcessInitException e) {
        Log.e(TAG, "Unable to load native library.", e);
        ChromeApplication.reportStartupErrorAndExit(e);
    }
}