<commit_before>package com.ibm.mobilefirstplatform.appid_clientsdk_android;

import android.net.Uri;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.ViewGroup;
import android.webkit.CookieManager;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import org.json.JSONException;
import org.json.JSONObject;

public class WebViewActivity extends AppCompatActivity {

    //Default return code when cancel is pressed during authentication.
    private static final String AUTH_CANCEL_CODE = "100";
    private WebView webView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_web_view);
        webView = (WebView) findViewById(R.id.webView1);
        webView.getSettings().setJavaScriptEnabled(true);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            webView.setWebViewClient(new WebViewClientNewAPI());
        }else{
            webView.setWebViewClient(new WebViewClientOldAPI());
        }
        webView.clearCache(true);
        clearCookies();
        webView.loadUrl(AppIdAuthorizationManager.getInstance().getAuthorizationUrl());
    }

    private void clearCookies() {
        CookieManager cookieManager = CookieManager.getInstance();
        cookieManager.setCookie(".facebook.com", "c_user="); //TODO: check if we can do something better.
    }

    //override here in order to avoid window leaks
    @Override
    public void finish() {
        ViewGroup view = (ViewGroup) getWindow().getDecorView();<commit_msg>removing deletion of facebook cookies<commit_after>package com.ibm.mobilefirstplatform.appid_clientsdk_android;

import android.net.Uri;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.ViewGroup;
import android.webkit.CookieManager;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import org.json.JSONException;
import org.json.JSONObject;

public class WebViewActivity extends AppCompatActivity {

    //Default return code when cancel is pressed during authentication.
    private static final String AUTH_CANCEL_CODE = "100";
    private WebView webView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_web_view);
        webView = (WebView) findViewById(R.id.webView1);
        webView.getSettings().setJavaScriptEnabled(true);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            webView.setWebViewClient(new WebViewClientNewAPI());
        }else{
            webView.setWebViewClient(new WebViewClientOldAPI());
        }
        webView.clearCache(true);
        webView.loadUrl(AppIdAuthorizationManager.getInstance().getAuthorizationUrl());
    }

    //override here in order to avoid window leaks
    @Override
    public void finish() {
        ViewGroup view = (ViewGroup) getWindow().getDecorView();
{'fraction_non_alphanumeric': 0.09252450980392157, 'fraction_numerical': 0.0030637254901960784, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6820982', 'n_tokens_mistral': 913, 'n_tokens_neox': 881, 'n_words': 192}