Initial commit

This commit is contained in:
2025-05-13 19:24:51 +02:00
commit a950f49678
10604 changed files with 932663 additions and 0 deletions

View File

@@ -0,0 +1,177 @@
package androidx.core.app;
import android.app.Activity;
import android.app.SharedElementCallback;
import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
import android.content.pm.PackageManager;
import android.graphics.Matrix;
import android.graphics.RectF;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Parcelable;
import android.view.View;
import androidx.core.app.SharedElementCallback;
import androidx.core.content.ContextCompat;
import java.util.List;
import java.util.Map;
/* loaded from: classes.dex */
public class ActivityCompat extends ContextCompat {
private static PermissionCompatDelegate c;
public interface OnRequestPermissionsResultCallback {
void onRequestPermissionsResult(int i, String[] strArr, int[] iArr);
}
public interface PermissionCompatDelegate {
boolean a(Activity activity, int i, int i2, Intent intent);
boolean a(Activity activity, String[] strArr, int i);
}
public interface RequestPermissionsRequestCodeValidator {
void validateRequestPermissionsRequestCode(int i);
}
private static class SharedElementCallback21Impl extends android.app.SharedElementCallback {
private final SharedElementCallback a;
SharedElementCallback21Impl(SharedElementCallback sharedElementCallback) {
this.a = sharedElementCallback;
}
@Override // android.app.SharedElementCallback
public Parcelable onCaptureSharedElementSnapshot(View view, Matrix matrix, RectF rectF) {
return this.a.a(view, matrix, rectF);
}
@Override // android.app.SharedElementCallback
public View onCreateSnapshotView(Context context, Parcelable parcelable) {
return this.a.a(context, parcelable);
}
@Override // android.app.SharedElementCallback
public void onMapSharedElements(List<String> list, Map<String, View> map) {
this.a.a(list, map);
}
@Override // android.app.SharedElementCallback
public void onRejectSharedElements(List<View> list) {
this.a.a(list);
}
@Override // android.app.SharedElementCallback
public void onSharedElementEnd(List<String> list, List<View> list2, List<View> list3) {
this.a.a(list, list2, list3);
}
@Override // android.app.SharedElementCallback
public void onSharedElementStart(List<String> list, List<View> list2, List<View> list3) {
this.a.b(list, list2, list3);
}
@Override // android.app.SharedElementCallback
public void onSharedElementsArrived(List<String> list, List<View> list2, SharedElementCallback.OnSharedElementsReadyListener onSharedElementsReadyListener) {
this.a.a(list, list2, new SharedElementCallback.OnSharedElementsReadyListener(this, onSharedElementsReadyListener) { // from class: androidx.core.app.ActivityCompat.SharedElementCallback21Impl.1
});
}
}
public static PermissionCompatDelegate a() {
return c;
}
public static void b(Activity activity) {
if (Build.VERSION.SDK_INT >= 21) {
activity.finishAfterTransition();
} else {
activity.finish();
}
}
public static void c(Activity activity) {
if (Build.VERSION.SDK_INT >= 21) {
activity.postponeEnterTransition();
}
}
public static void d(Activity activity) {
if (Build.VERSION.SDK_INT >= 21) {
activity.startPostponedEnterTransition();
}
}
public static void a(Activity activity, Intent intent, int i, Bundle bundle) {
if (Build.VERSION.SDK_INT >= 16) {
activity.startActivityForResult(intent, i, bundle);
} else {
activity.startActivityForResult(intent, i);
}
}
public static void b(Activity activity, SharedElementCallback sharedElementCallback) {
if (Build.VERSION.SDK_INT >= 21) {
activity.setExitSharedElementCallback(sharedElementCallback != null ? new SharedElementCallback21Impl(sharedElementCallback) : null);
}
}
public static void a(Activity activity, IntentSender intentSender, int i, Intent intent, int i2, int i3, int i4, Bundle bundle) throws IntentSender.SendIntentException {
if (Build.VERSION.SDK_INT >= 16) {
activity.startIntentSenderForResult(intentSender, i, intent, i2, i3, i4, bundle);
} else {
activity.startIntentSenderForResult(intentSender, i, intent, i2, i3, i4);
}
}
public static void a(Activity activity) {
if (Build.VERSION.SDK_INT >= 16) {
activity.finishAffinity();
} else {
activity.finish();
}
}
public static void a(Activity activity, SharedElementCallback sharedElementCallback) {
if (Build.VERSION.SDK_INT >= 21) {
activity.setEnterSharedElementCallback(sharedElementCallback != null ? new SharedElementCallback21Impl(sharedElementCallback) : null);
}
}
/* JADX WARN: Multi-variable type inference failed */
public static void a(final Activity activity, final String[] strArr, final int i) {
PermissionCompatDelegate permissionCompatDelegate = c;
if (permissionCompatDelegate == null || !permissionCompatDelegate.a(activity, strArr, i)) {
if (Build.VERSION.SDK_INT >= 23) {
if (activity instanceof RequestPermissionsRequestCodeValidator) {
((RequestPermissionsRequestCodeValidator) activity).validateRequestPermissionsRequestCode(i);
}
activity.requestPermissions(strArr, i);
} else if (activity instanceof OnRequestPermissionsResultCallback) {
new Handler(Looper.getMainLooper()).post(new Runnable() { // from class: androidx.core.app.ActivityCompat.1
@Override // java.lang.Runnable
public void run() {
int[] iArr = new int[strArr.length];
PackageManager packageManager = activity.getPackageManager();
String packageName = activity.getPackageName();
int length = strArr.length;
for (int i2 = 0; i2 < length; i2++) {
iArr[i2] = packageManager.checkPermission(strArr[i2], packageName);
}
((OnRequestPermissionsResultCallback) activity).onRequestPermissionsResult(i, strArr, iArr);
}
});
}
}
}
public static boolean a(Activity activity, String str) {
if (Build.VERSION.SDK_INT >= 23) {
return activity.shouldShowRequestPermissionRationale(str);
}
return false;
}
}

View File

