Java Code Examples for com.facebook.internal.NativeProtocol#isServiceDisabledResult20121101()

The following examples show how to use com.facebook.internal.NativeProtocol#isServiceDisabledResult20121101() . 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: AuthorizationClient.java    From platform-friends-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
boolean onActivityResult(int requestCode, int resultCode, Intent data) {
    Result outcome;

    logEvent(AnalyticsEvents.EVENT_NATIVE_LOGIN_DIALOG_COMPLETE,
            AnalyticsEvents.PARAMETER_NATIVE_LOGIN_DIALOG_COMPLETE_TIME, callId);

    if (data == null) {
        // This happens if the user presses 'Back'.
        outcome = Result.createCancelResult(pendingRequest, "Operation canceled");
    } else if (NativeProtocol.isServiceDisabledResult20121101(data)) {
        outcome = null;
    } else if (resultCode == Activity.RESULT_CANCELED) {
        outcome = createCancelOrErrorResult(pendingRequest, data);
    } else if (resultCode != Activity.RESULT_OK) {
        outcome = Result.createErrorResult(pendingRequest, "Unexpected resultCode from authorization.", null);
    } else {
        outcome = handleResultOk(data);
    }

    if (outcome != null) {
        completeAndValidate(outcome);
    } else {
        tryNextHandler();
    }

    return true;
}
 
Example 2
Source File: AuthorizationClient.java    From Klyph with MIT License 5 votes vote down vote up
@Override
boolean onActivityResult(int requestCode, int resultCode, Intent data) {
    Result outcome;

    logEvent(AnalyticsEvents.EVENT_NATIVE_LOGIN_DIALOG_COMPLETE,
            AnalyticsEvents.PARAMETER_NATIVE_LOGIN_DIALOG_COMPLETE_TIME, callId);

    if (data == null) {
        // This happens if the user presses 'Back'.
        outcome = Result.createCancelResult(pendingRequest, "Operation canceled");
    } else if (NativeProtocol.isServiceDisabledResult20121101(data)) {
        outcome = null;
    } else if (resultCode == Activity.RESULT_CANCELED) {
        outcome = createCancelOrErrorResult(pendingRequest, data);
    } else if (resultCode != Activity.RESULT_OK) {
        outcome = Result.createErrorResult(pendingRequest, "Unexpected resultCode from authorization.", null);
    } else {
        outcome = handleResultOk(data);
    }

    if (outcome != null) {
        completeAndValidate(outcome);
    } else {
        tryNextHandler();
    }

    return true;
}
 
Example 3
Source File: AuthorizationClient.java    From barterli_android with Apache License 2.0 5 votes vote down vote up
@Override
boolean onActivityResult(int requestCode, int resultCode, Intent data) {
    Result outcome;

    logEvent(AnalyticsEvents.EVENT_NATIVE_LOGIN_DIALOG_COMPLETE,
            AnalyticsEvents.PARAMETER_NATIVE_LOGIN_DIALOG_COMPLETE_TIME, callId);

    if (data == null) {
        // This happens if the user presses 'Back'.
        outcome = Result.createCancelResult(pendingRequest, "Operation canceled");
    } else if (NativeProtocol.isServiceDisabledResult20121101(data)) {
        outcome = null;
    } else if (resultCode == Activity.RESULT_CANCELED) {
        outcome = createCancelOrErrorResult(pendingRequest, data);
    } else if (resultCode != Activity.RESULT_OK) {
        outcome = Result.createErrorResult(pendingRequest, "Unexpected resultCode from authorization.", null);
    } else {
        outcome = handleResultOk(data);
    }

    if (outcome != null) {
        completeAndValidate(outcome);
    } else {
        tryNextHandler();
    }

    return true;
}
 
Example 4
Source File: AuthorizationClient.java    From KlyphMessenger with MIT License 5 votes vote down vote up
@Override
boolean onActivityResult(int requestCode, int resultCode, Intent data) {
    Result outcome;

    logEvent(AnalyticsEvents.EVENT_NATIVE_LOGIN_DIALOG_COMPLETE,
            AnalyticsEvents.PARAMETER_NATIVE_LOGIN_DIALOG_COMPLETE_TIME, callId);

    if (data == null) {
        // This happens if the user presses 'Back'.
        outcome = Result.createCancelResult(pendingRequest, "Operation canceled");
    } else if (NativeProtocol.isServiceDisabledResult20121101(data)) {
        outcome = null;
    } else if (resultCode == Activity.RESULT_CANCELED) {
        outcome = createCancelOrErrorResult(pendingRequest, data);
    } else if (resultCode != Activity.RESULT_OK) {
        outcome = Result.createErrorResult(pendingRequest, "Unexpected resultCode from authorization.", null);
    } else {
        outcome = handleResultOk(data);
    }

    if (outcome != null) {
        completeAndValidate(outcome);
    } else {
        tryNextHandler();
    }

    return true;
}