// Path: app/src/main/java/com/jachness/blockcalls/exceptions/FileException.java
// @SuppressWarnings("SameParameterValue")
// public class FileException extends Exception {
//     public static final int MEDIA_ERROR = 0;
//     public static final int READ_FILE_ERROR = 1;
//     public static final int WRITE_FILE_ERROR = 2;
//     private final int errorCode;
// 
//     public FileException(int errorCode) {
//         this.errorCode = errorCode;
//     }
// 
//     public FileException(int errorCode, String message) {
//         super(message);
//         this.errorCode = errorCode;
//     }
// 
//     public FileException(int errorCode, String message, Throwable cause) {
//         super(message, cause);
//         this.errorCode = errorCode;
//     }
// 
//     public int getErrorCode() {
//         return errorCode;
//     }
// }


import android.annotation.TargetApi;
import android.app.Activity;
import android.app.ActivityManager;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.database.Cursor;
import android.os.Build;
import android.support.annotation.NonNull;
import android.telephony.TelephonyManager;
import android.text.Html;
import android.text.Spanned;
import android.text.TextUtils;
import android.util.Log;
import com.google.i18n.phonenumbers.PhoneNumberUtil;
import com.google.i18n.phonenumbers.Phonenumber;
import com.jachness.blockcalls.R;
import com.jachness.blockcalls.exceptions.FileException;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Locale;
import hugo.weaving.DebugLog;
/*
 * Copyright (C) 2017 Jonatan Cheiro Anriquez
 *
 * This file is part of Block Calls.
 *
 * Block Calls is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Block Calls is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Block Calls. If not, see <http://www.gnu.org/licenses/>.
 */

package com.jachness.blockcalls.stuff;





/**
 * Created by jachness on 28/9/2016.
 */
public class Util {
    private static final String TAG = Util.class.getSimpleName();

    @SuppressWarnings("deprecation")
    @DebugLog
    public static Locale getDefaultLocale() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            return Resources.getSystem().getConfiguration().getLocales().get(0);
        } else {
            return Resources.getSystem().getConfiguration().locale;
        }
    }

    @DebugLog
// Path: app/src/main/java/com/jachness/blockcalls/exceptions/FileException.java
// @SuppressWarnings("SameParameterValue")
// public class FileException extends Exception {
//     public static final int MEDIA_ERROR = 0;
//     public static final int READ_FILE_ERROR = 1;
//     public static final int WRITE_FILE_ERROR = 2;
//     private final int errorCode;
// 
//     public FileException(int errorCode) {
//         this.errorCode = errorCode;
//     }
// 
//     public FileException(int errorCode, String message) {
//         super(message);
//         this.errorCode = errorCode;
//     }
// 
//     public FileException(int errorCode, String message, Throwable cause) {
//         super(message, cause);
//         this.errorCode = errorCode;
//     }
// 
//     public int getErrorCode() {
//         return errorCode;
//     }
// }


// Path: app/src/main/java/com/jachness/blockcalls/stuff/Util.java
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.ActivityManager;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.database.Cursor;
import android.os.Build;
import android.support.annotation.NonNull;
import android.telephony.TelephonyManager;
import android.text.Html;
import android.text.Spanned;
import android.text.TextUtils;
import android.util.Log;
import com.google.i18n.phonenumbers.PhoneNumberUtil;
import com.google.i18n.phonenumbers.Phonenumber;
import com.jachness.blockcalls.R;
import com.jachness.blockcalls.exceptions.FileException;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Locale;
import hugo.weaving.DebugLog;

/*
 * Copyright (C) 2017 Jonatan Cheiro Anriquez
 *
 * This file is part of Block Calls.
 *
 * Block Calls is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Block Calls is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Block Calls. If not, see <http://www.gnu.org/licenses/>.
 */

package com.jachness.blockcalls.stuff;





/**
 * Created by jachness on 28/9/2016.
 */
public class Util {
    private static final String TAG = Util.class.getSimpleName();

    @SuppressWarnings("deprecation")
    @DebugLog
    public static Locale getDefaultLocale() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            return Resources.getSystem().getConfiguration().getLocales().get(0);
        } else {
            return Resources.getSystem().getConfiguration().locale;
        }
    }

    @DebugLog
    public static int getStringId(@NonNull FileException e) {