package ῲ.ᨨ.K;

import android.app.Activity;
import android.content.Intent;
import android.content.IntentSender;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import java.util.Arrays;
import ඓ.K.K.K.C1293;
import ῲ.ᨨ.ῲ.C1806;

/* renamed from: ῲ.ᨨ.K.K  reason: contains not printable characters */
/* compiled from: ActivityCompat */
public class C1826 extends C1806 {

    /* renamed from: ῲ.ᨨ.K.K$ʬ  reason: contains not printable characters */
    /* compiled from: ActivityCompat */
    public interface AbstractC1827 {
        void onRequestPermissionsResult(int i, String[] strArr, int[] iArr);
    }

    /* renamed from: ῲ.ᨨ.K.K$ῲ  reason: contains not printable characters */
    /* compiled from: ActivityCompat */
    public class RunnableC1828 implements Runnable {

        /* renamed from: ῲ  reason: contains not printable characters */
        public final /* synthetic */ Activity f6220;

        public RunnableC1828(Activity activity) {
            this.f6220 = activity;
        }

        public void run() {
            if (!this.f6220.isFinishing() && !C1821.m4712(this.f6220)) {
                this.f6220.recreate();
            }
        }
    }

    /* renamed from: ῲ.ᨨ.K.K$K  reason: contains not printable characters */
    /* compiled from: ActivityCompat */
    public class RunnableC1829 implements Runnable {

        /* renamed from: ʬ  reason: contains not printable characters */
        public final /* synthetic */ Activity f6221;

        /* renamed from: ῲ  reason: contains not printable characters */
        public final /* synthetic */ String[] f6222;

        /* renamed from: 㸾  reason: contains not printable characters */
        public final /* synthetic */ int f6223;

        public RunnableC1829(String[] strArr, Activity activity, int i) {
            this.f6222 = strArr;
            this.f6221 = activity;
            this.f6223 = i;
        }

        public void run() {
            int[] iArr = new int[this.f6222.length];
            PackageManager packageManager = this.f6221.getPackageManager();
            String packageName = this.f6221.getPackageName();
            int length = this.f6222.length;
            for (int i = 0; i < length; i++) {
                iArr[i] = packageManager.checkPermission(this.f6222[i], packageName);
            }
            ((AbstractC1827) this.f6221).onRequestPermissionsResult(this.f6223, this.f6222, iArr);
        }
    }

    /* renamed from: ῲ.ᨨ.K.K$㸾  reason: contains not printable characters */
    /* compiled from: ActivityCompat */
    public interface AbstractC1830 {
        void validateRequestPermissionsRequestCode(int i);
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public static Uri m4714(Activity activity) {
        int i = Build.VERSION.SDK_INT;
        return activity.getReferrer();
    }

    /* renamed from: ඓ  reason: contains not printable characters */
    public static void m4715(Activity activity) {
        int i = Build.VERSION.SDK_INT;
        if (i >= 28) {
            activity.recreate();
        } else if (i <= 23) {
            new Handler(activity.getMainLooper()).post(new RunnableC1828(activity));
        } else if (!C1821.m4712(activity)) {
            activity.recreate();
        }
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static void m4716(Activity activity) {
        int i = Build.VERSION.SDK_INT;
        activity.finishAfterTransition();
    }

    /* renamed from: ⁱ  reason: contains not printable characters */
    public static void m4717(Activity activity) {
        int i = Build.VERSION.SDK_INT;
        activity.setExitSharedElementCallback(null);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m4718() {
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m4720(Activity activity, Intent intent, int i, Bundle bundle) {
        int i2 = Build.VERSION.SDK_INT;
        activity.startActivityForResult(intent, i, bundle);
    }

    /* renamed from: 㴹  reason: contains not printable characters */
    public static void m4724(Activity activity) {
        int i = Build.VERSION.SDK_INT;
        activity.setEnterSharedElementCallback(null);
    }

    /* renamed from: 㸾  reason: contains not printable characters */
    public static void m4725(Activity activity) {
        int i = Build.VERSION.SDK_INT;
        activity.postponeEnterTransition();
    }

    /* renamed from: 㿎  reason: contains not printable characters */
    public static void m4726(Activity activity) {
        int i = Build.VERSION.SDK_INT;
        activity.startPostponedEnterTransition();
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m4721(Activity activity, IntentSender intentSender, int i, Intent intent, int i2, int i3, int i4, Bundle bundle) throws IntentSender.SendIntentException {
        int i5 = Build.VERSION.SDK_INT;
        activity.startIntentSenderForResult(intentSender, i, intent, i2, i3, i4, bundle);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m4719(Activity activity) {
        int i = Build.VERSION.SDK_INT;
        activity.finishAffinity();
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m4722(Activity activity, String[] strArr, int i) {
        for (String str : strArr) {
            if (TextUtils.isEmpty(str)) {
                throw new IllegalArgumentException(C1293.m3414(C1293.m3416("Permission request for permissions "), Arrays.toString(strArr), " must not contain null or empty values"));
            }
        }
        if (Build.VERSION.SDK_INT >= 23) {
            if (activity instanceof AbstractC1830) {
                ((AbstractC1830) activity).validateRequestPermissionsRequestCode(i);
            }
            activity.requestPermissions(strArr, i);
        } else if (activity instanceof AbstractC1827) {
            new Handler(Looper.getMainLooper()).post(new RunnableC1829(strArr, activity, i));
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static boolean m4723(Activity activity, String str) {
        if (Build.VERSION.SDK_INT >= 23) {
            return activity.shouldShowRequestPermissionRationale(str);
        }
        return false;
    }
}