@@ -0,0 +1,33 @@
package androidx.core.app;
import android.app.Activity;
import android.app.ActivityOptions;
import android.os.Build;
import android.view.View;
import androidx.core.util.Pair;
/* loaded from: classes.dex */
public class ActivityOptionsCompat {
private static class ActivityOptionsCompatImpl extends ActivityOptionsCompat {
ActivityOptionsCompatImpl(ActivityOptions activityOptions) {
}
}
protected ActivityOptionsCompat() {
}
public static ActivityOptionsCompat a(Activity activity, Pair<View, String>... pairArr) {
if (Build.VERSION.SDK_INT < 21) {
return new ActivityOptionsCompat();
}
android.util.Pair[] pairArr2 = null;
if (pairArr != null) {
pairArr2 = new android.util.Pair[pairArr.length];
for (int i = 0; i < pairArr.length; i++) {
pairArr2[i] = android.util.Pair.create(pairArr[i].a, pairArr[i].b);
}
}
return new ActivityOptionsCompatImpl(ActivityOptions.makeSceneTransitionAnimation(activity, pairArr2));
}
}

View File

@@ -0,0 +1,22 @@
package androidx.core.app;
import android.app.AppOpsManager;
import android.content.Context;
import android.os.Build;
/* loaded from: classes.dex */
public final class AppOpsManagerCompat {
public static String a(String str) {
if (Build.VERSION.SDK_INT >= 23) {
return AppOpsManager.permissionToOp(str);
}
return null;
}
public static int a(Context context, String str, String str2) {
if (Build.VERSION.SDK_INT >= 23) {
return ((AppOpsManager) context.getSystemService(AppOpsManager.class)).noteProxyOpNoThrow(str, str2);
}
return 1;
}
}

View File

@@ -0,0 +1,73 @@
package androidx.core.app;
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.util.Log;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/* loaded from: classes.dex */
public final class BundleCompat {
public static IBinder a(Bundle bundle, String str) {
return Build.VERSION.SDK_INT >= 18 ? bundle.getBinder(str) : BundleCompatBaseImpl.a(bundle, str);
}
public static void a(Bundle bundle, String str, IBinder iBinder) {
if (Build.VERSION.SDK_INT >= 18) {
bundle.putBinder(str, iBinder);
} else {
BundleCompatBaseImpl.a(bundle, str, iBinder);
}
}
static class BundleCompatBaseImpl {
private static Method a;
private static boolean b;
private static Method c;
private static boolean d;
public static IBinder a(Bundle bundle, String str) {
if (!b) {
try {
a = Bundle.class.getMethod("getIBinder", String.class);
a.setAccessible(true);
} catch (NoSuchMethodException e) {
Log.i("BundleCompatBaseImpl", "Failed to retrieve getIBinder method", e);
}
b = true;
}
Method method = a;
if (method != null) {
try {
return (IBinder) method.invoke(bundle, str);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e2) {
Log.i("BundleCompatBaseImpl", "Failed to invoke getIBinder via reflection", e2);
a = null;
}
}
return null;
}
public static void a(Bundle bundle, String str, IBinder iBinder) {
if (!d) {
try {
c = Bundle.class.getMethod("putIBinder", String.class, IBinder.class);
c.setAccessible(true);
} catch (NoSuchMethodException e) {
Log.i("BundleCompatBaseImpl", "Failed to retrieve putIBinder method", e);
}
d = true;
}
Method method = c;
if (method != null) {
try {
method.invoke(bundle, str, iBinder);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e2) {
Log.i("BundleCompatBaseImpl", "Failed to invoke putIBinder via reflection", e2);
c = null;
}
}
}
}
}

View File

@@ -0,0 +1,70 @@
package androidx.core.app;
import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import androidx.collection.SimpleArrayMap;
import androidx.core.view.KeyEventDispatcher;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LifecycleRegistry;
import androidx.lifecycle.ReportFragment;
/* loaded from: classes.dex */
public class ComponentActivity extends Activity implements LifecycleOwner, KeyEventDispatcher.Component {
private SimpleArrayMap<Class<? extends ExtraData>, ExtraData> mExtraDataMap = new SimpleArrayMap<>();
private LifecycleRegistry mLifecycleRegistry = new LifecycleRegistry(this);
public static class ExtraData {
}
@Override // android.app.Activity, android.view.Window.Callback
public boolean dispatchKeyEvent(KeyEvent keyEvent) {
View decorView = getWindow().getDecorView();
if (decorView == null || !KeyEventDispatcher.a(decorView, keyEvent)) {
return KeyEventDispatcher.a(this, decorView, this, keyEvent);
}
return true;
}
@Override // android.app.Activity, android.view.Window.Callback
public boolean dispatchKeyShortcutEvent(KeyEvent keyEvent) {
View decorView = getWindow().getDecorView();
if (decorView == null || !KeyEventDispatcher.a(decorView, keyEvent)) {
return super.dispatchKeyShortcutEvent(keyEvent);
}
return true;
}
public <T extends ExtraData> T getExtraData(Class<T> cls) {
return (T) this.mExtraDataMap.get(cls);
}
@Override // androidx.lifecycle.LifecycleOwner
public Lifecycle getLifecycle() {
return this.mLifecycleRegistry;
}
@Override // android.app.Activity
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
ReportFragment.a(this);
}
@Override // android.app.Activity
protected void onSaveInstanceState(Bundle bundle) {
this.mLifecycleRegistry.a(Lifecycle.State.CREATED);
super.onSaveInstanceState(bundle);
}
/* JADX WARN: Multi-variable type inference failed */
public void putExtraData(ExtraData extraData) {
this.mExtraDataMap.put(extraData.getClass(), extraData);
}
@Override // androidx.core.view.KeyEventDispatcher.Component
public boolean superDispatchKeyEvent(KeyEvent keyEvent) {
return super.dispatchKeyEvent(keyEvent);
}
}

View File

@@ -0,0 +1,47 @@
package androidx.core.app;
import android.app.Activity;
import android.app.AppComponentFactory;
import android.app.Application;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.ContentProvider;
import android.content.Intent;
/* loaded from: classes.dex */
public class CoreComponentFactory extends AppComponentFactory {
public interface CompatWrapped {
Object a();
}
static <T> T a(T t) {
T t2;
return (!(t instanceof CompatWrapped) || (t2 = (T) ((CompatWrapped) t).a()) == null) ? t : t2;
}
@Override // android.app.AppComponentFactory
public Activity instantiateActivity(ClassLoader classLoader, String str, Intent intent) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
return (Activity) a(super.instantiateActivity(classLoader, str, intent));
}
@Override // android.app.AppComponentFactory
public Application instantiateApplication(ClassLoader classLoader, String str) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
return (Application) a(super.instantiateApplication(classLoader, str));
}
@Override // android.app.AppComponentFactory
public ContentProvider instantiateProvider(ClassLoader classLoader, String str) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
return (ContentProvider) a(super.instantiateProvider(classLoader, str));
}
@Override // android.app.AppComponentFactory
public BroadcastReceiver instantiateReceiver(ClassLoader classLoader, String str, Intent intent) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
return (BroadcastReceiver) a(super.instantiateReceiver(classLoader, str, intent));
}
@Override // android.app.AppComponentFactory
public Service instantiateService(ClassLoader classLoader, String str, Intent intent) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
return (Service) a(super.instantiateService(classLoader, str, intent));
}
}

