<commit_before>package org.sana.android.util;

import android.os.Build;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;

/**
 * Created by <EMAIL>, on 07/12/2017.
 */
public class PhoneUtil {
    public static final String TAG = PhoneUtil.class.getSimpleName();

    public static String formatNumber(String number){
        if(TextUtils.isEmpty(number)){
            return "";
        }
        String numberStr = number.replace(" ","");
        // TODO handle other international numbers
        if(numberStr.startsWith("256")){
            numberStr = "+" + numberStr;
        }
        return numberStr;
    }
}<commit_msg>Implemented utility methods to launch dialer activity<commit_after>package org.sana.android.util;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.text.TextUtils;

/**
 * Created by <EMAIL>, on 07/12/2017.
 */
public class PhoneUtil {
    public static final String TAG = PhoneUtil.class.getSimpleName();

    public static String formatNumber(String number){
        if(TextUtils.isEmpty(number)){
            return "";
        }
        String numberStr = number.replace(" ","");
        // TODO handle other international numbers
        if(numberStr.startsWith("256")){
            numberStr = "+" + numberStr;
        }
        return numberStr;
    }

    public static void call(Context context, String number){
        String numberStr = formatNumber(number);
        Intent intent = new Intent(Intent.ACTION_CALL,
                Uri.parse("tel:" + numberStr));
        context.startActivity(intent);
    }

    public static void callForResult(Activity activity, String number, int requestCode){
        String numberStr = formatNumber(number);
        Intent intent = new Intent(Intent.ACTION_CALL,
                Uri.parse("tel:" + numberStr));
        activity.startActivityForResult(intent, requestCode);
    }
}
{'fraction_non_alphanumeric': 0.1099236641221374, 'fraction_numerical': 0.011195928753180661, 'mean_word_length': 2.8249027237354087, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5996243', 'n_tokens_mistral': 539, 'n_tokens_neox': 511, 'n_words': 131}