org.chromium.chrome.browser.sync.SyncController Java Examples

The following examples show how to use org.chromium.chrome.browser.sync.SyncController. 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: GoogleServicesManager.java    From delion with Apache License 2.0 5 votes vote down vote up
private GoogleServicesManager(Context context) {
    try {
        TraceEvent.begin("GoogleServicesManager.GoogleServicesManager");
        ThreadUtils.assertOnUiThread();
        // We should store the application context, as we outlive any activity which may create
        // us.
        mContext = context.getApplicationContext();

        mChromeSigninController = ChromeSigninController.get(mContext);
        mSigninHelper = SigninHelper.get(mContext);

        // The sign out flow starts by clearing the signed in user in the ChromeSigninController
        // on the Java side, and then performs a sign out on the native side. If there is a
        // crash on the native side then the signin state may get out of sync. Make sure that
        // the native side is signed out if the Java side doesn't have a currently signed in
        // user.
        SigninManager signinManager = SigninManager.get(mContext);
        if (!mChromeSigninController.isSignedIn() && signinManager.isSignedInOnNative()) {
            Log.w(TAG, "Signed in state got out of sync, forcing native sign out");
            signinManager.signOut();
        }

        // Initialize sync.
        SyncController.get(context);

        ApplicationStatus.registerApplicationStateListener(this);
    } finally {
        TraceEvent.end("GoogleServicesManager.GoogleServicesManager");
    }
}
 
Example #2
Source File: GoogleServicesManager.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
private GoogleServicesManager(Context context) {
    try {
        TraceEvent.begin("GoogleServicesManager.GoogleServicesManager");
        ThreadUtils.assertOnUiThread();
        // We should store the application context, as we outlive any activity which may create
        // us.
        mContext = context.getApplicationContext();

        mChromeSigninController = ChromeSigninController.get(mContext);
        mSigninHelper = SigninHelper.get(mContext);

        // The sign out flow starts by clearing the signed in user in the ChromeSigninController
        // on the Java side, and then performs a sign out on the native side. If there is a
        // crash on the native side then the signin state may get out of sync. Make sure that
        // the native side is signed out if the Java side doesn't have a currently signed in
        // user.
        SigninManager signinManager = SigninManager.get(mContext);
        if (!mChromeSigninController.isSignedIn() && signinManager.isSignedInOnNative()) {
            Log.w(TAG, "Signed in state got out of sync, forcing native sign out");
            signinManager.signOut();
        }

        // Initialize sync.
        SyncController.get(context);

        ApplicationStatus.registerApplicationStateListener(this);
    } finally {
        TraceEvent.end("GoogleServicesManager.GoogleServicesManager");
    }
}
 
Example #3
Source File: GoogleServicesManager.java    From 365browser with Apache License 2.0 5 votes vote down vote up
private GoogleServicesManager(Context context) {
    try {
        TraceEvent.begin("GoogleServicesManager.GoogleServicesManager");
        ThreadUtils.assertOnUiThread();
        // We should store the application context, as we outlive any activity which may create
        // us.
        mContext = context.getApplicationContext();

        mChromeSigninController = ChromeSigninController.get();
        mSigninHelper = SigninHelper.get(mContext);

        // The sign out flow starts by clearing the signed in user in the ChromeSigninController
        // on the Java side, and then performs a sign out on the native side. If there is a
        // crash on the native side then the signin state may get out of sync. Make sure that
        // the native side is signed out if the Java side doesn't have a currently signed in
        // user.
        SigninManager signinManager = SigninManager.get(mContext);
        if (!mChromeSigninController.isSignedIn() && signinManager.isSignedInOnNative()) {
            Log.w(TAG, "Signed in state got out of sync, forcing native sign out");
            signinManager.signOut();
        }

        // Initialize sync.
        SyncController.get(context);

        ApplicationStatus.registerApplicationStateListener(this);
    } finally {
        TraceEvent.end("GoogleServicesManager.GoogleServicesManager");
    }
}
 
Example #4
Source File: PassphraseActivity.java    From delion with Apache License 2.0 4 votes vote down vote up
@Override
public void onPassphraseCanceled() {
    // Re add the notification.
    SyncController.get(this).getSyncNotificationController().syncStateChanged();
    finish();
}
 
Example #5
Source File: PassphraseActivity.java    From AndroidChromium with Apache License 2.0 4 votes vote down vote up
@Override
public void onPassphraseCanceled() {
    // Re add the notification.
    SyncController.get(this).getSyncNotificationController().syncStateChanged();
    finish();
}
 
Example #6
Source File: PassphraseActivity.java    From 365browser with Apache License 2.0 4 votes vote down vote up
@Override
public void onPassphraseCanceled() {
    // Re add the notification.
    SyncController.get(this).getSyncNotificationController().syncStateChanged();
    finish();
}