View File

@@ -0,0 +1,378 @@
package androidx.core.app;
import android.app.Service;
import android.app.job.JobInfo;
import android.app.job.JobParameters;
import android.app.job.JobServiceEngine;
import android.app.job.JobWorkItem;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Build;
import android.os.IBinder;
import android.os.PowerManager;
import java.util.ArrayList;
import java.util.HashMap;
/* loaded from: classes.dex */
public abstract class JobIntentService extends Service {
static final HashMap<ComponentName, WorkEnqueuer> g = new HashMap<>();
CompatJobEngine a;
WorkEnqueuer b;
CommandProcessor c;
boolean d = false;
boolean e = false;
final ArrayList<CompatWorkItem> f;
interface CompatJobEngine {
IBinder a();
GenericWorkItem b();
}
static final class CompatWorkEnqueuer extends WorkEnqueuer {
private final PowerManager.WakeLock d;
private final PowerManager.WakeLock e;
boolean f;
boolean g;
CompatWorkEnqueuer(Context context, ComponentName componentName) {
super(context, componentName);
context.getApplicationContext();
PowerManager powerManager = (PowerManager) context.getSystemService("power");
this.d = powerManager.newWakeLock(1, componentName.getClassName() + ":launch");
this.d.setReferenceCounted(false);
this.e = powerManager.newWakeLock(1, componentName.getClassName() + ":run");
this.e.setReferenceCounted(false);
}
@Override // androidx.core.app.JobIntentService.WorkEnqueuer
public void a() {
synchronized (this) {
if (this.g) {
if (this.f) {
this.d.acquire(60000L);
}
this.g = false;
this.e.release();
}
}
}
@Override // androidx.core.app.JobIntentService.WorkEnqueuer
public void b() {
synchronized (this) {
if (!this.g) {
this.g = true;
this.e.acquire(600000L);
this.d.release();
}
}
}
@Override // androidx.core.app.JobIntentService.WorkEnqueuer
public void c() {
synchronized (this) {
this.f = false;
}
}
}
final class CompatWorkItem implements GenericWorkItem {
final Intent a;
final int b;
CompatWorkItem(Intent intent, int i) {
this.a = intent;
this.b = i;
}
@Override // androidx.core.app.JobIntentService.GenericWorkItem
public void a() {
JobIntentService.this.stopSelf(this.b);
}
@Override // androidx.core.app.JobIntentService.GenericWorkItem
public Intent getIntent() {
return this.a;
}
}
interface GenericWorkItem {
void a();
Intent getIntent();
}
static final class JobServiceEngineImpl extends JobServiceEngine implements CompatJobEngine {
final JobIntentService a;
final Object b;
JobParameters c;
final class WrapperWorkItem implements GenericWorkItem {
final JobWorkItem a;
WrapperWorkItem(JobWorkItem jobWorkItem) {
this.a = jobWorkItem;
}
@Override // androidx.core.app.JobIntentService.GenericWorkItem
public void a() {
synchronized (JobServiceEngineImpl.this.b) {
if (JobServiceEngineImpl.this.c != null) {
JobServiceEngineImpl.this.c.completeWork(this.a);
}
}
}
@Override // androidx.core.app.JobIntentService.GenericWorkItem
public Intent getIntent() {
return this.a.getIntent();
}
}
JobServiceEngineImpl(JobIntentService jobIntentService) {
super(jobIntentService);
this.b = new Object();
this.a = jobIntentService;
}
@Override // androidx.core.app.JobIntentService.CompatJobEngine
public IBinder a() {
return getBinder();
}
@Override // androidx.core.app.JobIntentService.CompatJobEngine
public GenericWorkItem b() {
synchronized (this.b) {
if (this.c == null) {
return null;
}
JobWorkItem dequeueWork = this.c.dequeueWork();
if (dequeueWork == null) {
return null;
}
dequeueWork.getIntent().setExtrasClassLoader(this.a.getClassLoader());
return new WrapperWorkItem(dequeueWork);
}
}
@Override // android.app.job.JobServiceEngine
public boolean onStartJob(JobParameters jobParameters) {
this.c = jobParameters;
this.a.a(false);
return true;
}
@Override // android.app.job.JobServiceEngine
public boolean onStopJob(JobParameters jobParameters) {
boolean b = this.a.b();
synchronized (this.b) {
this.c = null;
}
return b;
}
}
static final class JobWorkEnqueuer extends WorkEnqueuer {
JobWorkEnqueuer(Context context, ComponentName componentName, int i) {
super(context, componentName);
a(i);
new JobInfo.Builder(i, this.a).setOverrideDeadline(0L).build();
}
}
static abstract class WorkEnqueuer {
final ComponentName a;
boolean b;
int c;
WorkEnqueuer(Context context, ComponentName componentName) {
this.a = componentName;
}
public void a() {
}
void a(int i) {
if (!this.b) {
this.b = true;
this.c = i;
} else {
if (this.c == i) {
return;
}
throw new IllegalArgumentException("Given job ID " + i + " is different than previous " + this.c);
}
}
public void b() {
}
public void c() {
}
}
public JobIntentService() {
if (Build.VERSION.SDK_INT >= 26) {
this.f = null;
} else {
this.f = new ArrayList<>();
}
}
static WorkEnqueuer a(Context context, ComponentName componentName, boolean z, int i) {
WorkEnqueuer compatWorkEnqueuer;
WorkEnqueuer workEnqueuer = g.get(componentName);
if (workEnqueuer != null) {
return workEnqueuer;
}
if (Build.VERSION.SDK_INT < 26) {
compatWorkEnqueuer = new CompatWorkEnqueuer(context, componentName);
} else {
if (!z) {
throw new IllegalArgumentException("Can't be here without a job id");
}
compatWorkEnqueuer = new JobWorkEnqueuer(context, componentName, i);
}
WorkEnqueuer workEnqueuer2 = compatWorkEnqueuer;
g.put(componentName, workEnqueuer2);
return workEnqueuer2;
}
protected abstract void a(Intent intent);
boolean b() {
CommandProcessor commandProcessor = this.c;
if (commandProcessor != null) {
commandProcessor.cancel(this.d);
}
return c();
}
public boolean c() {
return true;
}
void d() {
ArrayList<CompatWorkItem> arrayList = this.f;
if (arrayList != null) {
synchronized (arrayList) {
this.c = null;
if (this.f != null && this.f.size() > 0) {
a(false);
} else if (!this.e) {
this.b.a();
}
}
}
}
@Override // android.app.Service
public IBinder onBind(Intent intent) {
CompatJobEngine compatJobEngine = this.a;
if (compatJobEngine != null) {
return compatJobEngine.a();
}
return null;
}
@Override // android.app.Service
public void onCreate() {
super.onCreate();
if (Build.VERSION.SDK_INT >= 26) {
this.a = new JobServiceEngineImpl(this);
this.b = null;
} else {
this.a = null;
this.b = a(this, new ComponentName(this, (Class<?>) JobIntentService.class), false, 0);
}
}
@Override // android.app.Service
public void onDestroy() {
super.onDestroy();
ArrayList<CompatWorkItem> arrayList = this.f;
if (arrayList != null) {
synchronized (arrayList) {
this.e = true;
this.b.a();
}
}
}
@Override // android.app.Service
public int onStartCommand(Intent intent, int i, int i2) {
if (this.f == null) {
return 2;
}
this.b.c();
synchronized (this.f) {
ArrayList<CompatWorkItem> arrayList = this.f;
if (intent == null) {
intent = new Intent();
}
arrayList.add(new CompatWorkItem(intent, i2));
a(true);
}
return 3;
}
final class CommandProcessor extends AsyncTask<Void, Void, Void> {
CommandProcessor() {
}
/* JADX INFO: Access modifiers changed from: protected */
@Override // android.os.AsyncTask
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public Void doInBackground(Void... voidArr) {
while (true) {
GenericWorkItem a = JobIntentService.this.a();
if (a == null) {
return null;
}
JobIntentService.this.a(a.getIntent());
a.a();
}
}
/* JADX INFO: Access modifiers changed from: protected */
@Override // android.os.AsyncTask
/* renamed from: b, reason: merged with bridge method [inline-methods] */
public void onPostExecute(Void r1) {
JobIntentService.this.d();
}
/* JADX INFO: Access modifiers changed from: protected */
@Override // android.os.AsyncTask
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public void onCancelled(Void r1) {
JobIntentService.this.d();
}
}
void a(boolean z) {
if (this.c == null) {
this.c = new CommandProcessor();
WorkEnqueuer workEnqueuer = this.b;
if (workEnqueuer != null && z) {
workEnqueuer.b();
}
this.c.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Void[0]);
}
}
GenericWorkItem a() {
CompatJobEngine compatJobEngine = this.a;
if (compatJobEngine != null) {
return compatJobEngine.b();
}
synchronized (this.f) {
if (this.f.size() <= 0) {
return null;
}
return this.f.remove(0);
}
}
}

