- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
203 lines
7.9 KiB
Java
203 lines
7.9 KiB
Java
package androidx.core.app;
|
|
|
|
import android.annotation.SuppressLint;
|
|
import android.app.PendingIntent;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.os.Build;
|
|
import android.os.Bundle;
|
|
import android.os.Handler;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import androidx.annotation.RequiresApi;
|
|
import androidx.annotation.RestrictTo;
|
|
import androidx.core.app.PendingIntentCompat;
|
|
import androidx.core.view.accessibility.AccessibilityEventCompat;
|
|
import java.io.Closeable;
|
|
import java.lang.annotation.Retention;
|
|
import java.lang.annotation.RetentionPolicy;
|
|
import java.util.concurrent.CountDownLatch;
|
|
|
|
/* loaded from: classes.dex */
|
|
public final class PendingIntentCompat {
|
|
|
|
@Retention(RetentionPolicy.SOURCE)
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
|
public @interface Flags {
|
|
}
|
|
|
|
private static int addMutabilityFlags(boolean z, int i) {
|
|
int i2;
|
|
if (!z) {
|
|
i2 = AccessibilityEventCompat.TYPE_VIEW_TARGETED_BY_SCROLL;
|
|
} else {
|
|
if (Build.VERSION.SDK_INT < 31) {
|
|
return i;
|
|
}
|
|
i2 = 33554432;
|
|
}
|
|
return i | i2;
|
|
}
|
|
|
|
@NonNull
|
|
public static PendingIntent getActivities(@NonNull Context context, int i, @NonNull @SuppressLint({"ArrayReturn"}) Intent[] intentArr, int i2, @Nullable Bundle bundle, boolean z) {
|
|
return PendingIntent.getActivities(context, i, intentArr, addMutabilityFlags(z, i2), bundle);
|
|
}
|
|
|
|
@NonNull
|
|
public static PendingIntent getActivities(@NonNull Context context, int i, @NonNull @SuppressLint({"ArrayReturn"}) Intent[] intentArr, int i2, boolean z) {
|
|
return PendingIntent.getActivities(context, i, intentArr, addMutabilityFlags(z, i2));
|
|
}
|
|
|
|
@Nullable
|
|
public static PendingIntent getActivity(@NonNull Context context, int i, @NonNull Intent intent, int i2, boolean z) {
|
|
return PendingIntent.getActivity(context, i, intent, addMutabilityFlags(z, i2));
|
|
}
|
|
|
|
@Nullable
|
|
public static PendingIntent getActivity(@NonNull Context context, int i, @NonNull Intent intent, int i2, @Nullable Bundle bundle, boolean z) {
|
|
return PendingIntent.getActivity(context, i, intent, addMutabilityFlags(z, i2), bundle);
|
|
}
|
|
|
|
@Nullable
|
|
public static PendingIntent getBroadcast(@NonNull Context context, int i, @NonNull Intent intent, int i2, boolean z) {
|
|
return PendingIntent.getBroadcast(context, i, intent, addMutabilityFlags(z, i2));
|
|
}
|
|
|
|
@NonNull
|
|
@RequiresApi(26)
|
|
public static PendingIntent getForegroundService(@NonNull Context context, int i, @NonNull Intent intent, int i2, boolean z) {
|
|
return Api26Impl.getForegroundService(context, i, intent, addMutabilityFlags(z, i2));
|
|
}
|
|
|
|
@Nullable
|
|
public static PendingIntent getService(@NonNull Context context, int i, @NonNull Intent intent, int i2, boolean z) {
|
|
return PendingIntent.getService(context, i, intent, addMutabilityFlags(z, i2));
|
|
}
|
|
|
|
@SuppressLint({"LambdaLast"})
|
|
public static void send(@NonNull PendingIntent pendingIntent, int i, @Nullable PendingIntent.OnFinished onFinished, @Nullable Handler handler) throws PendingIntent.CanceledException {
|
|
GatedCallback gatedCallback = new GatedCallback(onFinished);
|
|
try {
|
|
pendingIntent.send(i, gatedCallback.getCallback(), handler);
|
|
gatedCallback.complete();
|
|
gatedCallback.close();
|
|
} catch (Throwable th) {
|
|
try {
|
|
gatedCallback.close();
|
|
} catch (Throwable th2) {
|
|
th.addSuppressed(th2);
|
|
}
|
|
throw th;
|
|
}
|
|
}
|
|
|
|
@SuppressLint({"LambdaLast"})
|
|
public static void send(@NonNull PendingIntent pendingIntent, @NonNull @SuppressLint({"ContextFirst"}) Context context, int i, @NonNull Intent intent, @Nullable PendingIntent.OnFinished onFinished, @Nullable Handler handler) throws PendingIntent.CanceledException {
|
|
send(pendingIntent, context, i, intent, onFinished, handler, null, null);
|
|
}
|
|
|
|
@SuppressLint({"LambdaLast"})
|
|
public static void send(@NonNull PendingIntent pendingIntent, @NonNull @SuppressLint({"ContextFirst"}) Context context, int i, @NonNull Intent intent, @Nullable PendingIntent.OnFinished onFinished, @Nullable Handler handler, @Nullable String str, @Nullable Bundle bundle) throws PendingIntent.CanceledException {
|
|
GatedCallback gatedCallback = new GatedCallback(onFinished);
|
|
try {
|
|
Api23Impl.send(pendingIntent, context, i, intent, onFinished, handler, str, bundle);
|
|
gatedCallback.complete();
|
|
gatedCallback.close();
|
|
} catch (Throwable th) {
|
|
try {
|
|
gatedCallback.close();
|
|
} catch (Throwable th2) {
|
|
th.addSuppressed(th2);
|
|
}
|
|
throw th;
|
|
}
|
|
}
|
|
|
|
private PendingIntentCompat() {
|
|
}
|
|
|
|
@RequiresApi(23)
|
|
public static class Api23Impl {
|
|
private Api23Impl() {
|
|
}
|
|
|
|
public static void send(@NonNull PendingIntent pendingIntent, @NonNull Context context, int i, @NonNull Intent intent, @Nullable PendingIntent.OnFinished onFinished, @Nullable Handler handler, @Nullable String str, @Nullable Bundle bundle) throws PendingIntent.CanceledException {
|
|
pendingIntent.send(context, i, intent, onFinished, handler, str, bundle);
|
|
}
|
|
}
|
|
|
|
@RequiresApi(26)
|
|
public static class Api26Impl {
|
|
private Api26Impl() {
|
|
}
|
|
|
|
public static PendingIntent getForegroundService(Context context, int i, Intent intent, int i2) {
|
|
return PendingIntent.getForegroundService(context, i, intent, i2);
|
|
}
|
|
}
|
|
|
|
public static class GatedCallback implements Closeable {
|
|
|
|
@Nullable
|
|
private PendingIntent.OnFinished mCallback;
|
|
private final CountDownLatch mComplete = new CountDownLatch(1);
|
|
private boolean mSuccess = false;
|
|
|
|
public void complete() {
|
|
this.mSuccess = true;
|
|
}
|
|
|
|
public GatedCallback(@Nullable PendingIntent.OnFinished onFinished) {
|
|
this.mCallback = onFinished;
|
|
}
|
|
|
|
@Nullable
|
|
public PendingIntent.OnFinished getCallback() {
|
|
if (this.mCallback == null) {
|
|
return null;
|
|
}
|
|
return new PendingIntent.OnFinished() { // from class: androidx.core.app.PendingIntentCompat$GatedCallback$$ExternalSyntheticLambda0
|
|
@Override // android.app.PendingIntent.OnFinished
|
|
public final void onSendFinished(PendingIntent pendingIntent, Intent intent, int i, String str, Bundle bundle) {
|
|
PendingIntentCompat.GatedCallback.this.onSendFinished(pendingIntent, intent, i, str, bundle);
|
|
}
|
|
};
|
|
}
|
|
|
|
@Override // java.io.Closeable, java.lang.AutoCloseable
|
|
public void close() {
|
|
if (!this.mSuccess) {
|
|
this.mCallback = null;
|
|
}
|
|
this.mComplete.countDown();
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public void onSendFinished(PendingIntent pendingIntent, Intent intent, int i, String str, Bundle bundle) {
|
|
boolean z = false;
|
|
while (true) {
|
|
try {
|
|
this.mComplete.await();
|
|
break;
|
|
} catch (InterruptedException unused) {
|
|
z = true;
|
|
} catch (Throwable th) {
|
|
if (z) {
|
|
Thread.currentThread().interrupt();
|
|
}
|
|
throw th;
|
|
}
|
|
}
|
|
if (z) {
|
|
Thread.currentThread().interrupt();
|
|
}
|
|
PendingIntent.OnFinished onFinished = this.mCallback;
|
|
if (onFinished != null) {
|
|
onFinished.onSendFinished(pendingIntent, intent, i, str, bundle);
|
|
this.mCallback = null;
|
|
}
|
|
}
|
|
}
|
|
}
|