Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
package androidx.activity;
/* loaded from: classes.dex */
public interface Cancellable {
void cancel();
}

View File

@@ -0,0 +1,881 @@
package androidx.activity;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.Window;
import android.window.OnBackInvokedDispatcher;
import androidx.activity.ComponentActivity;
import androidx.activity.contextaware.ContextAware;
import androidx.activity.contextaware.ContextAwareHelper;
import androidx.activity.contextaware.OnContextAvailableListener;
import androidx.activity.result.ActivityResultCallback;
import androidx.activity.result.ActivityResultCaller;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.ActivityResultRegistry;
import androidx.activity.result.ActivityResultRegistryOwner;
import androidx.activity.result.IntentSenderRequest;
import androidx.activity.result.contract.ActivityResultContract;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.annotation.CallSuper;
import androidx.annotation.ContentView;
import androidx.annotation.DoNotInline;
import androidx.annotation.LayoutRes;
import androidx.annotation.MainThread;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.OptIn;
import androidx.annotation.RequiresApi;
import androidx.core.app.ActivityCompat;
import androidx.core.app.ActivityOptionsCompat;
import androidx.core.app.MultiWindowModeChangedInfo;
import androidx.core.app.OnMultiWindowModeChangedProvider;
import androidx.core.app.OnNewIntentProvider;
import androidx.core.app.OnPictureInPictureModeChangedProvider;
import androidx.core.app.PictureInPictureModeChangedInfo;
import androidx.core.content.OnConfigurationChangedProvider;
import androidx.core.content.OnTrimMemoryProvider;
import androidx.core.os.BuildCompat;
import androidx.core.util.Consumer;
import androidx.core.view.MenuHost;
import androidx.core.view.MenuHostHelper;
import androidx.core.view.MenuProvider;
import androidx.lifecycle.HasDefaultViewModelProviderFactory;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleEventObserver;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LifecycleRegistry;
import androidx.lifecycle.ReportFragment;
import androidx.lifecycle.SavedStateHandleSupport;
import androidx.lifecycle.SavedStateViewModelFactory;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.ViewModelStoreOwner;
import androidx.lifecycle.ViewTreeLifecycleOwner;
import androidx.lifecycle.ViewTreeViewModelStoreOwner;
import androidx.lifecycle.viewmodel.CreationExtras;
import androidx.lifecycle.viewmodel.MutableCreationExtras;
import androidx.savedstate.SavedStateRegistry;
import androidx.savedstate.SavedStateRegistryController;
import androidx.savedstate.SavedStateRegistryOwner;
import androidx.savedstate.ViewTreeSavedStateRegistryOwner;
import androidx.tracing.Trace;
import androidx.work.WorkRequest;
import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicInteger;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
/* loaded from: classes.dex */
public class ComponentActivity extends androidx.core.app.ComponentActivity implements ContextAware, LifecycleOwner, ViewModelStoreOwner, HasDefaultViewModelProviderFactory, SavedStateRegistryOwner, OnBackPressedDispatcherOwner, ActivityResultRegistryOwner, ActivityResultCaller, OnConfigurationChangedProvider, OnTrimMemoryProvider, OnNewIntentProvider, OnMultiWindowModeChangedProvider, OnPictureInPictureModeChangedProvider, MenuHost, FullyDrawnReporterOwner {
private static final String ACTIVITY_RESULT_TAG = "android:support:activity-result";
private final ActivityResultRegistry mActivityResultRegistry;
@LayoutRes
private int mContentLayoutId;
final ContextAwareHelper mContextAwareHelper;
private ViewModelProvider.Factory mDefaultFactory;
private boolean mDispatchingOnMultiWindowModeChanged;
private boolean mDispatchingOnPictureInPictureModeChanged;
@NonNull
final FullyDrawnReporter mFullyDrawnReporter;
private final LifecycleRegistry mLifecycleRegistry;
private final MenuHostHelper mMenuHostHelper;
private final AtomicInteger mNextLocalRequestCode;
private final OnBackPressedDispatcher mOnBackPressedDispatcher;
private final CopyOnWriteArrayList<Consumer<Configuration>> mOnConfigurationChangedListeners;
private final CopyOnWriteArrayList<Consumer<MultiWindowModeChangedInfo>> mOnMultiWindowModeChangedListeners;
private final CopyOnWriteArrayList<Consumer<Intent>> mOnNewIntentListeners;
private final CopyOnWriteArrayList<Consumer<PictureInPictureModeChangedInfo>> mOnPictureInPictureModeChangedListeners;
private final CopyOnWriteArrayList<Consumer<Integer>> mOnTrimMemoryListeners;
private final ReportFullyDrawnExecutor mReportFullyDrawnExecutor;
final SavedStateRegistryController mSavedStateRegistryController;
private ViewModelStore mViewModelStore;
public static final class NonConfigurationInstances {
Object custom;
ViewModelStore viewModelStore;
}
public interface ReportFullyDrawnExecutor extends Executor {
void viewCreated(@NonNull View view);
}
@Override // androidx.activity.result.ActivityResultRegistryOwner
@NonNull
public final ActivityResultRegistry getActivityResultRegistry() {
return this.mActivityResultRegistry;
}
@Override // androidx.activity.FullyDrawnReporterOwner
@NonNull
public FullyDrawnReporter getFullyDrawnReporter() {
return this.mFullyDrawnReporter;
}
@Override // androidx.core.app.ComponentActivity, androidx.lifecycle.LifecycleOwner
@NonNull
public Lifecycle getLifecycle() {
return this.mLifecycleRegistry;
}
@Override // androidx.activity.OnBackPressedDispatcherOwner
@NonNull
public final OnBackPressedDispatcher getOnBackPressedDispatcher() {
return this.mOnBackPressedDispatcher;
}
@Nullable
@Deprecated
public Object onRetainCustomNonConfigurationInstance() {
return null;
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ Unit lambda$new$0() {
reportFullyDrawn();
return null;
}
public ComponentActivity() {
this.mContextAwareHelper = new ContextAwareHelper();
this.mMenuHostHelper = new MenuHostHelper(new Runnable() { // from class: androidx.activity.ComponentActivity$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
ComponentActivity.this.invalidateMenu();
}
});
this.mLifecycleRegistry = new LifecycleRegistry(this);
SavedStateRegistryController create = SavedStateRegistryController.create(this);
this.mSavedStateRegistryController = create;
this.mOnBackPressedDispatcher = new OnBackPressedDispatcher(new Runnable() { // from class: androidx.activity.ComponentActivity.1
@Override // java.lang.Runnable
public void run() {
try {
ComponentActivity.super.onBackPressed();
} catch (IllegalStateException e) {
if (!TextUtils.equals(e.getMessage(), "Can not perform this action after onSaveInstanceState")) {
throw e;
}
}
}
});
ReportFullyDrawnExecutor createFullyDrawnExecutor = createFullyDrawnExecutor();
this.mReportFullyDrawnExecutor = createFullyDrawnExecutor;
this.mFullyDrawnReporter = new FullyDrawnReporter(createFullyDrawnExecutor, new Function0() { // from class: androidx.activity.ComponentActivity$$ExternalSyntheticLambda1
@Override // kotlin.jvm.functions.Function0
public final Object invoke() {
Unit lambda$new$0;
lambda$new$0 = ComponentActivity.this.lambda$new$0();
return lambda$new$0;
}
});
this.mNextLocalRequestCode = new AtomicInteger();
this.mActivityResultRegistry = new ActivityResultRegistry() { // from class: androidx.activity.ComponentActivity.2
@Override // androidx.activity.result.ActivityResultRegistry
public <I, O> void onLaunch(final int i, @NonNull ActivityResultContract<I, O> activityResultContract, I i2, @Nullable ActivityOptionsCompat activityOptionsCompat) {
Bundle bundle;
ComponentActivity componentActivity = ComponentActivity.this;
final ActivityResultContract.SynchronousResult<O> synchronousResult = activityResultContract.getSynchronousResult(componentActivity, i2);
if (synchronousResult != null) {
new Handler(Looper.getMainLooper()).post(new Runnable() { // from class: androidx.activity.ComponentActivity.2.1
@Override // java.lang.Runnable
public void run() {
dispatchResult(i, synchronousResult.getValue());
}
});
return;
}
Intent createIntent = activityResultContract.createIntent(componentActivity, i2);
if (createIntent.getExtras() != null && createIntent.getExtras().getClassLoader() == null) {
createIntent.setExtrasClassLoader(componentActivity.getClassLoader());
}
if (createIntent.hasExtra(ActivityResultContracts.StartActivityForResult.EXTRA_ACTIVITY_OPTIONS_BUNDLE)) {
Bundle bundleExtra = createIntent.getBundleExtra(ActivityResultContracts.StartActivityForResult.EXTRA_ACTIVITY_OPTIONS_BUNDLE);
createIntent.removeExtra(ActivityResultContracts.StartActivityForResult.EXTRA_ACTIVITY_OPTIONS_BUNDLE);
bundle = bundleExtra;
} else {
bundle = activityOptionsCompat != null ? activityOptionsCompat.toBundle() : null;
}
if (ActivityResultContracts.RequestMultiplePermissions.ACTION_REQUEST_PERMISSIONS.equals(createIntent.getAction())) {
String[] stringArrayExtra = createIntent.getStringArrayExtra(ActivityResultContracts.RequestMultiplePermissions.EXTRA_PERMISSIONS);
if (stringArrayExtra == null) {
stringArrayExtra = new String[0];
}
ActivityCompat.requestPermissions(componentActivity, stringArrayExtra, i);
return;
}
if (ActivityResultContracts.StartIntentSenderForResult.ACTION_INTENT_SENDER_REQUEST.equals(createIntent.getAction())) {
IntentSenderRequest intentSenderRequest = (IntentSenderRequest) createIntent.getParcelableExtra(ActivityResultContracts.StartIntentSenderForResult.EXTRA_INTENT_SENDER_REQUEST);
try {
ActivityCompat.startIntentSenderForResult(componentActivity, intentSenderRequest.getIntentSender(), i, intentSenderRequest.getFillInIntent(), intentSenderRequest.getFlagsMask(), intentSenderRequest.getFlagsValues(), 0, bundle);
return;
} catch (IntentSender.SendIntentException e) {
new Handler(Looper.getMainLooper()).post(new Runnable() { // from class: androidx.activity.ComponentActivity.2.2
@Override // java.lang.Runnable
public void run() {
dispatchResult(i, 0, new Intent().setAction(ActivityResultContracts.StartIntentSenderForResult.ACTION_INTENT_SENDER_REQUEST).putExtra(ActivityResultContracts.StartIntentSenderForResult.EXTRA_SEND_INTENT_EXCEPTION, e));
}
});
return;
}
}
ActivityCompat.startActivityForResult(componentActivity, createIntent, i, bundle);
}
};
this.mOnConfigurationChangedListeners = new CopyOnWriteArrayList<>();
this.mOnTrimMemoryListeners = new CopyOnWriteArrayList<>();
this.mOnNewIntentListeners = new CopyOnWriteArrayList<>();
this.mOnMultiWindowModeChangedListeners = new CopyOnWriteArrayList<>();
this.mOnPictureInPictureModeChangedListeners = new CopyOnWriteArrayList<>();
this.mDispatchingOnMultiWindowModeChanged = false;
this.mDispatchingOnPictureInPictureModeChanged = false;
if (getLifecycle() == null) {
throw new IllegalStateException("getLifecycle() returned null in ComponentActivity's constructor. Please make sure you are lazily constructing your Lifecycle in the first call to getLifecycle() rather than relying on field initialization.");
}
getLifecycle().addObserver(new LifecycleEventObserver() { // from class: androidx.activity.ComponentActivity.3
@Override // androidx.lifecycle.LifecycleEventObserver
public void onStateChanged(@NonNull LifecycleOwner lifecycleOwner, @NonNull Lifecycle.Event event) {
if (event == Lifecycle.Event.ON_STOP) {
Window window = ComponentActivity.this.getWindow();
View peekDecorView = window != null ? window.peekDecorView() : null;
if (peekDecorView != null) {
Api19Impl.cancelPendingInputEvents(peekDecorView);
}
}
}
});
getLifecycle().addObserver(new LifecycleEventObserver() { // from class: androidx.activity.ComponentActivity.4
@Override // androidx.lifecycle.LifecycleEventObserver
public void onStateChanged(@NonNull LifecycleOwner lifecycleOwner, @NonNull Lifecycle.Event event) {
if (event == Lifecycle.Event.ON_DESTROY) {
ComponentActivity.this.mContextAwareHelper.clearAvailableContext();
if (ComponentActivity.this.isChangingConfigurations()) {
return;
}
ComponentActivity.this.getViewModelStore().clear();
}
}
});
getLifecycle().addObserver(new LifecycleEventObserver() { // from class: androidx.activity.ComponentActivity.5
@Override // androidx.lifecycle.LifecycleEventObserver
public void onStateChanged(@NonNull LifecycleOwner lifecycleOwner, @NonNull Lifecycle.Event event) {
ComponentActivity.this.ensureViewModelStore();
ComponentActivity.this.getLifecycle().removeObserver(this);
}
});
create.performAttach();
SavedStateHandleSupport.enableSavedStateHandles(this);
getSavedStateRegistry().registerSavedStateProvider(ACTIVITY_RESULT_TAG, new SavedStateRegistry.SavedStateProvider() { // from class: androidx.activity.ComponentActivity$$ExternalSyntheticLambda2
@Override // androidx.savedstate.SavedStateRegistry.SavedStateProvider
public final Bundle saveState() {
Bundle lambda$new$1;
lambda$new$1 = ComponentActivity.this.lambda$new$1();
return lambda$new$1;
}
});
addOnContextAvailableListener(new OnContextAvailableListener() { // from class: androidx.activity.ComponentActivity$$ExternalSyntheticLambda3
@Override // androidx.activity.contextaware.OnContextAvailableListener
public final void onContextAvailable(Context context) {
ComponentActivity.this.lambda$new$2(context);
}
});
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ Bundle lambda$new$1() {
Bundle bundle = new Bundle();
this.mActivityResultRegistry.onSaveInstanceState(bundle);
return bundle;
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void lambda$new$2(Context context) {
Bundle consumeRestoredStateForKey = getSavedStateRegistry().consumeRestoredStateForKey(ACTIVITY_RESULT_TAG);
if (consumeRestoredStateForKey != null) {
this.mActivityResultRegistry.onRestoreInstanceState(consumeRestoredStateForKey);
}
}
@ContentView
public ComponentActivity(@LayoutRes int i) {
this();
this.mContentLayoutId = i;
}
@Override // androidx.core.app.ComponentActivity, android.app.Activity
@OptIn(markerClass = {BuildCompat.PrereleaseSdkCheck.class})
public void onCreate(@Nullable Bundle bundle) {
this.mSavedStateRegistryController.performRestore(bundle);
this.mContextAwareHelper.dispatchOnContextAvailable(this);
super.onCreate(bundle);
ReportFragment.injectIfNeededIn(this);
if (BuildCompat.isAtLeastT()) {
this.mOnBackPressedDispatcher.setOnBackInvokedDispatcher(Api33Impl.getOnBackInvokedDispatcher(this));
}
int i = this.mContentLayoutId;
if (i != 0) {
setContentView(i);
}
}
@Override // androidx.core.app.ComponentActivity, android.app.Activity
@CallSuper
public void onSaveInstanceState(@NonNull Bundle bundle) {
Lifecycle lifecycle = getLifecycle();
if (lifecycle instanceof LifecycleRegistry) {
((LifecycleRegistry) lifecycle).setCurrentState(Lifecycle.State.CREATED);
}
super.onSaveInstanceState(bundle);
this.mSavedStateRegistryController.performSave(bundle);
}
@Override // android.app.Activity
@Nullable
public final Object onRetainNonConfigurationInstance() {
NonConfigurationInstances nonConfigurationInstances;
Object onRetainCustomNonConfigurationInstance = onRetainCustomNonConfigurationInstance();
ViewModelStore viewModelStore = this.mViewModelStore;
if (viewModelStore == null && (nonConfigurationInstances = (NonConfigurationInstances) getLastNonConfigurationInstance()) != null) {
viewModelStore = nonConfigurationInstances.viewModelStore;
}
if (viewModelStore == null && onRetainCustomNonConfigurationInstance == null) {
return null;
}
NonConfigurationInstances nonConfigurationInstances2 = new NonConfigurationInstances();
nonConfigurationInstances2.custom = onRetainCustomNonConfigurationInstance;
nonConfigurationInstances2.viewModelStore = viewModelStore;
return nonConfigurationInstances2;
}
@Nullable
@Deprecated
public Object getLastCustomNonConfigurationInstance() {
NonConfigurationInstances nonConfigurationInstances = (NonConfigurationInstances) getLastNonConfigurationInstance();
if (nonConfigurationInstances != null) {
return nonConfigurationInstances.custom;
}
return null;
}
@Override // android.app.Activity
public void setContentView(@LayoutRes int i) {
initViewTreeOwners();
this.mReportFullyDrawnExecutor.viewCreated(getWindow().getDecorView());
super.setContentView(i);
}
@Override // android.app.Activity
public void setContentView(@SuppressLint({"UnknownNullness", "MissingNullability"}) View view) {
initViewTreeOwners();
this.mReportFullyDrawnExecutor.viewCreated(getWindow().getDecorView());
super.setContentView(view);
}
@Override // android.app.Activity
public void setContentView(@SuppressLint({"UnknownNullness", "MissingNullability"}) View view, @SuppressLint({"UnknownNullness", "MissingNullability"}) ViewGroup.LayoutParams layoutParams) {
initViewTreeOwners();
this.mReportFullyDrawnExecutor.viewCreated(getWindow().getDecorView());
super.setContentView(view, layoutParams);
}
@Override // android.app.Activity
public void addContentView(@SuppressLint({"UnknownNullness", "MissingNullability"}) View view, @SuppressLint({"UnknownNullness", "MissingNullability"}) ViewGroup.LayoutParams layoutParams) {
initViewTreeOwners();
this.mReportFullyDrawnExecutor.viewCreated(getWindow().getDecorView());
super.addContentView(view, layoutParams);
}
private void initViewTreeOwners() {
ViewTreeLifecycleOwner.set(getWindow().getDecorView(), this);
ViewTreeViewModelStoreOwner.set(getWindow().getDecorView(), this);
ViewTreeSavedStateRegistryOwner.set(getWindow().getDecorView(), this);
ViewTreeOnBackPressedDispatcherOwner.set(getWindow().getDecorView(), this);
ViewTreeFullyDrawnReporterOwner.set(getWindow().getDecorView(), this);
}
@Override // androidx.activity.contextaware.ContextAware
@Nullable
public Context peekAvailableContext() {
return this.mContextAwareHelper.peekAvailableContext();
}
@Override // androidx.activity.contextaware.ContextAware
public final void addOnContextAvailableListener(@NonNull OnContextAvailableListener onContextAvailableListener) {
this.mContextAwareHelper.addOnContextAvailableListener(onContextAvailableListener);
}
@Override // androidx.activity.contextaware.ContextAware
public final void removeOnContextAvailableListener(@NonNull OnContextAvailableListener onContextAvailableListener) {
this.mContextAwareHelper.removeOnContextAvailableListener(onContextAvailableListener);
}
@Override // android.app.Activity, android.view.Window.Callback
public boolean onPreparePanel(int i, @Nullable View view, @NonNull Menu menu) {
if (i != 0) {
return true;
}
super.onPreparePanel(i, view, menu);
this.mMenuHostHelper.onPrepareMenu(menu);
return true;
}
@Override // android.app.Activity, android.view.Window.Callback
public boolean onCreatePanelMenu(int i, @NonNull Menu menu) {
if (i != 0) {
return true;
}
super.onCreatePanelMenu(i, menu);
this.mMenuHostHelper.onCreateMenu(menu, getMenuInflater());
return true;
}
@Override // android.app.Activity, android.view.Window.Callback
public boolean onMenuItemSelected(int i, @NonNull MenuItem menuItem) {
if (super.onMenuItemSelected(i, menuItem)) {
return true;
}
if (i == 0) {
return this.mMenuHostHelper.onMenuItemSelected(menuItem);
}
return false;
}
@Override // android.app.Activity, android.view.Window.Callback
public void onPanelClosed(int i, @NonNull Menu menu) {
this.mMenuHostHelper.onMenuClosed(menu);
super.onPanelClosed(i, menu);
}
@Override // androidx.core.view.MenuHost
public void addMenuProvider(@NonNull MenuProvider menuProvider) {
this.mMenuHostHelper.addMenuProvider(menuProvider);
}
@Override // androidx.core.view.MenuHost
public void addMenuProvider(@NonNull MenuProvider menuProvider, @NonNull LifecycleOwner lifecycleOwner) {
this.mMenuHostHelper.addMenuProvider(menuProvider, lifecycleOwner);
}
@Override // androidx.core.view.MenuHost
@SuppressLint({"LambdaLast"})
public void addMenuProvider(@NonNull MenuProvider menuProvider, @NonNull LifecycleOwner lifecycleOwner, @NonNull Lifecycle.State state) {
this.mMenuHostHelper.addMenuProvider(menuProvider, lifecycleOwner, state);
}
@Override // androidx.core.view.MenuHost
public void removeMenuProvider(@NonNull MenuProvider menuProvider) {
this.mMenuHostHelper.removeMenuProvider(menuProvider);
}
@Override // androidx.core.view.MenuHost
public void invalidateMenu() {
invalidateOptionsMenu();
}
@Override // androidx.lifecycle.ViewModelStoreOwner
@NonNull
public ViewModelStore getViewModelStore() {
if (getApplication() == null) {
throw new IllegalStateException("Your activity is not yet attached to the Application instance. You can't request ViewModel before onCreate call.");
}
ensureViewModelStore();
return this.mViewModelStore;
}
public void ensureViewModelStore() {
if (this.mViewModelStore == null) {
NonConfigurationInstances nonConfigurationInstances = (NonConfigurationInstances) getLastNonConfigurationInstance();
if (nonConfigurationInstances != null) {
this.mViewModelStore = nonConfigurationInstances.viewModelStore;
}
if (this.mViewModelStore == null) {
this.mViewModelStore = new ViewModelStore();
}
}
}
@Override // androidx.lifecycle.HasDefaultViewModelProviderFactory
@NonNull
public ViewModelProvider.Factory getDefaultViewModelProviderFactory() {
if (this.mDefaultFactory == null) {
this.mDefaultFactory = new SavedStateViewModelFactory(getApplication(), this, getIntent() != null ? getIntent().getExtras() : null);
}
return this.mDefaultFactory;
}
@Override // androidx.lifecycle.HasDefaultViewModelProviderFactory
@NonNull
@CallSuper
public CreationExtras getDefaultViewModelCreationExtras() {
MutableCreationExtras mutableCreationExtras = new MutableCreationExtras();
if (getApplication() != null) {
mutableCreationExtras.set(ViewModelProvider.AndroidViewModelFactory.APPLICATION_KEY, getApplication());
}
mutableCreationExtras.set(SavedStateHandleSupport.SAVED_STATE_REGISTRY_OWNER_KEY, this);
mutableCreationExtras.set(SavedStateHandleSupport.VIEW_MODEL_STORE_OWNER_KEY, this);
if (getIntent() != null && getIntent().getExtras() != null) {
mutableCreationExtras.set(SavedStateHandleSupport.DEFAULT_ARGS_KEY, getIntent().getExtras());
}
return mutableCreationExtras;
}
@Override // android.app.Activity
@MainThread
public void onBackPressed() {
this.mOnBackPressedDispatcher.onBackPressed();
}
@Override // androidx.savedstate.SavedStateRegistryOwner
@NonNull
public final SavedStateRegistry getSavedStateRegistry() {
return this.mSavedStateRegistryController.getSavedStateRegistry();
}
@Override // android.app.Activity
@Deprecated
public void startActivityForResult(@NonNull Intent intent, int i) {
super.startActivityForResult(intent, i);
}
@Override // android.app.Activity
@Deprecated
public void startActivityForResult(@NonNull Intent intent, int i, @Nullable Bundle bundle) {
super.startActivityForResult(intent, i, bundle);
}
@Override // android.app.Activity
@Deprecated
public void startIntentSenderForResult(@NonNull IntentSender intentSender, int i, @Nullable Intent intent, int i2, int i3, int i4) throws IntentSender.SendIntentException {
super.startIntentSenderForResult(intentSender, i, intent, i2, i3, i4);
}
@Override // android.app.Activity
@Deprecated
public void startIntentSenderForResult(@NonNull IntentSender intentSender, int i, @Nullable Intent intent, int i2, int i3, int i4, @Nullable Bundle bundle) throws IntentSender.SendIntentException {
super.startIntentSenderForResult(intentSender, i, intent, i2, i3, i4, bundle);
}
@Override // android.app.Activity
@CallSuper
@Deprecated
public void onActivityResult(int i, int i2, @Nullable Intent intent) {
if (this.mActivityResultRegistry.dispatchResult(i, i2, intent)) {
return;
}
super.onActivityResult(i, i2, intent);
}
@Override // android.app.Activity
@CallSuper
@Deprecated
public void onRequestPermissionsResult(int i, @NonNull String[] strArr, @NonNull int[] iArr) {
if (this.mActivityResultRegistry.dispatchResult(i, -1, new Intent().putExtra(ActivityResultContracts.RequestMultiplePermissions.EXTRA_PERMISSIONS, strArr).putExtra(ActivityResultContracts.RequestMultiplePermissions.EXTRA_PERMISSION_GRANT_RESULTS, iArr))) {
return;
}
super.onRequestPermissionsResult(i, strArr, iArr);
}
@Override // androidx.activity.result.ActivityResultCaller
@NonNull
public final <I, O> ActivityResultLauncher<I> registerForActivityResult(@NonNull ActivityResultContract<I, O> activityResultContract, @NonNull ActivityResultRegistry activityResultRegistry, @NonNull ActivityResultCallback<O> activityResultCallback) {
return activityResultRegistry.register("activity_rq#" + this.mNextLocalRequestCode.getAndIncrement(), this, activityResultContract, activityResultCallback);
}
@Override // androidx.activity.result.ActivityResultCaller
@NonNull
public final <I, O> ActivityResultLauncher<I> registerForActivityResult(@NonNull ActivityResultContract<I, O> activityResultContract, @NonNull ActivityResultCallback<O> activityResultCallback) {
return registerForActivityResult(activityResultContract, this.mActivityResultRegistry, activityResultCallback);
}
@Override // android.app.Activity, android.content.ComponentCallbacks
@CallSuper
public void onConfigurationChanged(@NonNull Configuration configuration) {
super.onConfigurationChanged(configuration);
Iterator<Consumer<Configuration>> it = this.mOnConfigurationChangedListeners.iterator();
while (it.hasNext()) {
it.next().accept(configuration);
}
}
@Override // androidx.core.content.OnConfigurationChangedProvider
public final void addOnConfigurationChangedListener(@NonNull Consumer<Configuration> consumer) {
this.mOnConfigurationChangedListeners.add(consumer);
}
@Override // androidx.core.content.OnConfigurationChangedProvider
public final void removeOnConfigurationChangedListener(@NonNull Consumer<Configuration> consumer) {
this.mOnConfigurationChangedListeners.remove(consumer);
}
@Override // android.app.Activity, android.content.ComponentCallbacks2
@CallSuper
public void onTrimMemory(int i) {
super.onTrimMemory(i);
Iterator<Consumer<Integer>> it = this.mOnTrimMemoryListeners.iterator();
while (it.hasNext()) {
it.next().accept(Integer.valueOf(i));
}
}
@Override // androidx.core.content.OnTrimMemoryProvider
public final void addOnTrimMemoryListener(@NonNull Consumer<Integer> consumer) {
this.mOnTrimMemoryListeners.add(consumer);
}
@Override // androidx.core.content.OnTrimMemoryProvider
public final void removeOnTrimMemoryListener(@NonNull Consumer<Integer> consumer) {
this.mOnTrimMemoryListeners.remove(consumer);
}
@Override // android.app.Activity
@CallSuper
public void onNewIntent(@SuppressLint({"UnknownNullness", "MissingNullability"}) Intent intent) {
super.onNewIntent(intent);
Iterator<Consumer<Intent>> it = this.mOnNewIntentListeners.iterator();
while (it.hasNext()) {
it.next().accept(intent);
}
}
@Override // androidx.core.app.OnNewIntentProvider
public final void addOnNewIntentListener(@NonNull Consumer<Intent> consumer) {
this.mOnNewIntentListeners.add(consumer);
}
@Override // androidx.core.app.OnNewIntentProvider
public final void removeOnNewIntentListener(@NonNull Consumer<Intent> consumer) {
this.mOnNewIntentListeners.remove(consumer);
}
@Override // android.app.Activity
@CallSuper
public void onMultiWindowModeChanged(boolean z) {
if (this.mDispatchingOnMultiWindowModeChanged) {
return;
}
Iterator<Consumer<MultiWindowModeChangedInfo>> it = this.mOnMultiWindowModeChangedListeners.iterator();
while (it.hasNext()) {
it.next().accept(new MultiWindowModeChangedInfo(z));
}
}
@Override // android.app.Activity
@RequiresApi(api = 26)
@CallSuper
public void onMultiWindowModeChanged(boolean z, @NonNull Configuration configuration) {
this.mDispatchingOnMultiWindowModeChanged = true;
try {
super.onMultiWindowModeChanged(z, configuration);
this.mDispatchingOnMultiWindowModeChanged = false;
Iterator<Consumer<MultiWindowModeChangedInfo>> it = this.mOnMultiWindowModeChangedListeners.iterator();
while (it.hasNext()) {
it.next().accept(new MultiWindowModeChangedInfo(z, configuration));
}
} catch (Throwable th) {
this.mDispatchingOnMultiWindowModeChanged = false;
throw th;
}
}
@Override // androidx.core.app.OnMultiWindowModeChangedProvider
public final void addOnMultiWindowModeChangedListener(@NonNull Consumer<MultiWindowModeChangedInfo> consumer) {
this.mOnMultiWindowModeChangedListeners.add(consumer);
}
@Override // androidx.core.app.OnMultiWindowModeChangedProvider
public final void removeOnMultiWindowModeChangedListener(@NonNull Consumer<MultiWindowModeChangedInfo> consumer) {
this.mOnMultiWindowModeChangedListeners.remove(consumer);
}
@Override // android.app.Activity
@CallSuper
public void onPictureInPictureModeChanged(boolean z) {
if (this.mDispatchingOnPictureInPictureModeChanged) {
return;
}
Iterator<Consumer<PictureInPictureModeChangedInfo>> it = this.mOnPictureInPictureModeChangedListeners.iterator();
while (it.hasNext()) {
it.next().accept(new PictureInPictureModeChangedInfo(z));
}
}
@Override // android.app.Activity
@RequiresApi(api = 26)
@CallSuper
public void onPictureInPictureModeChanged(boolean z, @NonNull Configuration configuration) {
this.mDispatchingOnPictureInPictureModeChanged = true;
try {
super.onPictureInPictureModeChanged(z, configuration);
this.mDispatchingOnPictureInPictureModeChanged = false;
Iterator<Consumer<PictureInPictureModeChangedInfo>> it = this.mOnPictureInPictureModeChangedListeners.iterator();
while (it.hasNext()) {
it.next().accept(new PictureInPictureModeChangedInfo(z, configuration));
}
} catch (Throwable th) {
this.mDispatchingOnPictureInPictureModeChanged = false;
throw th;
}
}
@Override // androidx.core.app.OnPictureInPictureModeChangedProvider
public final void addOnPictureInPictureModeChangedListener(@NonNull Consumer<PictureInPictureModeChangedInfo> consumer) {
this.mOnPictureInPictureModeChangedListeners.add(consumer);
}
@Override // androidx.core.app.OnPictureInPictureModeChangedProvider
public final void removeOnPictureInPictureModeChangedListener(@NonNull Consumer<PictureInPictureModeChangedInfo> consumer) {
this.mOnPictureInPictureModeChangedListeners.remove(consumer);
}
@Override // android.app.Activity
public void reportFullyDrawn() {
try {
if (Trace.isEnabled()) {
Trace.beginSection("reportFullyDrawn() for ComponentActivity");
}
super.reportFullyDrawn();
this.mFullyDrawnReporter.fullyDrawnReported();
Trace.endSection();
} catch (Throwable th) {
Trace.endSection();
throw th;
}
}
private ReportFullyDrawnExecutor createFullyDrawnExecutor() {
return new ReportFullyDrawnExecutorApi16Impl();
}
@RequiresApi(19)
public static class Api19Impl {
private Api19Impl() {
}
public static void cancelPendingInputEvents(View view) {
view.cancelPendingInputEvents();
}
}
@RequiresApi(33)
public static class Api33Impl {
private Api33Impl() {
}
@DoNotInline
public static OnBackInvokedDispatcher getOnBackInvokedDispatcher(Activity activity) {
return activity.getOnBackInvokedDispatcher();
}
}
public static class ReportFullyDrawnExecutorApi1 implements ReportFullyDrawnExecutor {
final Handler mHandler = createHandler();
@Override // androidx.activity.ComponentActivity.ReportFullyDrawnExecutor
public void viewCreated(@NonNull View view) {
}
@Override // java.util.concurrent.Executor
public void execute(Runnable runnable) {
this.mHandler.postAtFrontOfQueue(runnable);
}
@NonNull
private Handler createHandler() {
Looper myLooper = Looper.myLooper();
if (myLooper == null) {
myLooper = Looper.getMainLooper();
}
return new Handler(myLooper);
}
}
@RequiresApi(16)
public class ReportFullyDrawnExecutorApi16Impl implements ReportFullyDrawnExecutor, ViewTreeObserver.OnDrawListener, Runnable {
final long mEndWatchTimeMillis = SystemClock.uptimeMillis() + WorkRequest.MIN_BACKOFF_MILLIS;
boolean mOnDrawScheduled = false;
Runnable mRunnable;
public ReportFullyDrawnExecutorApi16Impl() {
}
@Override // androidx.activity.ComponentActivity.ReportFullyDrawnExecutor
public void viewCreated(@NonNull View view) {
if (this.mOnDrawScheduled) {
return;
}
this.mOnDrawScheduled = true;
view.getViewTreeObserver().addOnDrawListener(this);
}
@Override // java.util.concurrent.Executor
public void execute(Runnable runnable) {
this.mRunnable = runnable;
View decorView = ComponentActivity.this.getWindow().getDecorView();
if (this.mOnDrawScheduled) {
if (Looper.myLooper() == Looper.getMainLooper()) {
decorView.invalidate();
return;
} else {
decorView.postInvalidate();
return;
}
}
decorView.postOnAnimation(new Runnable() { // from class: androidx.activity.ComponentActivity$ReportFullyDrawnExecutorApi16Impl$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
ComponentActivity.ReportFullyDrawnExecutorApi16Impl.this.lambda$execute$0();
}
});
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void lambda$execute$0() {
Runnable runnable = this.mRunnable;
if (runnable != null) {
runnable.run();
this.mRunnable = null;
}
}
@Override // android.view.ViewTreeObserver.OnDrawListener
public void onDraw() {
Runnable runnable = this.mRunnable;
if (runnable == null) {
if (SystemClock.uptimeMillis() > this.mEndWatchTimeMillis) {
this.mOnDrawScheduled = false;
ComponentActivity.this.getWindow().getDecorView().post(this);
return;
}
return;
}
runnable.run();
this.mRunnable = null;
if (ComponentActivity.this.mFullyDrawnReporter.isFullyDrawnReported()) {
this.mOnDrawScheduled = false;
ComponentActivity.this.getWindow().getDecorView().post(this);
}
}
@Override // java.lang.Runnable
public void run() {
ComponentActivity.this.getWindow().getDecorView().getViewTreeObserver().removeOnDrawListener(this);
}
}
}

View File

@@ -0,0 +1,5 @@
package androidx.activity;
/* loaded from: classes.dex */
public abstract /* synthetic */ class ComponentDialog$$ExternalSyntheticApiModelOutline0 {
}

View File

@@ -0,0 +1,175 @@
package androidx.activity;
import android.app.Dialog;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.window.OnBackInvokedDispatcher;
import androidx.annotation.CallSuper;
import androidx.annotation.StyleRes;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LifecycleRegistry;
import androidx.lifecycle.ViewTreeLifecycleOwner;
import androidx.savedstate.SavedStateRegistry;
import androidx.savedstate.SavedStateRegistryController;
import androidx.savedstate.SavedStateRegistryOwner;
import androidx.savedstate.ViewTreeSavedStateRegistryOwner;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public class ComponentDialog extends Dialog implements LifecycleOwner, OnBackPressedDispatcherOwner, SavedStateRegistryOwner {
private LifecycleRegistry _lifecycleRegistry;
private final OnBackPressedDispatcher onBackPressedDispatcher;
private final SavedStateRegistryController savedStateRegistryController;
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public ComponentDialog(Context context) {
this(context, 0, 2, null);
Intrinsics.checkNotNullParameter(context, "context");
}
public static /* synthetic */ void getOnBackPressedDispatcher$annotations() {
}
@Override // androidx.activity.OnBackPressedDispatcherOwner
public final OnBackPressedDispatcher getOnBackPressedDispatcher() {
return this.onBackPressedDispatcher;
}
public /* synthetic */ ComponentDialog(Context context, int i, int i2, DefaultConstructorMarker defaultConstructorMarker) {
this(context, (i2 & 2) != 0 ? 0 : i);
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public ComponentDialog(Context context, @StyleRes int i) {
super(context, i);
Intrinsics.checkNotNullParameter(context, "context");
this.savedStateRegistryController = SavedStateRegistryController.Companion.create(this);
this.onBackPressedDispatcher = new OnBackPressedDispatcher(new Runnable() { // from class: androidx.activity.ComponentDialog$$ExternalSyntheticLambda1
@Override // java.lang.Runnable
public final void run() {
ComponentDialog.onBackPressedDispatcher$lambda$1(ComponentDialog.this);
}
});
}
private final LifecycleRegistry getLifecycleRegistry() {
LifecycleRegistry lifecycleRegistry = this._lifecycleRegistry;
if (lifecycleRegistry != null) {
return lifecycleRegistry;
}
LifecycleRegistry lifecycleRegistry2 = new LifecycleRegistry(this);
this._lifecycleRegistry = lifecycleRegistry2;
return lifecycleRegistry2;
}
@Override // androidx.savedstate.SavedStateRegistryOwner
public SavedStateRegistry getSavedStateRegistry() {
return this.savedStateRegistryController.getSavedStateRegistry();
}
@Override // androidx.lifecycle.LifecycleOwner
public Lifecycle getLifecycle() {
return getLifecycleRegistry();
}
@Override // android.app.Dialog
public Bundle onSaveInstanceState() {
Bundle onSaveInstanceState = super.onSaveInstanceState();
Intrinsics.checkNotNullExpressionValue(onSaveInstanceState, "super.onSaveInstanceState()");
this.savedStateRegistryController.performSave(onSaveInstanceState);
return onSaveInstanceState;
}
@Override // android.app.Dialog
@CallSuper
public void onCreate(Bundle bundle) {
OnBackInvokedDispatcher onBackInvokedDispatcher;
super.onCreate(bundle);
if (Build.VERSION.SDK_INT >= 33) {
OnBackPressedDispatcher onBackPressedDispatcher = this.onBackPressedDispatcher;
onBackInvokedDispatcher = getOnBackInvokedDispatcher();
Intrinsics.checkNotNullExpressionValue(onBackInvokedDispatcher, "onBackInvokedDispatcher");
onBackPressedDispatcher.setOnBackInvokedDispatcher(onBackInvokedDispatcher);
}
this.savedStateRegistryController.performRestore(bundle);
getLifecycleRegistry().handleLifecycleEvent(Lifecycle.Event.ON_CREATE);
}
@Override // android.app.Dialog
@CallSuper
public void onStart() {
super.onStart();
getLifecycleRegistry().handleLifecycleEvent(Lifecycle.Event.ON_RESUME);
}
@Override // android.app.Dialog
@CallSuper
public void onStop() {
getLifecycleRegistry().handleLifecycleEvent(Lifecycle.Event.ON_DESTROY);
this._lifecycleRegistry = null;
super.onStop();
}
/* JADX INFO: Access modifiers changed from: private */
public static final void onBackPressedDispatcher$lambda$1(ComponentDialog this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
super.onBackPressed();
}
@Override // android.app.Dialog
@CallSuper
public void onBackPressed() {
this.onBackPressedDispatcher.onBackPressed();
}
@Override // android.app.Dialog
public void setContentView(int i) {
initViewTreeOwners();
super.setContentView(i);
}
@Override // android.app.Dialog
public void setContentView(View view) {
Intrinsics.checkNotNullParameter(view, "view");
initViewTreeOwners();
super.setContentView(view);
}
@Override // android.app.Dialog
public void setContentView(View view, ViewGroup.LayoutParams layoutParams) {
Intrinsics.checkNotNullParameter(view, "view");
initViewTreeOwners();
super.setContentView(view, layoutParams);
}
@Override // android.app.Dialog
public void addContentView(View view, ViewGroup.LayoutParams layoutParams) {
Intrinsics.checkNotNullParameter(view, "view");
initViewTreeOwners();
super.addContentView(view, layoutParams);
}
private final void initViewTreeOwners() {
Window window = getWindow();
Intrinsics.checkNotNull(window);
View decorView = window.getDecorView();
Intrinsics.checkNotNullExpressionValue(decorView, "window!!.decorView");
ViewTreeLifecycleOwner.set(decorView, this);
Window window2 = getWindow();
Intrinsics.checkNotNull(window2);
View decorView2 = window2.getDecorView();
Intrinsics.checkNotNullExpressionValue(decorView2, "window!!.decorView");
ViewTreeOnBackPressedDispatcherOwner.set(decorView2, this);
Window window3 = getWindow();
Intrinsics.checkNotNull(window3);
View decorView3 = window3.getDecorView();
Intrinsics.checkNotNullExpressionValue(decorView3, "window!!.decorView");
ViewTreeSavedStateRegistryOwner.set(decorView3, this);
}
}

View File

@@ -0,0 +1,153 @@
package androidx.activity;
import androidx.annotation.GuardedBy;
import androidx.annotation.RestrictTo;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Executor;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@SourceDebugExtension({"SMAP\nFullyDrawnReporter.kt\nKotlin\n*S Kotlin\n*F\n+ 1 FullyDrawnReporter.kt\nandroidx/activity/FullyDrawnReporter\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n+ 3 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,192:1\n1#2:193\n1855#3,2:194\n*S KotlinDebug\n*F\n+ 1 FullyDrawnReporter.kt\nandroidx/activity/FullyDrawnReporter\n*L\n157#1:194,2\n*E\n"})
/* loaded from: classes.dex */
public final class FullyDrawnReporter {
private final Executor executor;
private final Object lock;
@GuardedBy("lock")
private final List<Function0> onReportCallbacks;
private final Function0 reportFullyDrawn;
@GuardedBy("lock")
private boolean reportPosted;
private final Runnable reportRunnable;
@GuardedBy("lock")
private boolean reportedFullyDrawn;
@GuardedBy("lock")
private int reporterCount;
public FullyDrawnReporter(Executor executor, Function0 reportFullyDrawn) {
Intrinsics.checkNotNullParameter(executor, "executor");
Intrinsics.checkNotNullParameter(reportFullyDrawn, "reportFullyDrawn");
this.executor = executor;
this.reportFullyDrawn = reportFullyDrawn;
this.lock = new Object();
this.onReportCallbacks = new ArrayList();
this.reportRunnable = new Runnable() { // from class: androidx.activity.FullyDrawnReporter$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
FullyDrawnReporter.reportRunnable$lambda$2(FullyDrawnReporter.this);
}
};
}
public final boolean isFullyDrawnReported() {
boolean z;
synchronized (this.lock) {
z = this.reportedFullyDrawn;
}
return z;
}
/* JADX INFO: Access modifiers changed from: private */
public static final void reportRunnable$lambda$2(FullyDrawnReporter this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
synchronized (this$0.lock) {
try {
this$0.reportPosted = false;
if (this$0.reporterCount == 0 && !this$0.reportedFullyDrawn) {
this$0.reportFullyDrawn.invoke();
this$0.fullyDrawnReported();
}
Unit unit = Unit.INSTANCE;
} catch (Throwable th) {
throw th;
}
}
}
public final void addReporter() {
synchronized (this.lock) {
try {
if (!this.reportedFullyDrawn) {
this.reporterCount++;
}
Unit unit = Unit.INSTANCE;
} catch (Throwable th) {
throw th;
}
}
}
public final void removeReporter() {
synchronized (this.lock) {
try {
if (!this.reportedFullyDrawn) {
int i = this.reporterCount;
if (i <= 0) {
throw new IllegalStateException("removeReporter() called when all reporters have already been removed.".toString());
}
this.reporterCount = i - 1;
postWhenReportersAreDone();
}
Unit unit = Unit.INSTANCE;
} catch (Throwable th) {
throw th;
}
}
}
public final void addOnReportDrawnListener(Function0 callback) {
boolean z;
Intrinsics.checkNotNullParameter(callback, "callback");
synchronized (this.lock) {
if (this.reportedFullyDrawn) {
z = true;
} else {
this.onReportCallbacks.add(callback);
z = false;
}
}
if (z) {
callback.invoke();
}
}
public final void removeOnReportDrawnListener(Function0 callback) {
Intrinsics.checkNotNullParameter(callback, "callback");
synchronized (this.lock) {
this.onReportCallbacks.remove(callback);
Unit unit = Unit.INSTANCE;
}
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public final void fullyDrawnReported() {
synchronized (this.lock) {
try {
this.reportedFullyDrawn = true;
Iterator<T> it = this.onReportCallbacks.iterator();
while (it.hasNext()) {
((Function0) it.next()).invoke();
}
this.onReportCallbacks.clear();
Unit unit = Unit.INSTANCE;
} catch (Throwable th) {
throw th;
}
}
}
private final void postWhenReportersAreDone() {
if (this.reportPosted || this.reporterCount != 0) {
return;
}
this.reportPosted = true;
this.executor.execute(this.reportRunnable);
}
}

View File

@@ -0,0 +1,26 @@
package androidx.activity;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.jvm.internal.SourceDebugExtension;
@DebugMetadata(c = "androidx.activity.FullyDrawnReporterKt", f = "FullyDrawnReporter.kt", l = {188}, m = "reportWhenComplete")
@SourceDebugExtension({"SMAP\nFullyDrawnReporter.kt\nKotlin\n*S Kotlin\n*F\n+ 1 FullyDrawnReporter.kt\nandroidx/activity/FullyDrawnReporterKt$reportWhenComplete$1\n*L\n1#1,192:1\n*E\n"})
/* loaded from: classes.dex */
public final class FullyDrawnReporterKt$reportWhenComplete$1 extends ContinuationImpl {
Object L$0;
int label;
/* synthetic */ Object result;
public FullyDrawnReporterKt$reportWhenComplete$1(Continuation continuation) {
super(continuation);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
this.result = obj;
this.label |= Integer.MIN_VALUE;
return FullyDrawnReporterKt.reportWhenComplete(null, null, this);
}
}

View File

@@ -0,0 +1,99 @@
package androidx.activity;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.InlineMarker;
/* loaded from: classes.dex */
public final class FullyDrawnReporterKt {
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Removed duplicated region for block: B:18:0x0037 */
/* JADX WARN: Removed duplicated region for block: B:9:0x0023 */
/* JADX WARN: Type inference failed for: r4v4, types: [java.lang.Object, kotlin.Unit] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static final java.lang.Object reportWhenComplete(androidx.activity.FullyDrawnReporter r4, kotlin.jvm.functions.Function1 r5, kotlin.coroutines.Continuation r6) {
/*
boolean r0 = r6 instanceof androidx.activity.FullyDrawnReporterKt$reportWhenComplete$1
if (r0 == 0) goto L13
r0 = r6
androidx.activity.FullyDrawnReporterKt$reportWhenComplete$1 r0 = (androidx.activity.FullyDrawnReporterKt$reportWhenComplete$1) r0
int r1 = r0.label
r2 = -2147483648(0xffffffff80000000, float:-0.0)
r3 = r1 & r2
if (r3 == 0) goto L13
int r1 = r1 - r2
r0.label = r1
goto L18
L13:
androidx.activity.FullyDrawnReporterKt$reportWhenComplete$1 r0 = new androidx.activity.FullyDrawnReporterKt$reportWhenComplete$1
r0.<init>(r6)
L18:
java.lang.Object r6 = r0.result
java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r2 = r0.label
r3 = 1
if (r2 == 0) goto L37
if (r2 != r3) goto L2f
java.lang.Object r4 = r0.L$0
androidx.activity.FullyDrawnReporter r4 = (androidx.activity.FullyDrawnReporter) r4
kotlin.ResultKt.throwOnFailure(r6) // Catch: java.lang.Throwable -> L2d
goto L51
L2d:
r5 = move-exception
goto L5d
L2f:
java.lang.IllegalStateException r4 = new java.lang.IllegalStateException
java.lang.String r5 = "call to 'resume' before 'invoke' with coroutine"
r4.<init>(r5)
throw r4
L37:
kotlin.ResultKt.throwOnFailure(r6)
r4.addReporter()
boolean r6 = r4.isFullyDrawnReported()
if (r6 == 0) goto L46
kotlin.Unit r4 = kotlin.Unit.INSTANCE
return r4
L46:
r0.L$0 = r4 // Catch: java.lang.Throwable -> L2d
r0.label = r3 // Catch: java.lang.Throwable -> L2d
java.lang.Object r5 = r5.invoke(r0) // Catch: java.lang.Throwable -> L2d
if (r5 != r1) goto L51
return r1
L51:
kotlin.jvm.internal.InlineMarker.finallyStart(r3)
r4.removeReporter()
kotlin.jvm.internal.InlineMarker.finallyEnd(r3)
kotlin.Unit r4 = kotlin.Unit.INSTANCE
return r4
L5d:
kotlin.jvm.internal.InlineMarker.finallyStart(r3)
r4.removeReporter()
kotlin.jvm.internal.InlineMarker.finallyEnd(r3)
throw r5
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.activity.FullyDrawnReporterKt.reportWhenComplete(androidx.activity.FullyDrawnReporter, kotlin.jvm.functions.Function1, kotlin.coroutines.Continuation):java.lang.Object");
}
private static final Object reportWhenComplete$$forInline(FullyDrawnReporter fullyDrawnReporter, Function1 function1, Continuation continuation) {
fullyDrawnReporter.addReporter();
if (fullyDrawnReporter.isFullyDrawnReported()) {
return Unit.INSTANCE;
}
try {
function1.invoke(continuation);
InlineMarker.finallyStart(1);
fullyDrawnReporter.removeReporter();
InlineMarker.finallyEnd(1);
return Unit.INSTANCE;
} catch (Throwable th) {
InlineMarker.finallyStart(1);
fullyDrawnReporter.removeReporter();
InlineMarker.finallyEnd(1);
throw th;
}
}
}

View File

@@ -0,0 +1,6 @@
package androidx.activity;
/* loaded from: classes.dex */
public interface FullyDrawnReporterOwner {
FullyDrawnReporter getFullyDrawnReporter();
}

View File

@@ -0,0 +1,93 @@
package androidx.activity;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import androidx.annotation.MainThread;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleEventObserver;
import androidx.lifecycle.LifecycleOwner;
import java.lang.reflect.Field;
@RequiresApi(19)
/* loaded from: classes.dex */
final class ImmLeaksCleaner implements LifecycleEventObserver {
private static final int INIT_FAILED = 2;
private static final int INIT_SUCCESS = 1;
private static final int NOT_INITIALIAZED = 0;
private static Field sHField;
private static Field sNextServedViewField;
private static int sReflectedFieldsInitialized;
private static Field sServedViewField;
private Activity mActivity;
public ImmLeaksCleaner(Activity activity) {
this.mActivity = activity;
}
@Override // androidx.lifecycle.LifecycleEventObserver
public void onStateChanged(@NonNull LifecycleOwner lifecycleOwner, @NonNull Lifecycle.Event event) {
if (event != Lifecycle.Event.ON_DESTROY) {
return;
}
if (sReflectedFieldsInitialized == 0) {
initializeReflectiveFields();
}
if (sReflectedFieldsInitialized == 1) {
InputMethodManager inputMethodManager = (InputMethodManager) this.mActivity.getSystemService("input_method");
try {
Object obj = sHField.get(inputMethodManager);
if (obj == null) {
return;
}
synchronized (obj) {
try {
try {
try {
View view = (View) sServedViewField.get(inputMethodManager);
if (view == null) {
return;
}
if (view.isAttachedToWindow()) {
return;
}
try {
sNextServedViewField.set(inputMethodManager, null);
inputMethodManager.isActive();
} catch (IllegalAccessException unused) {
}
} catch (ClassCastException unused2) {
}
} catch (IllegalAccessException unused3) {
}
} catch (Throwable th) {
throw th;
}
}
} catch (IllegalAccessException unused4) {
}
}
}
@SuppressLint({"SoonBlockedPrivateApi"})
@MainThread
private static void initializeReflectiveFields() {
try {
sReflectedFieldsInitialized = 2;
Field declaredField = InputMethodManager.class.getDeclaredField("mServedView");
sServedViewField = declaredField;
declaredField.setAccessible(true);
Field declaredField2 = InputMethodManager.class.getDeclaredField("mNextServedView");
sNextServedViewField = declaredField2;
declaredField2.setAccessible(true);
Field declaredField3 = InputMethodManager.class.getDeclaredField("mH");
sHField = declaredField3;
declaredField3.setAccessible(true);
sReflectedFieldsInitialized = 1;
} catch (NoSuchFieldException unused) {
}
}
}

View File

@@ -0,0 +1,63 @@
package androidx.activity;
import androidx.annotation.MainThread;
import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArrayList;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@SourceDebugExtension({"SMAP\nOnBackPressedCallback.kt\nKotlin\n*S Kotlin\n*F\n+ 1 OnBackPressedCallback.kt\nandroidx/activity/OnBackPressedCallback\n+ 2 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,85:1\n1855#2,2:86\n*S KotlinDebug\n*F\n+ 1 OnBackPressedCallback.kt\nandroidx/activity/OnBackPressedCallback\n*L\n67#1:86,2\n*E\n"})
/* loaded from: classes.dex */
public abstract class OnBackPressedCallback {
private final CopyOnWriteArrayList<Cancellable> cancellables = new CopyOnWriteArrayList<>();
private Function0 enabledChangedCallback;
private boolean isEnabled;
public final Function0 getEnabledChangedCallback$activity_release() {
return this.enabledChangedCallback;
}
@MainThread
public abstract void handleOnBackPressed();
@MainThread
public final boolean isEnabled() {
return this.isEnabled;
}
public final void setEnabledChangedCallback$activity_release(Function0 function0) {
this.enabledChangedCallback = function0;
}
public OnBackPressedCallback(boolean z) {
this.isEnabled = z;
}
@MainThread
public final void setEnabled(boolean z) {
this.isEnabled = z;
Function0 function0 = this.enabledChangedCallback;
if (function0 != null) {
function0.invoke();
}
}
public final void addCancellable(Cancellable cancellable) {
Intrinsics.checkNotNullParameter(cancellable, "cancellable");
this.cancellables.add(cancellable);
}
public final void removeCancellable(Cancellable cancellable) {
Intrinsics.checkNotNullParameter(cancellable, "cancellable");
this.cancellables.remove(cancellable);
}
@MainThread
public final void remove() {
Iterator<T> it = this.cancellables.iterator();
while (it.hasNext()) {
((Cancellable) it.next()).cancel();
}
}
}

View File

@@ -0,0 +1,289 @@
package androidx.activity;
import android.os.Build;
import android.window.OnBackInvokedCallback;
import android.window.OnBackInvokedDispatcher;
import androidx.activity.OnBackPressedDispatcher;
import androidx.annotation.DoNotInline;
import androidx.annotation.MainThread;
import androidx.annotation.RequiresApi;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleEventObserver;
import androidx.lifecycle.LifecycleOwner;
import java.util.Collection;
import java.util.Iterator;
import java.util.ListIterator;
import kotlin.Unit;
import kotlin.collections.ArrayDeque;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@SourceDebugExtension({"SMAP\nOnBackPressedDispatcher.kt\nKotlin\n*S Kotlin\n*F\n+ 1 OnBackPressedDispatcher.kt\nandroidx/activity/OnBackPressedDispatcher\n+ 2 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,317:1\n1747#2,3:318\n533#2,6:321\n*S KotlinDebug\n*F\n+ 1 OnBackPressedDispatcher.kt\nandroidx/activity/OnBackPressedDispatcher\n*L\n194#1:318,3\n209#1:321,6\n*E\n"})
/* loaded from: classes.dex */
public final class OnBackPressedDispatcher {
private boolean backInvokedCallbackRegistered;
private Function0 enabledChangedCallback;
private final Runnable fallbackOnBackPressed;
private OnBackInvokedDispatcher invokedDispatcher;
private OnBackInvokedCallback onBackInvokedCallback;
private final ArrayDeque onBackPressedCallbacks;
/* JADX WARN: Multi-variable type inference failed */
public OnBackPressedDispatcher() {
this(null, 1, 0 == true ? 1 : 0);
}
public OnBackPressedDispatcher(Runnable runnable) {
this.fallbackOnBackPressed = runnable;
this.onBackPressedCallbacks = new ArrayDeque();
if (Build.VERSION.SDK_INT >= 33) {
this.enabledChangedCallback = new Function0() { // from class: androidx.activity.OnBackPressedDispatcher.1
{
super(0);
}
@Override // kotlin.jvm.functions.Function0
public /* bridge */ /* synthetic */ Object invoke() {
m4invoke();
return Unit.INSTANCE;
}
/* renamed from: invoke, reason: collision with other method in class */
public final void m4invoke() {
OnBackPressedDispatcher.this.updateBackInvokedCallbackState$activity_release();
}
};
this.onBackInvokedCallback = Api33Impl.INSTANCE.createOnBackInvokedCallback(new Function0() { // from class: androidx.activity.OnBackPressedDispatcher.2
{
super(0);
}
@Override // kotlin.jvm.functions.Function0
public /* bridge */ /* synthetic */ Object invoke() {
m5invoke();
return Unit.INSTANCE;
}
/* renamed from: invoke, reason: collision with other method in class */
public final void m5invoke() {
OnBackPressedDispatcher.this.onBackPressed();
}
});
}
}
public /* synthetic */ OnBackPressedDispatcher(Runnable runnable, int i, DefaultConstructorMarker defaultConstructorMarker) {
this((i & 1) != 0 ? null : runnable);
}
@RequiresApi(33)
public final void setOnBackInvokedDispatcher(OnBackInvokedDispatcher invoker) {
Intrinsics.checkNotNullParameter(invoker, "invoker");
this.invokedDispatcher = invoker;
updateBackInvokedCallbackState$activity_release();
}
@RequiresApi(33)
public final void updateBackInvokedCallbackState$activity_release() {
boolean hasEnabledCallbacks = hasEnabledCallbacks();
OnBackInvokedDispatcher onBackInvokedDispatcher = this.invokedDispatcher;
OnBackInvokedCallback onBackInvokedCallback = this.onBackInvokedCallback;
if (onBackInvokedDispatcher == null || onBackInvokedCallback == null) {
return;
}
if (hasEnabledCallbacks && !this.backInvokedCallbackRegistered) {
Api33Impl.INSTANCE.registerOnBackInvokedCallback(onBackInvokedDispatcher, 0, onBackInvokedCallback);
this.backInvokedCallbackRegistered = true;
} else {
if (hasEnabledCallbacks || !this.backInvokedCallbackRegistered) {
return;
}
Api33Impl.INSTANCE.unregisterOnBackInvokedCallback(onBackInvokedDispatcher, onBackInvokedCallback);
this.backInvokedCallbackRegistered = false;
}
}
@MainThread
public final void addCallback(OnBackPressedCallback onBackPressedCallback) {
Intrinsics.checkNotNullParameter(onBackPressedCallback, "onBackPressedCallback");
addCancellableCallback$activity_release(onBackPressedCallback);
}
@MainThread
public final Cancellable addCancellableCallback$activity_release(OnBackPressedCallback onBackPressedCallback) {
Intrinsics.checkNotNullParameter(onBackPressedCallback, "onBackPressedCallback");
this.onBackPressedCallbacks.add(onBackPressedCallback);
OnBackPressedCancellable onBackPressedCancellable = new OnBackPressedCancellable(this, onBackPressedCallback);
onBackPressedCallback.addCancellable(onBackPressedCancellable);
if (Build.VERSION.SDK_INT >= 33) {
updateBackInvokedCallbackState$activity_release();
onBackPressedCallback.setEnabledChangedCallback$activity_release(this.enabledChangedCallback);
}
return onBackPressedCancellable;
}
@MainThread
public final void addCallback(LifecycleOwner owner, OnBackPressedCallback onBackPressedCallback) {
Intrinsics.checkNotNullParameter(owner, "owner");
Intrinsics.checkNotNullParameter(onBackPressedCallback, "onBackPressedCallback");
Lifecycle lifecycle = owner.getLifecycle();
if (lifecycle.getCurrentState() == Lifecycle.State.DESTROYED) {
return;
}
onBackPressedCallback.addCancellable(new LifecycleOnBackPressedCancellable(this, lifecycle, onBackPressedCallback));
if (Build.VERSION.SDK_INT >= 33) {
updateBackInvokedCallbackState$activity_release();
onBackPressedCallback.setEnabledChangedCallback$activity_release(this.enabledChangedCallback);
}
}
public final class OnBackPressedCancellable implements Cancellable {
private final OnBackPressedCallback onBackPressedCallback;
final /* synthetic */ OnBackPressedDispatcher this$0;
public OnBackPressedCancellable(OnBackPressedDispatcher onBackPressedDispatcher, OnBackPressedCallback onBackPressedCallback) {
Intrinsics.checkNotNullParameter(onBackPressedCallback, "onBackPressedCallback");
this.this$0 = onBackPressedDispatcher;
this.onBackPressedCallback = onBackPressedCallback;
}
@Override // androidx.activity.Cancellable
public void cancel() {
this.this$0.onBackPressedCallbacks.remove(this.onBackPressedCallback);
this.onBackPressedCallback.removeCancellable(this);
if (Build.VERSION.SDK_INT >= 33) {
this.onBackPressedCallback.setEnabledChangedCallback$activity_release(null);
this.this$0.updateBackInvokedCallbackState$activity_release();
}
}
}
public final class LifecycleOnBackPressedCancellable implements LifecycleEventObserver, Cancellable {
private Cancellable currentCancellable;
private final Lifecycle lifecycle;
private final OnBackPressedCallback onBackPressedCallback;
final /* synthetic */ OnBackPressedDispatcher this$0;
public LifecycleOnBackPressedCancellable(OnBackPressedDispatcher onBackPressedDispatcher, Lifecycle lifecycle, OnBackPressedCallback onBackPressedCallback) {
Intrinsics.checkNotNullParameter(lifecycle, "lifecycle");
Intrinsics.checkNotNullParameter(onBackPressedCallback, "onBackPressedCallback");
this.this$0 = onBackPressedDispatcher;
this.lifecycle = lifecycle;
this.onBackPressedCallback = onBackPressedCallback;
lifecycle.addObserver(this);
}
@Override // androidx.lifecycle.LifecycleEventObserver
public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
Intrinsics.checkNotNullParameter(source, "source");
Intrinsics.checkNotNullParameter(event, "event");
if (event == Lifecycle.Event.ON_START) {
this.currentCancellable = this.this$0.addCancellableCallback$activity_release(this.onBackPressedCallback);
return;
}
if (event != Lifecycle.Event.ON_STOP) {
if (event == Lifecycle.Event.ON_DESTROY) {
cancel();
}
} else {
Cancellable cancellable = this.currentCancellable;
if (cancellable != null) {
cancellable.cancel();
}
}
}
@Override // androidx.activity.Cancellable
public void cancel() {
this.lifecycle.removeObserver(this);
this.onBackPressedCallback.removeCancellable(this);
Cancellable cancellable = this.currentCancellable;
if (cancellable != null) {
cancellable.cancel();
}
this.currentCancellable = null;
}
}
@RequiresApi(33)
public static final class Api33Impl {
public static final Api33Impl INSTANCE = new Api33Impl();
private Api33Impl() {
}
@DoNotInline
public final void registerOnBackInvokedCallback(Object dispatcher, int i, Object callback) {
Intrinsics.checkNotNullParameter(dispatcher, "dispatcher");
Intrinsics.checkNotNullParameter(callback, "callback");
((OnBackInvokedDispatcher) dispatcher).registerOnBackInvokedCallback(i, (OnBackInvokedCallback) callback);
}
@DoNotInline
public final void unregisterOnBackInvokedCallback(Object dispatcher, Object callback) {
Intrinsics.checkNotNullParameter(dispatcher, "dispatcher");
Intrinsics.checkNotNullParameter(callback, "callback");
((OnBackInvokedDispatcher) dispatcher).unregisterOnBackInvokedCallback((OnBackInvokedCallback) callback);
}
/* JADX INFO: Access modifiers changed from: private */
public static final void createOnBackInvokedCallback$lambda$0(Function0 onBackInvoked) {
Intrinsics.checkNotNullParameter(onBackInvoked, "$onBackInvoked");
onBackInvoked.invoke();
}
@DoNotInline
public final OnBackInvokedCallback createOnBackInvokedCallback(final Function0 onBackInvoked) {
Intrinsics.checkNotNullParameter(onBackInvoked, "onBackInvoked");
return new OnBackInvokedCallback() { // from class: androidx.activity.OnBackPressedDispatcher$Api33Impl$$ExternalSyntheticLambda0
public final void onBackInvoked() {
OnBackPressedDispatcher.Api33Impl.createOnBackInvokedCallback$lambda$0(Function0.this);
}
};
}
}
@MainThread
public final void onBackPressed() {
Object obj;
ArrayDeque arrayDeque = this.onBackPressedCallbacks;
ListIterator<E> listIterator = arrayDeque.listIterator(arrayDeque.size());
while (true) {
if (!listIterator.hasPrevious()) {
obj = null;
break;
} else {
obj = listIterator.previous();
if (((OnBackPressedCallback) obj).isEnabled()) {
break;
}
}
}
OnBackPressedCallback onBackPressedCallback = (OnBackPressedCallback) obj;
if (onBackPressedCallback != null) {
onBackPressedCallback.handleOnBackPressed();
return;
}
Runnable runnable = this.fallbackOnBackPressed;
if (runnable != null) {
runnable.run();
}
}
@MainThread
public final boolean hasEnabledCallbacks() {
ArrayDeque arrayDeque = this.onBackPressedCallbacks;
if ((arrayDeque instanceof Collection) && arrayDeque.isEmpty()) {
return false;
}
Iterator<E> it = arrayDeque.iterator();
while (it.hasNext()) {
if (((OnBackPressedCallback) it.next()).isEnabled()) {
return true;
}
}
return false;
}
}

View File

@@ -0,0 +1,35 @@
package androidx.activity;
import androidx.lifecycle.LifecycleOwner;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class OnBackPressedDispatcherKt {
public static /* synthetic */ OnBackPressedCallback addCallback$default(OnBackPressedDispatcher onBackPressedDispatcher, LifecycleOwner lifecycleOwner, boolean z, Function1 function1, int i, Object obj) {
if ((i & 1) != 0) {
lifecycleOwner = null;
}
if ((i & 2) != 0) {
z = true;
}
return addCallback(onBackPressedDispatcher, lifecycleOwner, z, function1);
}
public static final OnBackPressedCallback addCallback(OnBackPressedDispatcher onBackPressedDispatcher, LifecycleOwner lifecycleOwner, final boolean z, final Function1 onBackPressed) {
Intrinsics.checkNotNullParameter(onBackPressedDispatcher, "<this>");
Intrinsics.checkNotNullParameter(onBackPressed, "onBackPressed");
OnBackPressedCallback onBackPressedCallback = new OnBackPressedCallback(z) { // from class: androidx.activity.OnBackPressedDispatcherKt$addCallback$callback$1
@Override // androidx.activity.OnBackPressedCallback
public void handleOnBackPressed() {
onBackPressed.invoke(this);
}
};
if (lifecycleOwner != null) {
onBackPressedDispatcher.addCallback(lifecycleOwner, onBackPressedCallback);
} else {
onBackPressedDispatcher.addCallback(onBackPressedCallback);
}
return onBackPressedCallback;
}
}

View File

@@ -0,0 +1,8 @@
package androidx.activity;
import androidx.lifecycle.LifecycleOwner;
/* loaded from: classes.dex */
public interface OnBackPressedDispatcherOwner extends LifecycleOwner {
OnBackPressedDispatcher getOnBackPressedDispatcher();
}

View File

@@ -0,0 +1,16 @@
package androidx.activity;
/* loaded from: classes.dex */
public final class R {
public static final class id {
public static int report_drawn = 0x7f0a0242;
public static int view_tree_on_back_pressed_dispatcher_owner = 0x7f0a0291;
private id() {
}
}
private R() {
}
}

View File

@@ -0,0 +1,48 @@
package androidx.activity;
import android.view.View;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.sequences.Sequence;
import kotlin.sequences.SequencesKt__SequencesKt;
import kotlin.sequences.SequencesKt___SequencesKt;
/* loaded from: classes.dex */
public final class ViewTreeFullyDrawnReporterOwner {
public static final void set(View view, FullyDrawnReporterOwner fullyDrawnReporterOwner) {
Intrinsics.checkNotNullParameter(view, "<this>");
Intrinsics.checkNotNullParameter(fullyDrawnReporterOwner, "fullyDrawnReporterOwner");
view.setTag(R.id.report_drawn, fullyDrawnReporterOwner);
}
public static final FullyDrawnReporterOwner get(View view) {
Sequence generateSequence;
Sequence mapNotNull;
Object firstOrNull;
Intrinsics.checkNotNullParameter(view, "<this>");
generateSequence = SequencesKt__SequencesKt.generateSequence(view, new Function1() { // from class: androidx.activity.ViewTreeFullyDrawnReporterOwner$findViewTreeFullyDrawnReporterOwner$1
@Override // kotlin.jvm.functions.Function1
public final View invoke(View it) {
Intrinsics.checkNotNullParameter(it, "it");
Object parent = it.getParent();
if (parent instanceof View) {
return (View) parent;
}
return null;
}
});
mapNotNull = SequencesKt___SequencesKt.mapNotNull(generateSequence, new Function1() { // from class: androidx.activity.ViewTreeFullyDrawnReporterOwner$findViewTreeFullyDrawnReporterOwner$2
@Override // kotlin.jvm.functions.Function1
public final FullyDrawnReporterOwner invoke(View it) {
Intrinsics.checkNotNullParameter(it, "it");
Object tag = it.getTag(R.id.report_drawn);
if (tag instanceof FullyDrawnReporterOwner) {
return (FullyDrawnReporterOwner) tag;
}
return null;
}
});
firstOrNull = SequencesKt___SequencesKt.firstOrNull(mapNotNull);
return (FullyDrawnReporterOwner) firstOrNull;
}
}

View File

@@ -0,0 +1,48 @@
package androidx.activity;
import android.view.View;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.sequences.Sequence;
import kotlin.sequences.SequencesKt__SequencesKt;
import kotlin.sequences.SequencesKt___SequencesKt;
/* loaded from: classes.dex */
public final class ViewTreeOnBackPressedDispatcherOwner {
public static final void set(View view, OnBackPressedDispatcherOwner onBackPressedDispatcherOwner) {
Intrinsics.checkNotNullParameter(view, "<this>");
Intrinsics.checkNotNullParameter(onBackPressedDispatcherOwner, "onBackPressedDispatcherOwner");
view.setTag(R.id.view_tree_on_back_pressed_dispatcher_owner, onBackPressedDispatcherOwner);
}
public static final OnBackPressedDispatcherOwner get(View view) {
Sequence generateSequence;
Sequence mapNotNull;
Object firstOrNull;
Intrinsics.checkNotNullParameter(view, "<this>");
generateSequence = SequencesKt__SequencesKt.generateSequence(view, new Function1() { // from class: androidx.activity.ViewTreeOnBackPressedDispatcherOwner$findViewTreeOnBackPressedDispatcherOwner$1
@Override // kotlin.jvm.functions.Function1
public final View invoke(View it) {
Intrinsics.checkNotNullParameter(it, "it");
Object parent = it.getParent();
if (parent instanceof View) {
return (View) parent;
}
return null;
}
});
mapNotNull = SequencesKt___SequencesKt.mapNotNull(generateSequence, new Function1() { // from class: androidx.activity.ViewTreeOnBackPressedDispatcherOwner$findViewTreeOnBackPressedDispatcherOwner$2
@Override // kotlin.jvm.functions.Function1
public final OnBackPressedDispatcherOwner invoke(View it) {
Intrinsics.checkNotNullParameter(it, "it");
Object tag = it.getTag(R.id.view_tree_on_back_pressed_dispatcher_owner);
if (tag instanceof OnBackPressedDispatcherOwner) {
return (OnBackPressedDispatcherOwner) tag;
}
return null;
}
});
firstOrNull = SequencesKt___SequencesKt.firstOrNull(mapNotNull);
return (OnBackPressedDispatcherOwner) firstOrNull;
}
}

View File

@@ -0,0 +1,12 @@
package androidx.activity.contextaware;
import android.content.Context;
/* loaded from: classes.dex */
public interface ContextAware {
void addOnContextAvailableListener(OnContextAvailableListener onContextAvailableListener);
Context peekAvailableContext();
void removeOnContextAvailableListener(OnContextAvailableListener onContextAvailableListener);
}

View File

@@ -0,0 +1,44 @@
package androidx.activity.contextaware;
import android.content.Context;
import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class ContextAwareHelper {
private volatile Context context;
private final Set<OnContextAvailableListener> listeners = new CopyOnWriteArraySet();
public final void clearAvailableContext() {
this.context = null;
}
public final Context peekAvailableContext() {
return this.context;
}
public final void addOnContextAvailableListener(OnContextAvailableListener listener) {
Intrinsics.checkNotNullParameter(listener, "listener");
Context context = this.context;
if (context != null) {
listener.onContextAvailable(context);
}
this.listeners.add(listener);
}
public final void removeOnContextAvailableListener(OnContextAvailableListener listener) {
Intrinsics.checkNotNullParameter(listener, "listener");
this.listeners.remove(listener);
}
public final void dispatchOnContextAvailable(Context context) {
Intrinsics.checkNotNullParameter(context, "context");
this.context = context;
Iterator<OnContextAvailableListener> it = this.listeners.iterator();
while (it.hasNext()) {
it.next().onContextAvailable(context);
}
}
}

View File

@@ -0,0 +1,30 @@
package androidx.activity.contextaware;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Lambda;
import kotlin.jvm.internal.SourceDebugExtension;
@SourceDebugExtension({"SMAP\nContextAware.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ContextAware.kt\nandroidx/activity/contextaware/ContextAwareKt$withContextAvailable$2$1\n*L\n1#1,93:1\n*E\n"})
/* loaded from: classes.dex */
public final class ContextAwareKt$withContextAvailable$2$1 extends Lambda implements Function1 {
final /* synthetic */ ContextAwareKt$withContextAvailable$2$listener$1 $listener;
final /* synthetic */ ContextAware $this_withContextAvailable;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public ContextAwareKt$withContextAvailable$2$1(ContextAware contextAware, ContextAwareKt$withContextAvailable$2$listener$1 contextAwareKt$withContextAvailable$2$listener$1) {
super(1);
this.$this_withContextAvailable = contextAware;
this.$listener = contextAwareKt$withContextAvailable$2$listener$1;
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Object invoke(Object obj) {
invoke((Throwable) obj);
return Unit.INSTANCE;
}
public final void invoke(Throwable th) {
this.$this_withContextAvailable.removeOnContextAvailableListener(this.$listener);
}
}

View File

@@ -0,0 +1,37 @@
package androidx.activity.contextaware;
import android.content.Context;
import kotlin.Result;
import kotlin.ResultKt;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlinx.coroutines.CancellableContinuation;
@SourceDebugExtension({"SMAP\nContextAware.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ContextAware.kt\nandroidx/activity/contextaware/ContextAwareKt$withContextAvailable$2$listener$1\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,93:1\n1#2:94\n*E\n"})
/* loaded from: classes.dex */
public final class ContextAwareKt$withContextAvailable$2$listener$1 implements OnContextAvailableListener {
final /* synthetic */ CancellableContinuation $co;
final /* synthetic */ Function1 $onContextAvailable;
public ContextAwareKt$withContextAvailable$2$listener$1(CancellableContinuation cancellableContinuation, Function1 function1) {
this.$co = cancellableContinuation;
this.$onContextAvailable = function1;
}
@Override // androidx.activity.contextaware.OnContextAvailableListener
public void onContextAvailable(Context context) {
Object m4060constructorimpl;
Intrinsics.checkNotNullParameter(context, "context");
CancellableContinuation cancellableContinuation = this.$co;
Function1 function1 = this.$onContextAvailable;
try {
Result.Companion companion = Result.Companion;
m4060constructorimpl = Result.m4060constructorimpl(function1.invoke(context));
} catch (Throwable th) {
Result.Companion companion2 = Result.Companion;
m4060constructorimpl = Result.m4060constructorimpl(ResultKt.createFailure(th));
}
cancellableContinuation.resumeWith(m4060constructorimpl);
}
}

View File

@@ -0,0 +1,61 @@
package androidx.activity.contextaware;
import android.content.Context;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugProbesKt;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.InlineMarker;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlinx.coroutines.CancellableContinuationImpl;
@SourceDebugExtension({"SMAP\nContextAware.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ContextAware.kt\nandroidx/activity/contextaware/ContextAwareKt\n+ 2 CancellableContinuation.kt\nkotlinx/coroutines/CancellableContinuationKt\n*L\n1#1,93:1\n314#2,11:94\n*S KotlinDebug\n*F\n+ 1 ContextAware.kt\nandroidx/activity/contextaware/ContextAwareKt\n*L\n81#1:94,11\n*E\n"})
/* loaded from: classes.dex */
public final class ContextAwareKt {
public static final <R> Object withContextAvailable(ContextAware contextAware, Function1 function1, Continuation continuation) {
Continuation intercepted;
Object coroutine_suspended;
Context peekAvailableContext = contextAware.peekAvailableContext();
if (peekAvailableContext != null) {
return function1.invoke(peekAvailableContext);
}
intercepted = IntrinsicsKt__IntrinsicsJvmKt.intercepted(continuation);
CancellableContinuationImpl cancellableContinuationImpl = new CancellableContinuationImpl(intercepted, 1);
cancellableContinuationImpl.initCancellability();
ContextAwareKt$withContextAvailable$2$listener$1 contextAwareKt$withContextAvailable$2$listener$1 = new ContextAwareKt$withContextAvailable$2$listener$1(cancellableContinuationImpl, function1);
contextAware.addOnContextAvailableListener(contextAwareKt$withContextAvailable$2$listener$1);
cancellableContinuationImpl.invokeOnCancellation(new ContextAwareKt$withContextAvailable$2$1(contextAware, contextAwareKt$withContextAvailable$2$listener$1));
Object result = cancellableContinuationImpl.getResult();
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
if (result == coroutine_suspended) {
DebugProbesKt.probeCoroutineSuspended(continuation);
}
return result;
}
private static final <R> Object withContextAvailable$$forInline(ContextAware contextAware, Function1 function1, Continuation continuation) {
Continuation intercepted;
Object coroutine_suspended;
Context peekAvailableContext = contextAware.peekAvailableContext();
if (peekAvailableContext != null) {
return function1.invoke(peekAvailableContext);
}
InlineMarker.mark(0);
intercepted = IntrinsicsKt__IntrinsicsJvmKt.intercepted(continuation);
CancellableContinuationImpl cancellableContinuationImpl = new CancellableContinuationImpl(intercepted, 1);
cancellableContinuationImpl.initCancellability();
ContextAwareKt$withContextAvailable$2$listener$1 contextAwareKt$withContextAvailable$2$listener$1 = new ContextAwareKt$withContextAvailable$2$listener$1(cancellableContinuationImpl, function1);
contextAware.addOnContextAvailableListener(contextAwareKt$withContextAvailable$2$listener$1);
cancellableContinuationImpl.invokeOnCancellation(new ContextAwareKt$withContextAvailable$2$1(contextAware, contextAwareKt$withContextAvailable$2$listener$1));
Unit unit = Unit.INSTANCE;
Object result = cancellableContinuationImpl.getResult();
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
if (result == coroutine_suspended) {
DebugProbesKt.probeCoroutineSuspended(continuation);
}
InlineMarker.mark(1);
return result;
}
}

View File

@@ -0,0 +1,8 @@
package androidx.activity.contextaware;
import android.content.Context;
/* loaded from: classes.dex */
public interface OnContextAvailableListener {
void onContextAvailable(Context context);
}

View File

@@ -0,0 +1,75 @@
package androidx.activity.result;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@SuppressLint({"BanParcelableUsage"})
/* loaded from: classes.dex */
public final class ActivityResult implements Parcelable {
@NonNull
public static final Parcelable.Creator<ActivityResult> CREATOR = new Parcelable.Creator<ActivityResult>() { // from class: androidx.activity.result.ActivityResult.1
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public ActivityResult createFromParcel(@NonNull Parcel parcel) {
return new ActivityResult(parcel);
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public ActivityResult[] newArray(int i) {
return new ActivityResult[i];
}
};
@Nullable
private final Intent mData;
private final int mResultCode;
@Override // android.os.Parcelable
public int describeContents() {
return 0;
}
@Nullable
public Intent getData() {
return this.mData;
}
public int getResultCode() {
return this.mResultCode;
}
public ActivityResult(int i, @Nullable Intent intent) {
this.mResultCode = i;
this.mData = intent;
}
public ActivityResult(Parcel parcel) {
this.mResultCode = parcel.readInt();
this.mData = parcel.readInt() == 0 ? null : (Intent) Intent.CREATOR.createFromParcel(parcel);
}
public String toString() {
return "ActivityResult{resultCode=" + resultCodeToString(this.mResultCode) + ", data=" + this.mData + '}';
}
@NonNull
public static String resultCodeToString(int i) {
return i != -1 ? i != 0 ? String.valueOf(i) : "RESULT_CANCELED" : "RESULT_OK";
}
@Override // android.os.Parcelable
public void writeToParcel(@NonNull Parcel parcel, int i) {
parcel.writeInt(this.mResultCode);
parcel.writeInt(this.mData == null ? 0 : 1);
Intent intent = this.mData;
if (intent != null) {
intent.writeToParcel(parcel, i);
}
}
}

View File

@@ -0,0 +1,6 @@
package androidx.activity.result;
/* loaded from: classes.dex */
public interface ActivityResultCallback<O> {
void onActivityResult(O o);
}

View File

@@ -0,0 +1,13 @@
package androidx.activity.result;
import androidx.activity.result.contract.ActivityResultContract;
import androidx.annotation.NonNull;
/* loaded from: classes.dex */
public interface ActivityResultCaller {
@NonNull
<I, O> ActivityResultLauncher<I> registerForActivityResult(@NonNull ActivityResultContract<I, O> activityResultContract, @NonNull ActivityResultCallback<O> activityResultCallback);
@NonNull
<I, O> ActivityResultLauncher<I> registerForActivityResult(@NonNull ActivityResultContract<I, O> activityResultContract, @NonNull ActivityResultRegistry activityResultRegistry, @NonNull ActivityResultCallback<O> activityResultCallback);
}

View File

@@ -0,0 +1,23 @@
package androidx.activity.result;
import android.annotation.SuppressLint;
import androidx.activity.result.contract.ActivityResultContract;
import androidx.annotation.MainThread;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.app.ActivityOptionsCompat;
/* loaded from: classes.dex */
public abstract class ActivityResultLauncher<I> {
@NonNull
public abstract ActivityResultContract<I, ?> getContract();
public abstract void launch(@SuppressLint({"UnknownNullness"}) I i, @Nullable ActivityOptionsCompat activityOptionsCompat);
@MainThread
public abstract void unregister();
public void launch(@SuppressLint({"UnknownNullness"}) I i) {
launch(i, null);
}
}

View File

@@ -0,0 +1,300 @@
package androidx.activity.result;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import androidx.activity.result.contract.ActivityResultContract;
import androidx.annotation.MainThread;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.app.ActivityOptionsCompat;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleEventObserver;
import androidx.lifecycle.LifecycleOwner;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Random;
/* loaded from: classes.dex */
public abstract class ActivityResultRegistry {
private static final int INITIAL_REQUEST_CODE_VALUE = 65536;
private static final String KEY_COMPONENT_ACTIVITY_LAUNCHED_KEYS = "KEY_COMPONENT_ACTIVITY_LAUNCHED_KEYS";
private static final String KEY_COMPONENT_ACTIVITY_PENDING_RESULTS = "KEY_COMPONENT_ACTIVITY_PENDING_RESULT";
private static final String KEY_COMPONENT_ACTIVITY_RANDOM_OBJECT = "KEY_COMPONENT_ACTIVITY_RANDOM_OBJECT";
private static final String KEY_COMPONENT_ACTIVITY_REGISTERED_KEYS = "KEY_COMPONENT_ACTIVITY_REGISTERED_KEYS";
private static final String KEY_COMPONENT_ACTIVITY_REGISTERED_RCS = "KEY_COMPONENT_ACTIVITY_REGISTERED_RCS";
private static final String LOG_TAG = "ActivityResultRegistry";
private Random mRandom = new Random();
private final Map<Integer, String> mRcToKey = new HashMap();
final Map<String, Integer> mKeyToRc = new HashMap();
private final Map<String, LifecycleContainer> mKeyToLifecycleContainers = new HashMap();
ArrayList<String> mLaunchedKeys = new ArrayList<>();
final transient Map<String, CallbackAndContract<?>> mKeyToCallback = new HashMap();
final Map<String, Object> mParsedPendingResults = new HashMap();
final Bundle mPendingResults = new Bundle();
@MainThread
public abstract <I, O> void onLaunch(int i, @NonNull ActivityResultContract<I, O> activityResultContract, @SuppressLint({"UnknownNullness"}) I i2, @Nullable ActivityOptionsCompat activityOptionsCompat);
@NonNull
public final <I, O> ActivityResultLauncher<I> register(@NonNull final String str, @NonNull LifecycleOwner lifecycleOwner, @NonNull final ActivityResultContract<I, O> activityResultContract, @NonNull final ActivityResultCallback<O> activityResultCallback) {
Lifecycle lifecycle = lifecycleOwner.getLifecycle();
if (lifecycle.getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
throw new IllegalStateException("LifecycleOwner " + lifecycleOwner + " is attempting to register while current state is " + lifecycle.getCurrentState() + ". LifecycleOwners must call register before they are STARTED.");
}
registerKey(str);
LifecycleContainer lifecycleContainer = this.mKeyToLifecycleContainers.get(str);
if (lifecycleContainer == null) {
lifecycleContainer = new LifecycleContainer(lifecycle);
}
lifecycleContainer.addObserver(new LifecycleEventObserver() { // from class: androidx.activity.result.ActivityResultRegistry.1
@Override // androidx.lifecycle.LifecycleEventObserver
public void onStateChanged(@NonNull LifecycleOwner lifecycleOwner2, @NonNull Lifecycle.Event event) {
if (Lifecycle.Event.ON_START.equals(event)) {
ActivityResultRegistry.this.mKeyToCallback.put(str, new CallbackAndContract<>(activityResultCallback, activityResultContract));
if (ActivityResultRegistry.this.mParsedPendingResults.containsKey(str)) {
Object obj = ActivityResultRegistry.this.mParsedPendingResults.get(str);
ActivityResultRegistry.this.mParsedPendingResults.remove(str);
activityResultCallback.onActivityResult(obj);
}
ActivityResult activityResult = (ActivityResult) ActivityResultRegistry.this.mPendingResults.getParcelable(str);
if (activityResult != null) {
ActivityResultRegistry.this.mPendingResults.remove(str);
activityResultCallback.onActivityResult(activityResultContract.parseResult(activityResult.getResultCode(), activityResult.getData()));
return;
}
return;
}
if (Lifecycle.Event.ON_STOP.equals(event)) {
ActivityResultRegistry.this.mKeyToCallback.remove(str);
} else if (Lifecycle.Event.ON_DESTROY.equals(event)) {
ActivityResultRegistry.this.unregister(str);
}
}
});
this.mKeyToLifecycleContainers.put(str, lifecycleContainer);
return new ActivityResultLauncher<I>() { // from class: androidx.activity.result.ActivityResultRegistry.2
@Override // androidx.activity.result.ActivityResultLauncher
@NonNull
public ActivityResultContract<I, ?> getContract() {
return activityResultContract;
}
@Override // androidx.activity.result.ActivityResultLauncher
public void launch(I i, @Nullable ActivityOptionsCompat activityOptionsCompat) {
Integer num = ActivityResultRegistry.this.mKeyToRc.get(str);
if (num == null) {
throw new IllegalStateException("Attempting to launch an unregistered ActivityResultLauncher with contract " + activityResultContract + " and input " + i + ". You must ensure the ActivityResultLauncher is registered before calling launch().");
}
ActivityResultRegistry.this.mLaunchedKeys.add(str);
try {
ActivityResultRegistry.this.onLaunch(num.intValue(), activityResultContract, i, activityOptionsCompat);
} catch (Exception e) {
ActivityResultRegistry.this.mLaunchedKeys.remove(str);
throw e;
}
}
@Override // androidx.activity.result.ActivityResultLauncher
public void unregister() {
ActivityResultRegistry.this.unregister(str);
}
};
}
/* JADX WARN: Multi-variable type inference failed */
@NonNull
public final <I, O> ActivityResultLauncher<I> register(@NonNull final String str, @NonNull final ActivityResultContract<I, O> activityResultContract, @NonNull ActivityResultCallback<O> activityResultCallback) {
registerKey(str);
this.mKeyToCallback.put(str, new CallbackAndContract<>(activityResultCallback, activityResultContract));
if (this.mParsedPendingResults.containsKey(str)) {
Object obj = this.mParsedPendingResults.get(str);
this.mParsedPendingResults.remove(str);
activityResultCallback.onActivityResult(obj);
}
ActivityResult activityResult = (ActivityResult) this.mPendingResults.getParcelable(str);
if (activityResult != null) {
this.mPendingResults.remove(str);
activityResultCallback.onActivityResult(activityResultContract.parseResult(activityResult.getResultCode(), activityResult.getData()));
}
return new ActivityResultLauncher<I>() { // from class: androidx.activity.result.ActivityResultRegistry.3
@Override // androidx.activity.result.ActivityResultLauncher
@NonNull
public ActivityResultContract<I, ?> getContract() {
return activityResultContract;
}
@Override // androidx.activity.result.ActivityResultLauncher
public void launch(I i, @Nullable ActivityOptionsCompat activityOptionsCompat) {
Integer num = ActivityResultRegistry.this.mKeyToRc.get(str);
if (num == null) {
throw new IllegalStateException("Attempting to launch an unregistered ActivityResultLauncher with contract " + activityResultContract + " and input " + i + ". You must ensure the ActivityResultLauncher is registered before calling launch().");
}
ActivityResultRegistry.this.mLaunchedKeys.add(str);
try {
ActivityResultRegistry.this.onLaunch(num.intValue(), activityResultContract, i, activityOptionsCompat);
} catch (Exception e) {
ActivityResultRegistry.this.mLaunchedKeys.remove(str);
throw e;
}
}
@Override // androidx.activity.result.ActivityResultLauncher
public void unregister() {
ActivityResultRegistry.this.unregister(str);
}
};
}
@MainThread
public final void unregister(@NonNull String str) {
Integer remove;
if (!this.mLaunchedKeys.contains(str) && (remove = this.mKeyToRc.remove(str)) != null) {
this.mRcToKey.remove(remove);
}
this.mKeyToCallback.remove(str);
if (this.mParsedPendingResults.containsKey(str)) {
Log.w(LOG_TAG, "Dropping pending result for request " + str + ": " + this.mParsedPendingResults.get(str));
this.mParsedPendingResults.remove(str);
}
if (this.mPendingResults.containsKey(str)) {
Log.w(LOG_TAG, "Dropping pending result for request " + str + ": " + this.mPendingResults.getParcelable(str));
this.mPendingResults.remove(str);
}
LifecycleContainer lifecycleContainer = this.mKeyToLifecycleContainers.get(str);
if (lifecycleContainer != null) {
lifecycleContainer.clearObservers();
this.mKeyToLifecycleContainers.remove(str);
}
}
public final void onSaveInstanceState(@NonNull Bundle bundle) {
bundle.putIntegerArrayList(KEY_COMPONENT_ACTIVITY_REGISTERED_RCS, new ArrayList<>(this.mKeyToRc.values()));
bundle.putStringArrayList(KEY_COMPONENT_ACTIVITY_REGISTERED_KEYS, new ArrayList<>(this.mKeyToRc.keySet()));
bundle.putStringArrayList(KEY_COMPONENT_ACTIVITY_LAUNCHED_KEYS, new ArrayList<>(this.mLaunchedKeys));
bundle.putBundle(KEY_COMPONENT_ACTIVITY_PENDING_RESULTS, (Bundle) this.mPendingResults.clone());
bundle.putSerializable(KEY_COMPONENT_ACTIVITY_RANDOM_OBJECT, this.mRandom);
}
public final void onRestoreInstanceState(@Nullable Bundle bundle) {
if (bundle == null) {
return;
}
ArrayList<Integer> integerArrayList = bundle.getIntegerArrayList(KEY_COMPONENT_ACTIVITY_REGISTERED_RCS);
ArrayList<String> stringArrayList = bundle.getStringArrayList(KEY_COMPONENT_ACTIVITY_REGISTERED_KEYS);
if (stringArrayList == null || integerArrayList == null) {
return;
}
this.mLaunchedKeys = bundle.getStringArrayList(KEY_COMPONENT_ACTIVITY_LAUNCHED_KEYS);
this.mRandom = (Random) bundle.getSerializable(KEY_COMPONENT_ACTIVITY_RANDOM_OBJECT);
this.mPendingResults.putAll(bundle.getBundle(KEY_COMPONENT_ACTIVITY_PENDING_RESULTS));
for (int i = 0; i < stringArrayList.size(); i++) {
String str = stringArrayList.get(i);
if (this.mKeyToRc.containsKey(str)) {
Integer remove = this.mKeyToRc.remove(str);
if (!this.mPendingResults.containsKey(str)) {
this.mRcToKey.remove(remove);
}
}
bindRcKey(integerArrayList.get(i).intValue(), stringArrayList.get(i));
}
}
@MainThread
public final boolean dispatchResult(int i, int i2, @Nullable Intent intent) {
String str = this.mRcToKey.get(Integer.valueOf(i));
if (str == null) {
return false;
}
doDispatch(str, i2, intent, this.mKeyToCallback.get(str));
return true;
}
@MainThread
public final <O> boolean dispatchResult(int i, @SuppressLint({"UnknownNullness"}) O o) {
ActivityResultCallback<?> activityResultCallback;
String str = this.mRcToKey.get(Integer.valueOf(i));
if (str == null) {
return false;
}
CallbackAndContract<?> callbackAndContract = this.mKeyToCallback.get(str);
if (callbackAndContract == null || (activityResultCallback = callbackAndContract.mCallback) == null) {
this.mPendingResults.remove(str);
this.mParsedPendingResults.put(str, o);
return true;
}
if (!this.mLaunchedKeys.remove(str)) {
return true;
}
activityResultCallback.onActivityResult(o);
return true;
}
private <O> void doDispatch(String str, int i, @Nullable Intent intent, @Nullable CallbackAndContract<O> callbackAndContract) {
if (callbackAndContract != null && callbackAndContract.mCallback != null && this.mLaunchedKeys.contains(str)) {
callbackAndContract.mCallback.onActivityResult(callbackAndContract.mContract.parseResult(i, intent));
this.mLaunchedKeys.remove(str);
} else {
this.mParsedPendingResults.remove(str);
this.mPendingResults.putParcelable(str, new ActivityResult(i, intent));
}
}
private void registerKey(String str) {
if (this.mKeyToRc.get(str) != null) {
return;
}
bindRcKey(generateRandomNumber(), str);
}
private int generateRandomNumber() {
int nextInt = this.mRandom.nextInt(2147418112);
while (true) {
int i = nextInt + 65536;
if (!this.mRcToKey.containsKey(Integer.valueOf(i))) {
return i;
}
nextInt = this.mRandom.nextInt(2147418112);
}
}
private void bindRcKey(int i, String str) {
this.mRcToKey.put(Integer.valueOf(i), str);
this.mKeyToRc.put(str, Integer.valueOf(i));
}
public static class CallbackAndContract<O> {
final ActivityResultCallback<O> mCallback;
final ActivityResultContract<?, O> mContract;
public CallbackAndContract(ActivityResultCallback<O> activityResultCallback, ActivityResultContract<?, O> activityResultContract) {
this.mCallback = activityResultCallback;
this.mContract = activityResultContract;
}
}
public static class LifecycleContainer {
final Lifecycle mLifecycle;
private final ArrayList<LifecycleEventObserver> mObservers = new ArrayList<>();
public LifecycleContainer(@NonNull Lifecycle lifecycle) {
this.mLifecycle = lifecycle;
}
public void addObserver(@NonNull LifecycleEventObserver lifecycleEventObserver) {
this.mLifecycle.addObserver(lifecycleEventObserver);
this.mObservers.add(lifecycleEventObserver);
}
public void clearObservers() {
Iterator<LifecycleEventObserver> it = this.mObservers.iterator();
while (it.hasNext()) {
this.mLifecycle.removeObserver(it.next());
}
this.mObservers.clear();
}
}
}

View File

@@ -0,0 +1,6 @@
package androidx.activity.result;
/* loaded from: classes.dex */
public interface ActivityResultRegistryOwner {
ActivityResultRegistry getActivityResultRegistry();
}

View File

@@ -0,0 +1,166 @@
package androidx.activity.result;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.IntentSender;
import android.os.Parcel;
import android.os.Parcelable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
@SuppressLint({"BanParcelableUsage"})
/* loaded from: classes.dex */
public final class IntentSenderRequest implements Parcelable {
private final Intent fillInIntent;
private final int flagsMask;
private final int flagsValues;
private final IntentSender intentSender;
public static final Companion Companion = new Companion(null);
public static final Parcelable.Creator<IntentSenderRequest> CREATOR = new Parcelable.Creator<IntentSenderRequest>() { // from class: androidx.activity.result.IntentSenderRequest$Companion$CREATOR$1
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public IntentSenderRequest createFromParcel(Parcel inParcel) {
Intrinsics.checkNotNullParameter(inParcel, "inParcel");
return new IntentSenderRequest(inParcel);
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public IntentSenderRequest[] newArray(int i) {
return new IntentSenderRequest[i];
}
};
@Override // android.os.Parcelable
public int describeContents() {
return 0;
}
public final Intent getFillInIntent() {
return this.fillInIntent;
}
public final int getFlagsMask() {
return this.flagsMask;
}
public final int getFlagsValues() {
return this.flagsValues;
}
public final IntentSender getIntentSender() {
return this.intentSender;
}
public IntentSenderRequest(IntentSender intentSender, Intent intent, int i, int i2) {
Intrinsics.checkNotNullParameter(intentSender, "intentSender");
this.intentSender = intentSender;
this.fillInIntent = intent;
this.flagsMask = i;
this.flagsValues = i2;
}
public /* synthetic */ IntentSenderRequest(IntentSender intentSender, Intent intent, int i, int i2, int i3, DefaultConstructorMarker defaultConstructorMarker) {
this(intentSender, (i3 & 2) != 0 ? null : intent, (i3 & 4) != 0 ? 0 : i, (i3 & 8) != 0 ? 0 : i2);
}
/* JADX WARN: Illegal instructions before constructor call */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public IntentSenderRequest(android.os.Parcel r4) {
/*
r3 = this;
java.lang.String r0 = "parcel"
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r4, r0)
java.lang.Class<android.content.IntentSender> r0 = android.content.IntentSender.class
java.lang.ClassLoader r0 = r0.getClassLoader()
android.os.Parcelable r0 = r4.readParcelable(r0)
kotlin.jvm.internal.Intrinsics.checkNotNull(r0)
android.content.IntentSender r0 = (android.content.IntentSender) r0
java.lang.Class<android.content.Intent> r1 = android.content.Intent.class
java.lang.ClassLoader r1 = r1.getClassLoader()
android.os.Parcelable r1 = r4.readParcelable(r1)
android.content.Intent r1 = (android.content.Intent) r1
int r2 = r4.readInt()
int r4 = r4.readInt()
r3.<init>(r0, r1, r2, r4)
return
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.activity.result.IntentSenderRequest.<init>(android.os.Parcel):void");
}
@Override // android.os.Parcelable
public void writeToParcel(Parcel dest, int i) {
Intrinsics.checkNotNullParameter(dest, "dest");
dest.writeParcelable(this.intentSender, i);
dest.writeParcelable(this.fillInIntent, i);
dest.writeInt(this.flagsMask);
dest.writeInt(this.flagsValues);
}
public static final class Builder {
private Intent fillInIntent;
private int flagsMask;
private int flagsValues;
private final IntentSender intentSender;
@Retention(RetentionPolicy.SOURCE)
public @interface Flag {
}
public final Builder setFillInIntent(Intent intent) {
this.fillInIntent = intent;
return this;
}
public final Builder setFlags(int i, int i2) {
this.flagsValues = i;
this.flagsMask = i2;
return this;
}
public Builder(IntentSender intentSender) {
Intrinsics.checkNotNullParameter(intentSender, "intentSender");
this.intentSender = intentSender;
}
/* JADX WARN: Illegal instructions before constructor call */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public Builder(android.app.PendingIntent r2) {
/*
r1 = this;
java.lang.String r0 = "pendingIntent"
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r2, r0)
android.content.IntentSender r2 = r2.getIntentSender()
java.lang.String r0 = "pendingIntent.intentSender"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r2, r0)
r1.<init>(r2)
return
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.activity.result.IntentSenderRequest.Builder.<init>(android.app.PendingIntent):void");
}
public final IntentSenderRequest build() {
return new IntentSenderRequest(this.intentSender, this.fillInIntent, this.flagsMask, this.flagsValues);
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public static /* synthetic */ void getCREATOR$annotations() {
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,34 @@
package androidx.activity.result;
import androidx.activity.result.contract.ActivityResultContracts;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class PickVisualMediaRequest {
private ActivityResultContracts.PickVisualMedia.VisualMediaType mediaType = ActivityResultContracts.PickVisualMedia.ImageAndVideo.INSTANCE;
public final ActivityResultContracts.PickVisualMedia.VisualMediaType getMediaType() {
return this.mediaType;
}
public final void setMediaType$activity_release(ActivityResultContracts.PickVisualMedia.VisualMediaType visualMediaType) {
Intrinsics.checkNotNullParameter(visualMediaType, "<set-?>");
this.mediaType = visualMediaType;
}
public static final class Builder {
private ActivityResultContracts.PickVisualMedia.VisualMediaType mediaType = ActivityResultContracts.PickVisualMedia.ImageAndVideo.INSTANCE;
public final Builder setMediaType(ActivityResultContracts.PickVisualMedia.VisualMediaType mediaType) {
Intrinsics.checkNotNullParameter(mediaType, "mediaType");
this.mediaType = mediaType;
return this;
}
public final PickVisualMediaRequest build() {
PickVisualMediaRequest pickVisualMediaRequest = new PickVisualMediaRequest();
pickVisualMediaRequest.setMediaType$activity_release(this.mediaType);
return pickVisualMediaRequest;
}
}
}

View File

@@ -0,0 +1,20 @@
package androidx.activity.result;
import androidx.activity.result.PickVisualMediaRequest;
import androidx.activity.result.contract.ActivityResultContracts;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class PickVisualMediaRequestKt {
public static /* synthetic */ PickVisualMediaRequest PickVisualMediaRequest$default(ActivityResultContracts.PickVisualMedia.VisualMediaType visualMediaType, int i, Object obj) {
if ((i & 1) != 0) {
visualMediaType = ActivityResultContracts.PickVisualMedia.ImageAndVideo.INSTANCE;
}
return PickVisualMediaRequest(visualMediaType);
}
public static final PickVisualMediaRequest PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.VisualMediaType mediaType) {
Intrinsics.checkNotNullParameter(mediaType, "mediaType");
return new PickVisualMediaRequest.Builder().setMediaType(mediaType).build();
}
}

View File

@@ -0,0 +1,29 @@
package androidx.activity.result.contract;
import android.content.Context;
import android.content.Intent;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public abstract class ActivityResultContract<I, O> {
public abstract Intent createIntent(Context context, I i);
public SynchronousResult<O> getSynchronousResult(Context context, I i) {
Intrinsics.checkNotNullParameter(context, "context");
return null;
}
public abstract O parseResult(int i, Intent intent);
public static final class SynchronousResult<T> {
private final T value;
public final T getValue() {
return this.value;
}
public SynchronousResult(T t) {
this.value = t;
}
}
}

View File

@@ -0,0 +1,5 @@
package androidx.activity.result.contract;
/* loaded from: classes.dex */
public abstract /* synthetic */ class ActivityResultContracts$PickMultipleVisualMedia$$ExternalSyntheticApiModelOutline0 {
}

View File

@@ -0,0 +1,5 @@
package androidx.activity.result.contract;
/* loaded from: classes.dex */
public abstract /* synthetic */ class ActivityResultContracts$PickVisualMedia$Companion$$ExternalSyntheticApiModelOutline0 {
}

View File

@@ -0,0 +1,917 @@
package androidx.activity.result.contract;
import android.annotation.SuppressLint;
import android.content.ClipData;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.ResolveInfo;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.os.ext.SdkExtensions;
import android.provider.MediaStore;
import androidx.activity.result.ActivityResult;
import androidx.activity.result.IntentSenderRequest;
import androidx.activity.result.PickVisualMediaRequest;
import androidx.activity.result.contract.ActivityResultContract;
import androidx.annotation.CallSuper;
import androidx.annotation.RequiresApi;
import androidx.core.content.ContextCompat;
import com.google.ar.core.ImageMetadata;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import kotlin.NoWhenBranchMatchedException;
import kotlin.Pair;
import kotlin.TuplesKt;
import kotlin.collections.ArraysKt___ArraysKt;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.collections.MapsKt__MapsJVMKt;
import kotlin.collections.MapsKt__MapsKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.ranges.RangesKt___RangesKt;
/* loaded from: classes.dex */
public final class ActivityResultContracts {
private ActivityResultContracts() {
}
public static final class StartActivityForResult extends ActivityResultContract<Intent, ActivityResult> {
public static final Companion Companion = new Companion(null);
public static final String EXTRA_ACTIVITY_OPTIONS_BUNDLE = "androidx.activity.result.contract.extra.ACTIVITY_OPTIONS_BUNDLE";
@Override // androidx.activity.result.contract.ActivityResultContract
public Intent createIntent(Context context, Intent input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
return input;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // androidx.activity.result.contract.ActivityResultContract
public ActivityResult parseResult(int i, Intent intent) {
return new ActivityResult(i, intent);
}
}
public static final class StartIntentSenderForResult extends ActivityResultContract<IntentSenderRequest, ActivityResult> {
public static final String ACTION_INTENT_SENDER_REQUEST = "androidx.activity.result.contract.action.INTENT_SENDER_REQUEST";
public static final Companion Companion = new Companion(null);
public static final String EXTRA_INTENT_SENDER_REQUEST = "androidx.activity.result.contract.extra.INTENT_SENDER_REQUEST";
public static final String EXTRA_SEND_INTENT_EXCEPTION = "androidx.activity.result.contract.extra.SEND_INTENT_EXCEPTION";
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
@Override // androidx.activity.result.contract.ActivityResultContract
public Intent createIntent(Context context, IntentSenderRequest input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
Intent putExtra = new Intent(ACTION_INTENT_SENDER_REQUEST).putExtra(EXTRA_INTENT_SENDER_REQUEST, input);
Intrinsics.checkNotNullExpressionValue(putExtra, "Intent(ACTION_INTENT_SEN…NT_SENDER_REQUEST, input)");
return putExtra;
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // androidx.activity.result.contract.ActivityResultContract
public ActivityResult parseResult(int i, Intent intent) {
return new ActivityResult(i, intent);
}
}
@SourceDebugExtension({"SMAP\nActivityResultContracts.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ActivityResultContracts.kt\nandroidx/activity/result/contract/ActivityResultContracts$RequestMultiplePermissions\n+ 2 _Arrays.kt\nkotlin/collections/ArraysKt___ArraysKt\n*L\n1#1,959:1\n12541#2,2:960\n8676#2,2:962\n9358#2,4:964\n11365#2:968\n11700#2,3:969\n*S KotlinDebug\n*F\n+ 1 ActivityResultContracts.kt\nandroidx/activity/result/contract/ActivityResultContracts$RequestMultiplePermissions\n*L\n188#1:960,2\n195#1:962,2\n195#1:964,4\n208#1:968\n208#1:969,3\n*E\n"})
public static final class RequestMultiplePermissions extends ActivityResultContract<String[], Map<String, Boolean>> {
public static final String ACTION_REQUEST_PERMISSIONS = "androidx.activity.result.contract.action.REQUEST_PERMISSIONS";
public static final Companion Companion = new Companion(null);
public static final String EXTRA_PERMISSIONS = "androidx.activity.result.contract.extra.PERMISSIONS";
public static final String EXTRA_PERMISSION_GRANT_RESULTS = "androidx.activity.result.contract.extra.PERMISSION_GRANT_RESULTS";
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final Intent createIntent$activity_release(String[] input) {
Intrinsics.checkNotNullParameter(input, "input");
Intent putExtra = new Intent(RequestMultiplePermissions.ACTION_REQUEST_PERMISSIONS).putExtra(RequestMultiplePermissions.EXTRA_PERMISSIONS, input);
Intrinsics.checkNotNullExpressionValue(putExtra, "Intent(ACTION_REQUEST_PE…EXTRA_PERMISSIONS, input)");
return putExtra;
}
}
@Override // androidx.activity.result.contract.ActivityResultContract
public Intent createIntent(Context context, String[] input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
return Companion.createIntent$activity_release(input);
}
@Override // androidx.activity.result.contract.ActivityResultContract
public ActivityResultContract.SynchronousResult<Map<String, Boolean>> getSynchronousResult(Context context, String[] input) {
int mapCapacity;
int coerceAtLeast;
Map emptyMap;
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
if (input.length == 0) {
emptyMap = MapsKt__MapsKt.emptyMap();
return new ActivityResultContract.SynchronousResult<>(emptyMap);
}
for (String str : input) {
if (ContextCompat.checkSelfPermission(context, str) != 0) {
return null;
}
}
mapCapacity = MapsKt__MapsJVMKt.mapCapacity(input.length);
coerceAtLeast = RangesKt___RangesKt.coerceAtLeast(mapCapacity, 16);
LinkedHashMap linkedHashMap = new LinkedHashMap(coerceAtLeast);
for (String str2 : input) {
Pair pair = TuplesKt.to(str2, Boolean.TRUE);
linkedHashMap.put(pair.getFirst(), pair.getSecond());
}
return new ActivityResultContract.SynchronousResult<>(linkedHashMap);
}
@Override // androidx.activity.result.contract.ActivityResultContract
public Map<String, Boolean> parseResult(int i, Intent intent) {
Map<String, Boolean> emptyMap;
List filterNotNull;
List zip;
Map<String, Boolean> map;
Map<String, Boolean> emptyMap2;
Map<String, Boolean> emptyMap3;
if (i != -1) {
emptyMap3 = MapsKt__MapsKt.emptyMap();
return emptyMap3;
}
if (intent == null) {
emptyMap2 = MapsKt__MapsKt.emptyMap();
return emptyMap2;
}
String[] stringArrayExtra = intent.getStringArrayExtra(EXTRA_PERMISSIONS);
int[] intArrayExtra = intent.getIntArrayExtra(EXTRA_PERMISSION_GRANT_RESULTS);
if (intArrayExtra == null || stringArrayExtra == null) {
emptyMap = MapsKt__MapsKt.emptyMap();
return emptyMap;
}
ArrayList arrayList = new ArrayList(intArrayExtra.length);
for (int i2 : intArrayExtra) {
arrayList.add(Boolean.valueOf(i2 == 0));
}
filterNotNull = ArraysKt___ArraysKt.filterNotNull(stringArrayExtra);
zip = CollectionsKt___CollectionsKt.zip(filterNotNull, arrayList);
map = MapsKt__MapsKt.toMap(zip);
return map;
}
}
@SourceDebugExtension({"SMAP\nActivityResultContracts.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ActivityResultContracts.kt\nandroidx/activity/result/contract/ActivityResultContracts$RequestPermission\n+ 2 _Arrays.kt\nkotlin/collections/ArraysKt___ArraysKt\n*L\n1#1,959:1\n12774#2,2:960\n*S KotlinDebug\n*F\n+ 1 ActivityResultContracts.kt\nandroidx/activity/result/contract/ActivityResultContracts$RequestPermission\n*L\n228#1:960,2\n*E\n"})
public static final class RequestPermission extends ActivityResultContract<String, Boolean> {
@Override // androidx.activity.result.contract.ActivityResultContract
public Intent createIntent(Context context, String input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
return RequestMultiplePermissions.Companion.createIntent$activity_release(new String[]{input});
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // androidx.activity.result.contract.ActivityResultContract
public Boolean parseResult(int i, Intent intent) {
if (intent == null || i != -1) {
return Boolean.FALSE;
}
int[] intArrayExtra = intent.getIntArrayExtra(RequestMultiplePermissions.EXTRA_PERMISSION_GRANT_RESULTS);
boolean z = false;
if (intArrayExtra != null) {
int length = intArrayExtra.length;
int i2 = 0;
while (true) {
if (i2 >= length) {
break;
}
if (intArrayExtra[i2] == 0) {
z = true;
break;
}
i2++;
}
}
return Boolean.valueOf(z);
}
@Override // androidx.activity.result.contract.ActivityResultContract
public ActivityResultContract.SynchronousResult<Boolean> getSynchronousResult(Context context, String input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
if (ContextCompat.checkSelfPermission(context, input) == 0) {
return new ActivityResultContract.SynchronousResult<>(Boolean.TRUE);
}
return null;
}
}
@SourceDebugExtension({"SMAP\nActivityResultContracts.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ActivityResultContracts.kt\nandroidx/activity/result/contract/ActivityResultContracts$TakePicturePreview\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,959:1\n1#2:960\n*E\n"})
public static class TakePicturePreview extends ActivityResultContract<Void, Bitmap> {
@Override // androidx.activity.result.contract.ActivityResultContract
public final ActivityResultContract.SynchronousResult<Bitmap> getSynchronousResult(Context context, Void r2) {
Intrinsics.checkNotNullParameter(context, "context");
return null;
}
@Override // androidx.activity.result.contract.ActivityResultContract
@CallSuper
public Intent createIntent(Context context, Void r2) {
Intrinsics.checkNotNullParameter(context, "context");
return new Intent("android.media.action.IMAGE_CAPTURE");
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // androidx.activity.result.contract.ActivityResultContract
public final Bitmap parseResult(int i, Intent intent) {
if (i != -1) {
intent = null;
}
if (intent != null) {
return (Bitmap) intent.getParcelableExtra("data");
}
return null;
}
}
public static class TakePicture extends ActivityResultContract<Uri, Boolean> {
@Override // androidx.activity.result.contract.ActivityResultContract
public final ActivityResultContract.SynchronousResult<Boolean> getSynchronousResult(Context context, Uri input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
return null;
}
@Override // androidx.activity.result.contract.ActivityResultContract
@CallSuper
public Intent createIntent(Context context, Uri input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
Intent putExtra = new Intent("android.media.action.IMAGE_CAPTURE").putExtra("output", input);
Intrinsics.checkNotNullExpressionValue(putExtra, "Intent(MediaStore.ACTION…tore.EXTRA_OUTPUT, input)");
return putExtra;
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // androidx.activity.result.contract.ActivityResultContract
public final Boolean parseResult(int i, Intent intent) {
return Boolean.valueOf(i == -1);
}
}
@SourceDebugExtension({"SMAP\nActivityResultContracts.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ActivityResultContracts.kt\nandroidx/activity/result/contract/ActivityResultContracts$TakeVideo\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,959:1\n1#2:960\n*E\n"})
public static class TakeVideo extends ActivityResultContract<Uri, Bitmap> {
@Override // androidx.activity.result.contract.ActivityResultContract
public final ActivityResultContract.SynchronousResult<Bitmap> getSynchronousResult(Context context, Uri input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
return null;
}
@Override // androidx.activity.result.contract.ActivityResultContract
@CallSuper
public Intent createIntent(Context context, Uri input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
Intent putExtra = new Intent("android.media.action.VIDEO_CAPTURE").putExtra("output", input);
Intrinsics.checkNotNullExpressionValue(putExtra, "Intent(MediaStore.ACTION…tore.EXTRA_OUTPUT, input)");
return putExtra;
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // androidx.activity.result.contract.ActivityResultContract
public final Bitmap parseResult(int i, Intent intent) {
if (i != -1) {
intent = null;
}
if (intent != null) {
return (Bitmap) intent.getParcelableExtra("data");
}
return null;
}
}
public static class CaptureVideo extends ActivityResultContract<Uri, Boolean> {
@Override // androidx.activity.result.contract.ActivityResultContract
public final ActivityResultContract.SynchronousResult<Boolean> getSynchronousResult(Context context, Uri input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
return null;
}
@Override // androidx.activity.result.contract.ActivityResultContract
@CallSuper
public Intent createIntent(Context context, Uri input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
Intent putExtra = new Intent("android.media.action.VIDEO_CAPTURE").putExtra("output", input);
Intrinsics.checkNotNullExpressionValue(putExtra, "Intent(MediaStore.ACTION…tore.EXTRA_OUTPUT, input)");
return putExtra;
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // androidx.activity.result.contract.ActivityResultContract
public final Boolean parseResult(int i, Intent intent) {
return Boolean.valueOf(i == -1);
}
}
@SourceDebugExtension({"SMAP\nActivityResultContracts.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ActivityResultContracts.kt\nandroidx/activity/result/contract/ActivityResultContracts$PickContact\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,959:1\n1#2:960\n*E\n"})
public static final class PickContact extends ActivityResultContract<Void, Uri> {
@Override // androidx.activity.result.contract.ActivityResultContract
public Intent createIntent(Context context, Void r2) {
Intrinsics.checkNotNullParameter(context, "context");
Intent type = new Intent("android.intent.action.PICK").setType("vnd.android.cursor.dir/contact");
Intrinsics.checkNotNullExpressionValue(type, "Intent(Intent.ACTION_PIC…ct.Contacts.CONTENT_TYPE)");
return type;
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // androidx.activity.result.contract.ActivityResultContract
public Uri parseResult(int i, Intent intent) {
if (i != -1) {
intent = null;
}
if (intent != null) {
return intent.getData();
}
return null;
}
}
@SourceDebugExtension({"SMAP\nActivityResultContracts.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ActivityResultContracts.kt\nandroidx/activity/result/contract/ActivityResultContracts$GetContent\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,959:1\n1#2:960\n*E\n"})
public static class GetContent extends ActivityResultContract<String, Uri> {
@Override // androidx.activity.result.contract.ActivityResultContract
public final ActivityResultContract.SynchronousResult<Uri> getSynchronousResult(Context context, String input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
return null;
}
@Override // androidx.activity.result.contract.ActivityResultContract
@CallSuper
public Intent createIntent(Context context, String input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
Intent type = new Intent("android.intent.action.GET_CONTENT").addCategory("android.intent.category.OPENABLE").setType(input);
Intrinsics.checkNotNullExpressionValue(type, "Intent(Intent.ACTION_GET… .setType(input)");
return type;
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // androidx.activity.result.contract.ActivityResultContract
public final Uri parseResult(int i, Intent intent) {
if (i != -1) {
intent = null;
}
if (intent != null) {
return intent.getData();
}
return null;
}
}
@RequiresApi(18)
public static class GetMultipleContents extends ActivityResultContract<String, List<Uri>> {
public static final Companion Companion = new Companion(null);
@Override // androidx.activity.result.contract.ActivityResultContract
public final ActivityResultContract.SynchronousResult<List<Uri>> getSynchronousResult(Context context, String input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
return null;
}
@Override // androidx.activity.result.contract.ActivityResultContract
@CallSuper
public Intent createIntent(Context context, String input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
Intent putExtra = new Intent("android.intent.action.GET_CONTENT").addCategory("android.intent.category.OPENABLE").setType(input).putExtra("android.intent.extra.ALLOW_MULTIPLE", true);
Intrinsics.checkNotNullExpressionValue(putExtra, "Intent(Intent.ACTION_GET…TRA_ALLOW_MULTIPLE, true)");
return putExtra;
}
@Override // androidx.activity.result.contract.ActivityResultContract
public final List<Uri> parseResult(int i, Intent intent) {
List<Uri> clipDataUris$activity_release;
if (i != -1) {
intent = null;
}
return (intent == null || (clipDataUris$activity_release = Companion.getClipDataUris$activity_release(intent)) == null) ? CollectionsKt__CollectionsKt.emptyList() : clipDataUris$activity_release;
}
@RequiresApi(18)
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final List<Uri> getClipDataUris$activity_release(Intent intent) {
Intrinsics.checkNotNullParameter(intent, "<this>");
LinkedHashSet linkedHashSet = new LinkedHashSet();
Uri data = intent.getData();
if (data != null) {
linkedHashSet.add(data);
}
ClipData clipData = intent.getClipData();
if (clipData == null && linkedHashSet.isEmpty()) {
return CollectionsKt__CollectionsKt.emptyList();
}
if (clipData != null) {
int itemCount = clipData.getItemCount();
for (int i = 0; i < itemCount; i++) {
Uri uri = clipData.getItemAt(i).getUri();
if (uri != null) {
linkedHashSet.add(uri);
}
}
}
return new ArrayList(linkedHashSet);
}
}
}
@RequiresApi(19)
@SourceDebugExtension({"SMAP\nActivityResultContracts.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ActivityResultContracts.kt\nandroidx/activity/result/contract/ActivityResultContracts$OpenDocument\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,959:1\n1#2:960\n*E\n"})
public static class OpenDocument extends ActivityResultContract<String[], Uri> {
@Override // androidx.activity.result.contract.ActivityResultContract
public final ActivityResultContract.SynchronousResult<Uri> getSynchronousResult(Context context, String[] input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
return null;
}
@Override // androidx.activity.result.contract.ActivityResultContract
@CallSuper
public Intent createIntent(Context context, String[] input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
Intent type = new Intent("android.intent.action.OPEN_DOCUMENT").putExtra("android.intent.extra.MIME_TYPES", input).setType("*/*");
Intrinsics.checkNotNullExpressionValue(type, "Intent(Intent.ACTION_OPE… .setType(\"*/*\")");
return type;
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // androidx.activity.result.contract.ActivityResultContract
public final Uri parseResult(int i, Intent intent) {
if (i != -1) {
intent = null;
}
if (intent != null) {
return intent.getData();
}
return null;
}
}
@RequiresApi(19)
public static class OpenMultipleDocuments extends ActivityResultContract<String[], List<Uri>> {
@Override // androidx.activity.result.contract.ActivityResultContract
public final ActivityResultContract.SynchronousResult<List<Uri>> getSynchronousResult(Context context, String[] input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
return null;
}
@Override // androidx.activity.result.contract.ActivityResultContract
@CallSuper
public Intent createIntent(Context context, String[] input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
Intent type = new Intent("android.intent.action.OPEN_DOCUMENT").putExtra("android.intent.extra.MIME_TYPES", input).putExtra("android.intent.extra.ALLOW_MULTIPLE", true).setType("*/*");
Intrinsics.checkNotNullExpressionValue(type, "Intent(Intent.ACTION_OPE… .setType(\"*/*\")");
return type;
}
@Override // androidx.activity.result.contract.ActivityResultContract
public final List<Uri> parseResult(int i, Intent intent) {
List<Uri> clipDataUris$activity_release;
if (i != -1) {
intent = null;
}
return (intent == null || (clipDataUris$activity_release = GetMultipleContents.Companion.getClipDataUris$activity_release(intent)) == null) ? CollectionsKt__CollectionsKt.emptyList() : clipDataUris$activity_release;
}
}
@RequiresApi(21)
@SourceDebugExtension({"SMAP\nActivityResultContracts.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ActivityResultContracts.kt\nandroidx/activity/result/contract/ActivityResultContracts$OpenDocumentTree\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,959:1\n1#2:960\n*E\n"})
public static class OpenDocumentTree extends ActivityResultContract<Uri, Uri> {
@Override // androidx.activity.result.contract.ActivityResultContract
public final ActivityResultContract.SynchronousResult<Uri> getSynchronousResult(Context context, Uri uri) {
Intrinsics.checkNotNullParameter(context, "context");
return null;
}
@Override // androidx.activity.result.contract.ActivityResultContract
@CallSuper
public Intent createIntent(Context context, Uri uri) {
Intrinsics.checkNotNullParameter(context, "context");
Intent intent = new Intent("android.intent.action.OPEN_DOCUMENT_TREE");
if (uri != null) {
intent.putExtra("android.provider.extra.INITIAL_URI", uri);
}
return intent;
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // androidx.activity.result.contract.ActivityResultContract
public final Uri parseResult(int i, Intent intent) {
if (i != -1) {
intent = null;
}
if (intent != null) {
return intent.getData();
}
return null;
}
}
@RequiresApi(19)
@SourceDebugExtension({"SMAP\nActivityResultContracts.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ActivityResultContracts.kt\nandroidx/activity/result/contract/ActivityResultContracts$CreateDocument\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,959:1\n1#2:960\n*E\n"})
public static class CreateDocument extends ActivityResultContract<String, Uri> {
private final String mimeType;
@Override // androidx.activity.result.contract.ActivityResultContract
public final ActivityResultContract.SynchronousResult<Uri> getSynchronousResult(Context context, String input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
return null;
}
public CreateDocument(String mimeType) {
Intrinsics.checkNotNullParameter(mimeType, "mimeType");
this.mimeType = mimeType;
}
public CreateDocument() {
this("*/*");
}
@Override // androidx.activity.result.contract.ActivityResultContract
@CallSuper
public Intent createIntent(Context context, String input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
Intent putExtra = new Intent("android.intent.action.CREATE_DOCUMENT").setType(this.mimeType).putExtra("android.intent.extra.TITLE", input);
Intrinsics.checkNotNullExpressionValue(putExtra, "Intent(Intent.ACTION_CRE…ntent.EXTRA_TITLE, input)");
return putExtra;
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // androidx.activity.result.contract.ActivityResultContract
public final Uri parseResult(int i, Intent intent) {
if (i != -1) {
intent = null;
}
if (intent != null) {
return intent.getData();
}
return null;
}
}
@RequiresApi(19)
@SourceDebugExtension({"SMAP\nActivityResultContracts.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ActivityResultContracts.kt\nandroidx/activity/result/contract/ActivityResultContracts$PickVisualMedia\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,959:1\n1#2:960\n*E\n"})
public static class PickVisualMedia extends ActivityResultContract<PickVisualMediaRequest, Uri> {
public static final String ACTION_SYSTEM_FALLBACK_PICK_IMAGES = "androidx.activity.result.contract.action.PICK_IMAGES";
public static final Companion Companion = new Companion(null);
public static final String EXTRA_SYSTEM_FALLBACK_PICK_IMAGES_MAX = "androidx.activity.result.contract.extra.PICK_IMAGES_MAX";
public static final String GMS_ACTION_PICK_IMAGES = "com.google.android.gms.provider.action.PICK_IMAGES";
public static final String GMS_EXTRA_PICK_IMAGES_MAX = "com.google.android.gms.provider.extra.PICK_IMAGES_MAX";
public interface VisualMediaType {
}
@SuppressLint({"ClassVerificationFailure", "NewApi"})
public static final boolean isPhotoPickerAvailable() {
return Companion.isPhotoPickerAvailable();
}
@SuppressLint({"ClassVerificationFailure", "NewApi"})
public static final boolean isPhotoPickerAvailable(Context context) {
return Companion.isPhotoPickerAvailable(context);
}
@Override // androidx.activity.result.contract.ActivityResultContract
public final ActivityResultContract.SynchronousResult<Uri> getSynchronousResult(Context context, PickVisualMediaRequest input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
return null;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public static /* synthetic */ void getACTION_SYSTEM_FALLBACK_PICK_IMAGES$annotations() {
}
public static /* synthetic */ void getEXTRA_SYSTEM_FALLBACK_PICK_IMAGES_MAX$annotations() {
}
private Companion() {
}
@SuppressLint({"ClassVerificationFailure", "NewApi"})
public final boolean isPhotoPickerAvailable() {
return isSystemPickerAvailable$activity_release();
}
@SuppressLint({"ClassVerificationFailure", "NewApi"})
public final boolean isPhotoPickerAvailable(Context context) {
Intrinsics.checkNotNullParameter(context, "context");
return isSystemPickerAvailable$activity_release() || isSystemFallbackPickerAvailable$activity_release(context) || isGmsPickerAvailable$activity_release(context);
}
@SuppressLint({"ClassVerificationFailure", "NewApi"})
public final boolean isSystemPickerAvailable$activity_release() {
int extensionVersion;
int i = Build.VERSION.SDK_INT;
if (i >= 33) {
return true;
}
if (i >= 30) {
extensionVersion = SdkExtensions.getExtensionVersion(30);
if (extensionVersion >= 2) {
return true;
}
}
return false;
}
public final boolean isSystemFallbackPickerAvailable$activity_release(Context context) {
Intrinsics.checkNotNullParameter(context, "context");
return getSystemFallbackPicker$activity_release(context) != null;
}
public final ResolveInfo getSystemFallbackPicker$activity_release(Context context) {
Intrinsics.checkNotNullParameter(context, "context");
return context.getPackageManager().resolveActivity(new Intent(PickVisualMedia.ACTION_SYSTEM_FALLBACK_PICK_IMAGES), ImageMetadata.STATISTICS_FACE_DETECT_MODE);
}
public final boolean isGmsPickerAvailable$activity_release(Context context) {
Intrinsics.checkNotNullParameter(context, "context");
return getGmsPicker$activity_release(context) != null;
}
public final ResolveInfo getGmsPicker$activity_release(Context context) {
Intrinsics.checkNotNullParameter(context, "context");
return context.getPackageManager().resolveActivity(new Intent(PickVisualMedia.GMS_ACTION_PICK_IMAGES), ImageMetadata.STATISTICS_FACE_DETECT_MODE);
}
public final String getVisualMimeType$activity_release(VisualMediaType input) {
Intrinsics.checkNotNullParameter(input, "input");
if (input instanceof ImageOnly) {
return "image/*";
}
if (input instanceof VideoOnly) {
return "video/*";
}
if (input instanceof SingleMimeType) {
return ((SingleMimeType) input).getMimeType();
}
if (input instanceof ImageAndVideo) {
return null;
}
throw new NoWhenBranchMatchedException();
}
}
public static final class ImageOnly implements VisualMediaType {
public static final ImageOnly INSTANCE = new ImageOnly();
private ImageOnly() {
}
}
public static final class VideoOnly implements VisualMediaType {
public static final VideoOnly INSTANCE = new VideoOnly();
private VideoOnly() {
}
}
public static final class ImageAndVideo implements VisualMediaType {
public static final ImageAndVideo INSTANCE = new ImageAndVideo();
private ImageAndVideo() {
}
}
public static final class SingleMimeType implements VisualMediaType {
private final String mimeType;
public final String getMimeType() {
return this.mimeType;
}
public SingleMimeType(String mimeType) {
Intrinsics.checkNotNullParameter(mimeType, "mimeType");
this.mimeType = mimeType;
}
}
@Override // androidx.activity.result.contract.ActivityResultContract
@CallSuper
public Intent createIntent(Context context, PickVisualMediaRequest input) {
Intent intent;
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
Companion companion = Companion;
if (companion.isSystemPickerAvailable$activity_release()) {
Intent intent2 = new Intent("android.provider.action.PICK_IMAGES");
intent2.setType(companion.getVisualMimeType$activity_release(input.getMediaType()));
return intent2;
}
if (companion.isSystemFallbackPickerAvailable$activity_release(context)) {
ResolveInfo systemFallbackPicker$activity_release = companion.getSystemFallbackPicker$activity_release(context);
if (systemFallbackPicker$activity_release == null) {
throw new IllegalStateException("Required value was null.".toString());
}
ActivityInfo activityInfo = systemFallbackPicker$activity_release.activityInfo;
intent = new Intent(ACTION_SYSTEM_FALLBACK_PICK_IMAGES);
intent.setClassName(activityInfo.applicationInfo.packageName, activityInfo.name);
intent.setType(companion.getVisualMimeType$activity_release(input.getMediaType()));
} else if (companion.isGmsPickerAvailable$activity_release(context)) {
ResolveInfo gmsPicker$activity_release = companion.getGmsPicker$activity_release(context);
if (gmsPicker$activity_release == null) {
throw new IllegalStateException("Required value was null.".toString());
}
ActivityInfo activityInfo2 = gmsPicker$activity_release.activityInfo;
intent = new Intent(GMS_ACTION_PICK_IMAGES);
intent.setClassName(activityInfo2.applicationInfo.packageName, activityInfo2.name);
intent.setType(companion.getVisualMimeType$activity_release(input.getMediaType()));
} else {
Intent intent3 = new Intent("android.intent.action.OPEN_DOCUMENT");
intent3.setType(companion.getVisualMimeType$activity_release(input.getMediaType()));
if (intent3.getType() != null) {
return intent3;
}
intent3.setType("*/*");
intent3.putExtra("android.intent.extra.MIME_TYPES", new String[]{"image/*", "video/*"});
return intent3;
}
return intent;
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // androidx.activity.result.contract.ActivityResultContract
public final Uri parseResult(int i, Intent intent) {
Object firstOrNull;
if (i != -1) {
intent = null;
}
if (intent == null) {
return null;
}
Uri data = intent.getData();
if (data == null) {
firstOrNull = CollectionsKt___CollectionsKt.firstOrNull((List) GetMultipleContents.Companion.getClipDataUris$activity_release(intent));
data = (Uri) firstOrNull;
}
return data;
}
}
@RequiresApi(19)
public static class PickMultipleVisualMedia extends ActivityResultContract<PickVisualMediaRequest, List<Uri>> {
public static final Companion Companion = new Companion(null);
private final int maxItems;
public PickMultipleVisualMedia() {
this(0, 1, null);
}
@Override // androidx.activity.result.contract.ActivityResultContract
public final ActivityResultContract.SynchronousResult<List<Uri>> getSynchronousResult(Context context, PickVisualMediaRequest input) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
return null;
}
public /* synthetic */ PickMultipleVisualMedia(int i, int i2, DefaultConstructorMarker defaultConstructorMarker) {
this((i2 & 1) != 0 ? Companion.getMaxItems$activity_release() : i);
}
public PickMultipleVisualMedia(int i) {
this.maxItems = i;
if (i <= 1) {
throw new IllegalArgumentException("Max items must be higher than 1".toString());
}
}
@Override // androidx.activity.result.contract.ActivityResultContract
@SuppressLint({"NewApi", "ClassVerificationFailure"})
@CallSuper
public Intent createIntent(Context context, PickVisualMediaRequest input) {
int pickImagesMaxLimit;
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(input, "input");
PickVisualMedia.Companion companion = PickVisualMedia.Companion;
if (companion.isSystemPickerAvailable$activity_release()) {
Intent intent = new Intent("android.provider.action.PICK_IMAGES");
intent.setType(companion.getVisualMimeType$activity_release(input.getMediaType()));
int i = this.maxItems;
pickImagesMaxLimit = MediaStore.getPickImagesMaxLimit();
if (i > pickImagesMaxLimit) {
throw new IllegalArgumentException("Max items must be less or equals MediaStore.getPickImagesMaxLimit()".toString());
}
intent.putExtra("android.provider.extra.PICK_IMAGES_MAX", this.maxItems);
return intent;
}
if (companion.isSystemFallbackPickerAvailable$activity_release(context)) {
ResolveInfo systemFallbackPicker$activity_release = companion.getSystemFallbackPicker$activity_release(context);
if (systemFallbackPicker$activity_release == null) {
throw new IllegalStateException("Required value was null.".toString());
}
ActivityInfo activityInfo = systemFallbackPicker$activity_release.activityInfo;
Intent intent2 = new Intent(PickVisualMedia.ACTION_SYSTEM_FALLBACK_PICK_IMAGES);
intent2.setClassName(activityInfo.applicationInfo.packageName, activityInfo.name);
intent2.setType(companion.getVisualMimeType$activity_release(input.getMediaType()));
intent2.putExtra(PickVisualMedia.GMS_EXTRA_PICK_IMAGES_MAX, this.maxItems);
return intent2;
}
if (companion.isGmsPickerAvailable$activity_release(context)) {
ResolveInfo gmsPicker$activity_release = companion.getGmsPicker$activity_release(context);
if (gmsPicker$activity_release == null) {
throw new IllegalStateException("Required value was null.".toString());
}
ActivityInfo activityInfo2 = gmsPicker$activity_release.activityInfo;
Intent intent3 = new Intent(PickVisualMedia.GMS_ACTION_PICK_IMAGES);
intent3.setClassName(activityInfo2.applicationInfo.packageName, activityInfo2.name);
intent3.putExtra(PickVisualMedia.GMS_EXTRA_PICK_IMAGES_MAX, this.maxItems);
return intent3;
}
Intent intent4 = new Intent("android.intent.action.OPEN_DOCUMENT");
intent4.setType(companion.getVisualMimeType$activity_release(input.getMediaType()));
intent4.putExtra("android.intent.extra.ALLOW_MULTIPLE", true);
if (intent4.getType() != null) {
return intent4;
}
intent4.setType("*/*");
intent4.putExtra("android.intent.extra.MIME_TYPES", new String[]{"image/*", "video/*"});
return intent4;
}
@Override // androidx.activity.result.contract.ActivityResultContract
public final List<Uri> parseResult(int i, Intent intent) {
List<Uri> clipDataUris$activity_release;
if (i != -1) {
intent = null;
}
return (intent == null || (clipDataUris$activity_release = GetMultipleContents.Companion.getClipDataUris$activity_release(intent)) == null) ? CollectionsKt__CollectionsKt.emptyList() : clipDataUris$activity_release;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
@SuppressLint({"NewApi", "ClassVerificationFailure"})
public final int getMaxItems$activity_release() {
int pickImagesMaxLimit;
if (!PickVisualMedia.Companion.isSystemPickerAvailable$activity_release()) {
return Integer.MAX_VALUE;
}
pickImagesMaxLimit = MediaStore.getPickImagesMaxLimit();
return pickImagesMaxLimit;
}
}
}
}