View File

@@ -0,0 +1,89 @@
package androidx.core.app;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import android.util.Log;
import com.ubtrobot.jimu.robotapi.PeripheralType;
/* loaded from: classes.dex */
public final class NavUtils {
public static void a(Activity activity, Intent intent) {
if (Build.VERSION.SDK_INT >= 16) {
activity.navigateUpTo(intent);
return;
}
intent.addFlags(67108864);
activity.startActivity(intent);
activity.finish();
}
public static boolean b(Activity activity, Intent intent) {
if (Build.VERSION.SDK_INT >= 16) {
return activity.shouldUpRecreateTask(intent);
}
String action = activity.getIntent().getAction();
return (action == null || action.equals("android.intent.action.MAIN")) ? false : true;
}
public static String b(Activity activity) {
try {
return b(activity, activity.getComponentName());
} catch (PackageManager.NameNotFoundException e) {
throw new IllegalArgumentException(e);
}
}
public static Intent a(Activity activity) {
Intent parentActivityIntent;
if (Build.VERSION.SDK_INT >= 16 && (parentActivityIntent = activity.getParentActivityIntent()) != null) {
return parentActivityIntent;
}
String b = b(activity);
if (b == null) {
return null;
}
ComponentName componentName = new ComponentName(activity, b);
try {
if (b(activity, componentName) == null) {
return Intent.makeMainActivity(componentName);
}
return new Intent().setComponent(componentName);
} catch (PackageManager.NameNotFoundException unused) {
Log.e("NavUtils", "getParentActivityIntent: bad parentActivityName '" + b + "' in manifest");
return null;
}
}
public static String b(Context context, ComponentName componentName) throws PackageManager.NameNotFoundException {
String string;
String str;
ActivityInfo activityInfo = context.getPackageManager().getActivityInfo(componentName, PeripheralType.SERVO);
if (Build.VERSION.SDK_INT >= 16 && (str = activityInfo.parentActivityName) != null) {
return str;
}
if (activityInfo.metaData == null || (string = activityInfo.metaData.getString("android.support.PARENT_ACTIVITY")) == null) {
return null;
}
if (string.charAt(0) != '.') {
return string;
}
return context.getPackageName() + string;
}
public static Intent a(Context context, ComponentName componentName) throws PackageManager.NameNotFoundException {
String b = b(context, componentName);
if (b == null) {
return null;
}
ComponentName componentName2 = new ComponentName(componentName.getPackageName(), b);
if (b(context, componentName2) == null) {
return Intent.makeMainActivity(componentName2);
}
return new Intent().setComponent(componentName2);
}
}

View File

@@ -0,0 +1,8 @@
package androidx.core.app;
import android.app.Notification;
/* loaded from: classes.dex */
public interface NotificationBuilderWithBuilderAccessor {
Notification.Builder a();
}

View File

