package androidx.core.app; import android.app.Activity; import android.content.ComponentName; import android.content.Context; import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; /* loaded from: classes.dex */ public abstract class k { public static String a(Activity activity) { try { return b(activity, activity.getComponentName()); } catch (PackageManager.NameNotFoundException e10) { throw new IllegalArgumentException(e10); } } public static String b(Context context, ComponentName componentName) { String string; PackageManager packageManager = context.getPackageManager(); int i10 = Build.VERSION.SDK_INT; ActivityInfo activityInfo = packageManager.getActivityInfo(componentName, i10 >= 29 ? 269222528 : i10 >= 24 ? 787072 : 640); String str = activityInfo.parentActivityName; if (str != null) { return str; } Bundle bundle = activityInfo.metaData; if (bundle == null || (string = bundle.getString("android.support.PARENT_ACTIVITY")) == null) { return null; } if (string.charAt(0) != '.') { return string; } return context.getPackageName() + string; } }