@@ -0,0 +1,303 @@
package androidx.core.app;
import android.app.Notification;
import android.app.PendingIntent;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
import android.widget.RemoteViews;
import java.util.ArrayList;
/* loaded from: classes.dex */
public class NotificationCompat {
public static class Action {
final Bundle a;
private final RemoteInput[] b;
private final RemoteInput[] c;
private boolean d;
boolean e;
private final int f;
public int g;
public CharSequence h;
public PendingIntent i;
public Action(int i, CharSequence charSequence, PendingIntent pendingIntent) {
this(i, charSequence, pendingIntent, new Bundle(), null, null, true, 0, true);
}
public PendingIntent a() {
return this.i;
}
public boolean b() {
return this.d;
}
public RemoteInput[] c() {
return this.c;
}
public Bundle d() {
return this.a;
}
public int e() {
return this.g;
}
public RemoteInput[] f() {
return this.b;
}
public int g() {
return this.f;
}
public boolean h() {
return this.e;
}
public CharSequence i() {
return this.h;
}
Action(int i, CharSequence charSequence, PendingIntent pendingIntent, Bundle bundle, RemoteInput[] remoteInputArr, RemoteInput[] remoteInputArr2, boolean z, int i2, boolean z2) {
this.e = true;
this.g = i;
this.h = Builder.d(charSequence);
this.i = pendingIntent;
this.a = bundle == null ? new Bundle() : bundle;
this.b = remoteInputArr;
this.c = remoteInputArr2;
this.d = z;
this.f = i2;
this.e = z2;
}
}
public static class BigTextStyle extends Style {
private CharSequence e;
public BigTextStyle a(CharSequence charSequence) {
this.e = Builder.d(charSequence);
return this;
}
@Override // androidx.core.app.NotificationCompat.Style
public void a(NotificationBuilderWithBuilderAccessor notificationBuilderWithBuilderAccessor) {
if (Build.VERSION.SDK_INT >= 16) {
Notification.BigTextStyle bigText = new Notification.BigTextStyle(notificationBuilderWithBuilderAccessor.a()).setBigContentTitle(this.b).bigText(this.e);
if (this.d) {
bigText.setSummaryText(this.c);
}
}
}
}
public static class Builder {
String A;
Bundle B;
int C;
int D;
Notification E;
RemoteViews F;
RemoteViews G;
RemoteViews H;
String I;
int J;
String K;
long L;
int M;
Notification N;
@Deprecated
public ArrayList<String> O;
public Context a;
public ArrayList<Action> b;
ArrayList<Action> c;
CharSequence d;
CharSequence e;
PendingIntent f;
PendingIntent g;
RemoteViews h;
Bitmap i;
CharSequence j;
int k;
int l;
boolean m;
boolean n;
Style o;
CharSequence p;
CharSequence[] q;
int r;
int s;
boolean t;
String u;
boolean v;
String w;
boolean x;
boolean y;
boolean z;
public Builder(Context context, String str) {
this.b = new ArrayList<>();
this.c = new ArrayList<>();
this.m = true;
this.x = false;
this.C = 0;
this.D = 0;
this.J = 0;
this.M = 0;
this.N = new Notification();
this.a = context;
this.I = str;
this.N.when = System.currentTimeMillis();
this.N.audioStreamType = -1;
this.l = 0;
this.O = new ArrayList<>();
}
protected static CharSequence d(CharSequence charSequence) {
return (charSequence != null && charSequence.length() > 5120) ? charSequence.subSequence(0, 5120) : charSequence;
}
public Builder a(long j) {
this.N.when = j;
return this;
}
public Builder b(int i) {
this.N.icon = i;
return this;
}
public Builder c(CharSequence charSequence) {
this.N.tickerText = d(charSequence);
return this;
}
public Builder a(CharSequence charSequence) {
this.e = d(charSequence);
return this;
}
public Builder b(CharSequence charSequence) {
this.d = d(charSequence);
return this;
}
public Builder a(PendingIntent pendingIntent) {
this.f = pendingIntent;
return this;
}
public Builder b(boolean z) {
this.x = z;
return this;
}
public Builder a(boolean z) {
a(16, z);
return this;
}
public Bundle b() {
if (this.B == null) {
this.B = new Bundle();
}
return this.B;
}
private void a(int i, boolean z) {
if (z) {
Notification notification = this.N;
notification.flags = i | notification.flags;
} else {
Notification notification2 = this.N;
notification2.flags = (~i) & notification2.flags;
}
}
public Builder a(int i) {
this.l = i;
return this;
}
public Builder a(int i, CharSequence charSequence, PendingIntent pendingIntent) {
this.b.add(new Action(i, charSequence, pendingIntent));
return this;
}
public Builder a(Style style) {
if (this.o != style) {
this.o = style;
Style style2 = this.o;
if (style2 != null) {
style2.a(this);
}
}
return this;
}
public Builder a(String str) {
this.I = str;
return this;
}
public Notification a() {
return new NotificationCompatBuilder(this).b();
}
@Deprecated
public Builder(Context context) {
this(context, null);
}
}
public static abstract class Style {
protected Builder a;
CharSequence b;
CharSequence c;
boolean d = false;
public void a(Bundle bundle) {
}
public abstract void a(NotificationBuilderWithBuilderAccessor notificationBuilderWithBuilderAccessor);
public void a(Builder builder) {
if (this.a != builder) {
this.a = builder;
Builder builder2 = this.a;
if (builder2 != null) {
builder2.a(this);
}
}
}
public RemoteViews b(NotificationBuilderWithBuilderAccessor notificationBuilderWithBuilderAccessor) {
return null;
}
public RemoteViews c(NotificationBuilderWithBuilderAccessor notificationBuilderWithBuilderAccessor) {
return null;
}
public RemoteViews d(NotificationBuilderWithBuilderAccessor notificationBuilderWithBuilderAccessor) {
return null;
}
}
public static Bundle a(Notification notification) {
int i = Build.VERSION.SDK_INT;
if (i >= 19) {
return notification.extras;
}
if (i >= 16) {
return NotificationCompatJellybean.a(notification);
}
return null;
}
}

View File

@@ -0,0 +1,306 @@
package androidx.core.app;
import android.app.Notification;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.SparseArray;
import android.widget.RemoteViews;
import androidx.core.app.NotificationCompat;
import com.ijm.dataencryption.de.DataDecryptTool;
import com.ubtrobot.jimu.robotapi.PeripheralType;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/* loaded from: classes.dex */
class NotificationCompatBuilder implements NotificationBuilderWithBuilderAccessor {
private final Notification.Builder a;
private final NotificationCompat.Builder b;
private RemoteViews c;
private RemoteViews d;
private final List<Bundle> e = new ArrayList();
private final Bundle f = new Bundle();
private int g;
private RemoteViews h;
NotificationCompatBuilder(NotificationCompat.Builder builder) {
ArrayList<String> arrayList;
this.b = builder;
if (Build.VERSION.SDK_INT >= 26) {
this.a = new Notification.Builder(builder.a, builder.I);
} else {
this.a = new Notification.Builder(builder.a);
}
Notification notification = builder.N;
this.a.setWhen(notification.when).setSmallIcon(notification.icon, notification.iconLevel).setContent(notification.contentView).setTicker(notification.tickerText, builder.h).setVibrate(notification.vibrate).setLights(notification.ledARGB, notification.ledOnMS, notification.ledOffMS).setOngoing((notification.flags & 2) != 0).setOnlyAlertOnce((notification.flags & 8) != 0).setAutoCancel((notification.flags & 16) != 0).setDefaults(notification.defaults).setContentTitle(builder.d).setContentText(builder.e).setContentInfo(builder.j).setContentIntent(builder.f).setDeleteIntent(notification.deleteIntent).setFullScreenIntent(builder.g, (notification.flags & PeripheralType.SERVO) != 0).setLargeIcon(builder.i).setNumber(builder.k).setProgress(builder.r, builder.s, builder.t);
if (Build.VERSION.SDK_INT < 21) {
this.a.setSound(notification.sound, notification.audioStreamType);
}
if (Build.VERSION.SDK_INT >= 16) {
this.a.setSubText(builder.p).setUsesChronometer(builder.n).setPriority(builder.l);
Iterator<NotificationCompat.Action> it = builder.b.iterator();
while (it.hasNext()) {
a(it.next());
}
Bundle bundle = builder.B;
if (bundle != null) {
this.f.putAll(bundle);
}
if (Build.VERSION.SDK_INT < 20) {
if (builder.x) {
this.f.putBoolean("android.support.localOnly", true);
}
String str = builder.u;
if (str != null) {
this.f.putString("android.support.groupKey", str);
if (builder.v) {
this.f.putBoolean("android.support.isGroupSummary", true);
} else {
this.f.putBoolean("android.support.useSideChannel", true);
}
}
String str2 = builder.w;
if (str2 != null) {
this.f.putString("android.support.sortKey", str2);
}
}
this.c = builder.F;
this.d = builder.G;
}
if (Build.VERSION.SDK_INT >= 19) {
this.a.setShowWhen(builder.m);
if (Build.VERSION.SDK_INT < 21 && (arrayList = builder.O) != null && !arrayList.isEmpty()) {
Bundle bundle2 = this.f;
ArrayList<String> arrayList2 = builder.O;
bundle2.putStringArray("android.people", (String[]) arrayList2.toArray(new String[arrayList2.size()]));
}
}
if (Build.VERSION.SDK_INT >= 20) {
this.a.setLocalOnly(builder.x).setGroup(builder.u).setGroupSummary(builder.v).setSortKey(builder.w);
this.g = builder.M;
}
if (Build.VERSION.SDK_INT >= 21) {
this.a.setCategory(builder.A).setColor(builder.C).setVisibility(builder.D).setPublicVersion(builder.E).setSound(notification.sound, notification.audioAttributes);
Iterator<String> it2 = builder.O.iterator();
while (it2.hasNext()) {
this.a.addPerson(it2.next());
}
this.h = builder.H;
if (builder.c.size() > 0) {
Bundle bundle3 = builder.b().getBundle("android.car.EXTENSIONS");
bundle3 = bundle3 == null ? new Bundle() : bundle3;
Bundle bundle4 = new Bundle();
for (int i = 0; i < builder.c.size(); i++) {
bundle4.putBundle(Integer.toString(i), NotificationCompatJellybean.a(builder.c.get(i)));
}
bundle3.putBundle("invisible_actions", bundle4);
builder.b().putBundle("android.car.EXTENSIONS", bundle3);
this.f.putBundle("android.car.EXTENSIONS", bundle3);
}
}
if (Build.VERSION.SDK_INT >= 24) {
this.a.setExtras(builder.B).setRemoteInputHistory(builder.q);
RemoteViews remoteViews = builder.F;
if (remoteViews != null) {
this.a.setCustomContentView(remoteViews);
}
RemoteViews remoteViews2 = builder.G;
if (remoteViews2 != null) {
this.a.setCustomBigContentView(remoteViews2);
}
RemoteViews remoteViews3 = builder.H;
if (remoteViews3 != null) {
this.a.setCustomHeadsUpContentView(remoteViews3);
}
}
if (Build.VERSION.SDK_INT >= 26) {
this.a.setBadgeIconType(builder.J).setShortcutId(builder.K).setTimeoutAfter(builder.L).setGroupAlertBehavior(builder.M);
if (builder.z) {
this.a.setColorized(builder.y);
}
if (TextUtils.isEmpty(builder.I)) {
return;
}
this.a.setSound(null).setDefaults(0).setLights(0, 0, 0).setVibrate(null);
}
}
@Override // androidx.core.app.NotificationBuilderWithBuilderAccessor
public Notification.Builder a() {
return this.a;
}
public Notification b() {
Bundle a;
RemoteViews d;
RemoteViews b;
NotificationCompat.Style style = this.b.o;
if (style != null) {
style.a(this);
}
RemoteViews c = style != null ? style.c(this) : null;
Notification c2 = c();
if (c != null) {
c2.contentView = c;
} else {
RemoteViews remoteViews = this.b.F;
if (remoteViews != null) {
c2.contentView = remoteViews;
}
}
if (Build.VERSION.SDK_INT >= 16 && style != null && (b = style.b(this)) != null) {
c2.bigContentView = b;
}
if (Build.VERSION.SDK_INT >= 21 && style != null && (d = this.b.o.d(this)) != null) {
c2.headsUpContentView = d;
}
if (Build.VERSION.SDK_INT >= 16 && style != null && (a = NotificationCompat.a(c2)) != null) {
style.a(a);
}
return c2;
}
protected Notification c() {
int i = Build.VERSION.SDK_INT;
if (i >= 26) {
return this.a.build();
}
if (i >= 24) {
Notification build = this.a.build();
if (this.g != 0) {
if (build.getGroup() != null && (build.flags & DataDecryptTool.DECRYPT_DB_FILE) != 0 && this.g == 2) {
a(build);
}
if (build.getGroup() != null && (build.flags & DataDecryptTool.DECRYPT_DB_FILE) == 0 && this.g == 1) {
a(build);
}
}
return build;
}
if (i >= 21) {
this.a.setExtras(this.f);
Notification build2 = this.a.build();
RemoteViews remoteViews = this.c;
if (remoteViews != null) {
build2.contentView = remoteViews;
}
RemoteViews remoteViews2 = this.d;
if (remoteViews2 != null) {
build2.bigContentView = remoteViews2;
}
RemoteViews remoteViews3 = this.h;
if (remoteViews3 != null) {
build2.headsUpContentView = remoteViews3;
}
if (this.g != 0) {
if (build2.getGroup() != null && (build2.flags & DataDecryptTool.DECRYPT_DB_FILE) != 0 && this.g == 2) {
a(build2);
}
if (build2.getGroup() != null && (build2.flags & DataDecryptTool.DECRYPT_DB_FILE) == 0 && this.g == 1) {
a(build2);
}
}
return build2;
}
if (i >= 20) {
this.a.setExtras(this.f);
Notification build3 = this.a.build();
RemoteViews remoteViews4 = this.c;
if (remoteViews4 != null) {
build3.contentView = remoteViews4;
}
RemoteViews remoteViews5 = this.d;
if (remoteViews5 != null) {
build3.bigContentView = remoteViews5;
}
if (this.g != 0) {
if (build3.getGroup() != null && (build3.flags & DataDecryptTool.DECRYPT_DB_FILE) != 0 && this.g == 2) {
a(build3);
}
if (build3.getGroup() != null && (build3.flags & DataDecryptTool.DECRYPT_DB_FILE) == 0 && this.g == 1) {
a(build3);
}
}
return build3;
}
if (i >= 19) {
SparseArray<Bundle> a = NotificationCompatJellybean.a(this.e);
if (a != null) {
this.f.putSparseParcelableArray("android.support.actionExtras", a);
}
this.a.setExtras(this.f);
Notification build4 = this.a.build();
RemoteViews remoteViews6 = this.c;
if (remoteViews6 != null) {
build4.contentView = remoteViews6;
}
RemoteViews remoteViews7 = this.d;
if (remoteViews7 != null) {
build4.bigContentView = remoteViews7;
}
return build4;
}
if (i < 16) {
return this.a.getNotification();
}
Notification build5 = this.a.build();
Bundle a2 = NotificationCompat.a(build5);
Bundle bundle = new Bundle(this.f);
for (String str : this.f.keySet()) {
if (a2.containsKey(str)) {
bundle.remove(str);
}
}
a2.putAll(bundle);
SparseArray<Bundle> a3 = NotificationCompatJellybean.a(this.e);
if (a3 != null) {
NotificationCompat.a(build5).putSparseParcelableArray("android.support.actionExtras", a3);
}
RemoteViews remoteViews8 = this.c;
if (remoteViews8 != null) {
build5.contentView = remoteViews8;
}
RemoteViews remoteViews9 = this.d;
if (remoteViews9 != null) {
build5.bigContentView = remoteViews9;
}
return build5;
}
private void a(NotificationCompat.Action action) {
int i = Build.VERSION.SDK_INT;
if (i < 20) {
if (i >= 16) {
this.e.add(NotificationCompatJellybean.a(this.a, action));
return;
}
return;
}
Notification.Action.Builder builder = new Notification.Action.Builder(action.e(), action.i(), action.a());
if (action.f() != null) {
for (android.app.RemoteInput remoteInput : RemoteInput.a(action.f())) {
builder.addRemoteInput(remoteInput);
}
}
Bundle bundle = action.d() != null ? new Bundle(action.d()) : new Bundle();
bundle.putBoolean("android.support.allowGeneratedReplies", action.b());
if (Build.VERSION.SDK_INT >= 24) {
builder.setAllowGeneratedReplies(action.b());
}
bundle.putInt("android.support.action.semanticAction", action.g());
if (Build.VERSION.SDK_INT >= 28) {
builder.setSemanticAction(action.g());
}
bundle.putBoolean("android.support.action.showsUserInterface", action.h());
builder.addExtras(bundle);
this.a.addAction(builder.build());
}
private void a(Notification notification) {
notification.sound = null;
notification.vibrate = null;
notification.defaults &= -2;
notification.defaults &= -3;
}
}

View File

@@ -0,0 +1,115 @@
package androidx.core.app;
import android.app.Notification;
import android.os.Bundle;
import android.util.Log;
import android.util.SparseArray;
import androidx.core.app.NotificationCompat;
import java.lang.reflect.Field;
import java.util.List;
/* loaded from: classes.dex */
class NotificationCompatJellybean {
private static final Object a = new Object();
private static Field b;
private static boolean c;
public static SparseArray<Bundle> a(List<Bundle> list) {
int size = list.size();
SparseArray<Bundle> sparseArray = null;
for (int i = 0; i < size; i++) {
Bundle bundle = list.get(i);
if (bundle != null) {
if (sparseArray == null) {
sparseArray = new SparseArray<>();
}
sparseArray.put(i, bundle);
}
}
return sparseArray;
}
public static Bundle a(Notification notification) {
synchronized (a) {
if (c) {
return null;
}
try {
if (b == null) {
Field declaredField = Notification.class.getDeclaredField("extras");
if (!Bundle.class.isAssignableFrom(declaredField.getType())) {
Log.e("NotificationCompat", "Notification.extras field is not of type Bundle");
c = true;
return null;
}
declaredField.setAccessible(true);
b = declaredField;
}
Bundle bundle = (Bundle) b.get(notification);
if (bundle == null) {
bundle = new Bundle();
b.set(notification, bundle);
}
return bundle;
} catch (IllegalAccessException e) {
Log.e("NotificationCompat", "Unable to access notification extras", e);
c = true;
return null;
} catch (NoSuchFieldException e2) {
Log.e("NotificationCompat", "Unable to access notification extras", e2);
c = true;
return null;
}
}
}
public static Bundle a(Notification.Builder builder, NotificationCompat.Action action) {
builder.addAction(action.e(), action.i(), action.a());
Bundle bundle = new Bundle(action.d());
if (action.f() != null) {
bundle.putParcelableArray("android.support.remoteInputs", a(action.f()));
}
if (action.c() != null) {
bundle.putParcelableArray("android.support.dataRemoteInputs", a(action.c()));
}
bundle.putBoolean("android.support.allowGeneratedReplies", action.b());
return bundle;
}
static Bundle a(NotificationCompat.Action action) {
Bundle bundle;
Bundle bundle2 = new Bundle();
bundle2.putInt("icon", action.e());
bundle2.putCharSequence("title", action.i());
bundle2.putParcelable("actionIntent", action.a());
if (action.d() != null) {
bundle = new Bundle(action.d());
} else {
bundle = new Bundle();
}
bundle.putBoolean("android.support.allowGeneratedReplies", action.b());
bundle2.putBundle("extras", bundle);
bundle2.putParcelableArray("remoteInputs", a(action.f()));
bundle2.putBoolean("showsUserInterface", action.h());
bundle2.putInt("semanticAction", action.g());
return bundle2;
}
private static Bundle a(RemoteInput remoteInput) {
new Bundle();
remoteInput.a();
throw null;
}
private static Bundle[] a(RemoteInput[] remoteInputArr) {
if (remoteInputArr == null) {
return null;
}
Bundle[] bundleArr = new Bundle[remoteInputArr.length];
if (remoteInputArr.length <= 0) {
return bundleArr;
}
a(remoteInputArr[0]);
throw null;
}
}

View File

@@ -0,0 +1,74 @@
package androidx.core.app;
import android.app.Notification;
import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.Build;
import android.os.IBinder;
import android.os.RemoteException;
import android.support.v4.app.INotificationSideChannel;
/* loaded from: classes.dex */
public abstract class NotificationCompatSideChannelService extends Service {
void a(int i, String str) {
for (String str2 : getPackageManager().getPackagesForUid(i)) {
if (str2.equals(str)) {
return;
}
}
throw new SecurityException("NotificationSideChannelService: Uid " + i + " is not authorized for package " + str);
}
public abstract void a(String str);
public abstract void a(String str, int i, String str2);
public abstract void a(String str, int i, String str2, Notification notification);
@Override // android.app.Service
public IBinder onBind(Intent intent) {
if (!intent.getAction().equals("android.support.BIND_NOTIFICATION_SIDE_CHANNEL") || Build.VERSION.SDK_INT > 19) {
return null;
}
return new NotificationSideChannelStub();
}
private class NotificationSideChannelStub extends INotificationSideChannel.Stub {
NotificationSideChannelStub() {
}
@Override // android.support.v4.app.INotificationSideChannel
public void a(String str, int i, String str2, Notification notification) throws RemoteException {
NotificationCompatSideChannelService.this.a(Binder.getCallingUid(), str);
long clearCallingIdentity = Binder.clearCallingIdentity();
try {
NotificationCompatSideChannelService.this.a(str, i, str2, notification);
} finally {
Binder.restoreCallingIdentity(clearCallingIdentity);
}
}
@Override // android.support.v4.app.INotificationSideChannel
public void a(String str, int i, String str2) throws RemoteException {
NotificationCompatSideChannelService.this.a(Binder.getCallingUid(), str);
long clearCallingIdentity = Binder.clearCallingIdentity();
try {
NotificationCompatSideChannelService.this.a(str, i, str2);
} finally {
Binder.restoreCallingIdentity(clearCallingIdentity);
}
}
@Override // android.support.v4.app.INotificationSideChannel
public void a(String str) {
NotificationCompatSideChannelService.this.a(Binder.getCallingUid(), str);
long clearCallingIdentity = Binder.clearCallingIdentity();
try {
NotificationCompatSideChannelService.this.a(str);
} finally {
Binder.restoreCallingIdentity(clearCallingIdentity);
}
}
}
}

View File

@@ -0,0 +1,25 @@
package androidx.core.app;
/* loaded from: classes.dex */
public final class RemoteInput {
static android.app.RemoteInput[] a(RemoteInput[] remoteInputArr) {
if (remoteInputArr == null) {
return null;
}
android.app.RemoteInput[] remoteInputArr2 = new android.app.RemoteInput[remoteInputArr.length];
if (remoteInputArr.length <= 0) {
return remoteInputArr2;
}
a(remoteInputArr[0]);
throw null;
}
public String a() {
throw null;
}
static android.app.RemoteInput a(RemoteInput remoteInput) {
remoteInput.a();
throw null;
}
}

View File

@@ -0,0 +1,30 @@
package androidx.core.app;
import android.content.Context;
import android.graphics.Matrix;
import android.graphics.RectF;
import android.os.Parcelable;
import android.view.View;
import java.util.List;
import java.util.Map;
/* loaded from: classes.dex */
public abstract class SharedElementCallback {
public interface OnSharedElementsReadyListener {
}
public abstract Parcelable a(View view, Matrix matrix, RectF rectF);
public abstract View a(Context context, Parcelable parcelable);
public abstract void a(List<View> list);
public abstract void a(List<String> list, List<View> list2, OnSharedElementsReadyListener onSharedElementsReadyListener);
public abstract void a(List<String> list, List<View> list2, List<View> list3);
public abstract void a(List<String> list, Map<String, View> map);
public abstract void b(List<String> list, List<View> list2, List<View> list3);
}

View File

@@ -0,0 +1,93 @@
package androidx.core.app;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;
import androidx.core.content.ContextCompat;
import java.util.ArrayList;
import java.util.Iterator;
/* loaded from: classes.dex */
public final class TaskStackBuilder implements Iterable<Intent> {
private final ArrayList<Intent> a = new ArrayList<>();
private final Context b;
public interface SupportParentable {
Intent getSupportParentActivityIntent();
}
private TaskStackBuilder(Context context) {
this.b = context;
}
public static TaskStackBuilder a(Context context) {
return new TaskStackBuilder(context);
}
@Override // java.lang.Iterable
@Deprecated
public Iterator<Intent> iterator() {
return this.a.iterator();
}
public TaskStackBuilder a(Intent intent) {
this.a.add(intent);
return this;
}
/* JADX WARN: Multi-variable type inference failed */
public TaskStackBuilder a(Activity activity) {
Intent supportParentActivityIntent = activity instanceof SupportParentable ? ((SupportParentable) activity).getSupportParentActivityIntent() : null;
if (supportParentActivityIntent == null) {
supportParentActivityIntent = NavUtils.a(activity);
}
if (supportParentActivityIntent != null) {
ComponentName component = supportParentActivityIntent.getComponent();
if (component == null) {
component = supportParentActivityIntent.resolveActivity(this.b.getPackageManager());
}
a(component);
a(supportParentActivityIntent);
}
return this;
}
public TaskStackBuilder a(ComponentName componentName) {
int size = this.a.size();
try {
Intent a = NavUtils.a(this.b, componentName);
while (a != null) {
this.a.add(size, a);
a = NavUtils.a(this.b, a.getComponent());
}
return this;
} catch (PackageManager.NameNotFoundException e) {
Log.e("TaskStackBuilder", "Bad ComponentName while traversing activity parent metadata");
throw new IllegalArgumentException(e);
}
}
public void a() {
a((Bundle) null);
}
public void a(Bundle bundle) {
if (!this.a.isEmpty()) {
ArrayList<Intent> arrayList = this.a;
Intent[] intentArr = (Intent[]) arrayList.toArray(new Intent[arrayList.size()]);
intentArr[0] = new Intent(intentArr[0]).addFlags(268484608);
if (ContextCompat.a(this.b, intentArr, bundle)) {
return;
}
Intent intent = new Intent(intentArr[intentArr.length - 1]);
intent.addFlags(268435456);
this.b.startActivity(intent);
return;
}
throw new IllegalStateException("No intents added to TaskStackBuilder; cannot startActivities");
}
}