93.9 - Stable (93009)
This commit is contained in:
parent
87b3740ea0
commit
b8eb9e7d19
|
@ -10,8 +10,8 @@ android {
|
|||
applicationId 'com.discord'
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 29
|
||||
versionCode 93008
|
||||
versionName "93.8 - Stable"
|
||||
versionCode 93009
|
||||
versionName "93.9 - Stable"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="93008" android:versionName="93.8 - Stable" android:installLocation="auto" android:compileSdkVersion="30" android:compileSdkVersionCodename="11" package="com.discord" platformBuildVersionCode="30" platformBuildVersionName="11">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="93009" android:versionName="93.9 - Stable" android:installLocation="auto" android:compileSdkVersion="30" android:compileSdkVersionCodename="11" package="com.discord" platformBuildVersionCode="30" platformBuildVersionName="11">
|
||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29"/>
|
||||
<uses-feature android:name="android.hardware.camera" android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
|
||||
|
|
|
@ -30,7 +30,7 @@ public class ResultReceiver implements Parcelable {
|
|||
}
|
||||
}
|
||||
|
||||
public class b extends a.AbstractBinderC0359a {
|
||||
public class b extends a.AbstractBinderC0361a {
|
||||
public b() {
|
||||
}
|
||||
|
||||
|
@ -44,12 +44,12 @@ public class ResultReceiver implements Parcelable {
|
|||
public ResultReceiver(Parcel parcel) {
|
||||
x.a.b.c.a aVar;
|
||||
IBinder readStrongBinder = parcel.readStrongBinder();
|
||||
int i = a.AbstractBinderC0359a.a;
|
||||
int i = a.AbstractBinderC0361a.a;
|
||||
if (readStrongBinder == null) {
|
||||
aVar = null;
|
||||
} else {
|
||||
IInterface queryLocalInterface = readStrongBinder.queryLocalInterface("android.support.v4.os.IResultReceiver");
|
||||
aVar = (queryLocalInterface == null || !(queryLocalInterface instanceof x.a.b.c.a)) ? new a.AbstractBinderC0359a.C0360a(readStrongBinder) : (x.a.b.c.a) queryLocalInterface;
|
||||
aVar = (queryLocalInterface == null || !(queryLocalInterface instanceof x.a.b.c.a)) ? new a.AbstractBinderC0361a.C0362a(readStrongBinder) : (x.a.b.c.a) queryLocalInterface;
|
||||
}
|
||||
this.i = aVar;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
/* compiled from: OptIn.kt */
|
||||
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER, ElementType.CONSTRUCTOR, ElementType.LOCAL_VARIABLE})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
public @interface OptIn {
|
||||
Class<? extends Annotation>[] markerClass();
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
/* compiled from: RequiresOptIn.kt */
|
||||
@Target({ElementType.ANNOTATION_TYPE})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
public @interface RequiresOptIn {
|
||||
|
||||
/* compiled from: RequiresOptIn.kt */
|
||||
public enum Level {
|
||||
WARNING,
|
||||
ERROR
|
||||
}
|
||||
|
||||
Level level() default Level.ERROR;
|
||||
}
|
|
@ -4,10 +4,12 @@ import java.lang.annotation.ElementType;
|
|||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
/* compiled from: Experimental.kt */
|
||||
@Target({ElementType.ANNOTATION_TYPE})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
public @interface Experimental {
|
||||
|
||||
/* compiled from: Experimental.kt */
|
||||
public enum Level {
|
||||
WARNING,
|
||||
ERROR
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
package androidx.annotation.experimental;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.PACKAGE})
|
||||
/* compiled from: UseExperimental.kt */
|
||||
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER, ElementType.CONSTRUCTOR, ElementType.LOCAL_VARIABLE})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
public @interface UseExperimental {
|
||||
Class<?> markerClass();
|
||||
Class<? extends Annotation>[] markerClass();
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public class CustomTabsClient {
|
|||
}
|
||||
|
||||
/* renamed from: androidx.browser.customtabs.CustomTabsClient$2 reason: invalid class name */
|
||||
public class AnonymousClass2 extends a.AbstractBinderC0348a {
|
||||
public class AnonymousClass2 extends a.AbstractBinderC0350a {
|
||||
private Handler mHandler = new Handler(Looper.getMainLooper());
|
||||
public final /* synthetic */ CustomTabsCallback val$callback;
|
||||
|
||||
|
@ -219,7 +219,7 @@ public class CustomTabsClient {
|
|||
}
|
||||
}
|
||||
|
||||
private a.AbstractBinderC0348a createCallbackWrapper(@Nullable CustomTabsCallback customTabsCallback) {
|
||||
private a.AbstractBinderC0350a createCallbackWrapper(@Nullable CustomTabsCallback customTabsCallback) {
|
||||
return new AnonymousClass2(customTabsCallback);
|
||||
}
|
||||
|
||||
|
@ -270,7 +270,7 @@ public class CustomTabsClient {
|
|||
@Nullable
|
||||
private CustomTabsSession newSessionInternal(@Nullable CustomTabsCallback customTabsCallback, @Nullable PendingIntent pendingIntent) {
|
||||
boolean z2;
|
||||
a.AbstractBinderC0348a createCallbackWrapper = createCallbackWrapper(customTabsCallback);
|
||||
a.AbstractBinderC0350a createCallbackWrapper = createCallbackWrapper(customTabsCallback);
|
||||
if (pendingIntent != null) {
|
||||
try {
|
||||
Bundle bundle = new Bundle();
|
||||
|
|
|
@ -83,8 +83,8 @@ public class CustomTabsSessionToken {
|
|||
}
|
||||
}
|
||||
|
||||
public static class MockCallback extends a.AbstractBinderC0348a {
|
||||
@Override // x.a.a.a.AbstractBinderC0348a, android.os.IInterface
|
||||
public static class MockCallback extends a.AbstractBinderC0350a {
|
||||
@Override // x.a.a.a.AbstractBinderC0350a, android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this;
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ public class CustomTabsSessionToken {
|
|||
return null;
|
||||
}
|
||||
if (binder != null) {
|
||||
aVar = a.AbstractBinderC0348a.asInterface(binder);
|
||||
aVar = a.AbstractBinderC0350a.asInterface(binder);
|
||||
}
|
||||
return new CustomTabsSessionToken(aVar, pendingIntent);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ public abstract class PostMessageServiceConnection implements PostMessageBackend
|
|||
public PostMessageServiceConnection(@NonNull CustomTabsSessionToken customTabsSessionToken) {
|
||||
IBinder callbackBinder = customTabsSessionToken.getCallbackBinder();
|
||||
if (callbackBinder != null) {
|
||||
this.mSessionBinder = a.AbstractBinderC0348a.asInterface(callbackBinder);
|
||||
this.mSessionBinder = a.AbstractBinderC0350a.asInterface(callbackBinder);
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException("Provided session must have binder.");
|
||||
|
|
|
@ -15,7 +15,7 @@ public class TrustedWebActivityCallbackRemote {
|
|||
|
||||
@Nullable
|
||||
public static TrustedWebActivityCallbackRemote fromBinder(@Nullable IBinder iBinder) {
|
||||
a asInterface = iBinder == null ? null : a.AbstractBinderC0352a.asInterface(iBinder);
|
||||
a asInterface = iBinder == null ? null : a.AbstractBinderC0354a.asInterface(iBinder);
|
||||
if (asInterface == null) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ public final class TrustedWebActivityServiceConnection {
|
|||
private final b mService;
|
||||
|
||||
/* renamed from: androidx.browser.trusted.TrustedWebActivityServiceConnection$1 reason: invalid class name */
|
||||
public class AnonymousClass1 extends a.AbstractBinderC0352a {
|
||||
public class AnonymousClass1 extends a.AbstractBinderC0354a {
|
||||
public final /* synthetic */ TrustedWebActivityCallback val$callback;
|
||||
|
||||
public AnonymousClass1(TrustedWebActivityCallback trustedWebActivityCallback) {
|
||||
|
|
|
@ -22,6 +22,6 @@ public final class AnimatorKt$addListener$1 extends o implements Function1<Anima
|
|||
}
|
||||
|
||||
public final void invoke(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "it");
|
||||
m.checkNotNullParameter(animator, "it");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,6 @@ public final class AnimatorKt$addListener$2 extends o implements Function1<Anima
|
|||
}
|
||||
|
||||
public final void invoke(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "it");
|
||||
m.checkNotNullParameter(animator, "it");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,6 @@ public final class AnimatorKt$addListener$3 extends o implements Function1<Anima
|
|||
}
|
||||
|
||||
public final void invoke(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "it");
|
||||
m.checkNotNullParameter(animator, "it");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,6 @@ public final class AnimatorKt$addListener$4 extends o implements Function1<Anima
|
|||
}
|
||||
|
||||
public final void invoke(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "it");
|
||||
m.checkNotNullParameter(animator, "it");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,15 +2,21 @@ package androidx.core.animation;
|
|||
|
||||
import android.animation.Animator;
|
||||
import d0.z.d.m;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
/* compiled from: Animator.kt */
|
||||
public final class AnimatorKt$addListener$listener$1 implements Animator.AnimatorListener {
|
||||
public final /* synthetic */ Function1 $onCancel;
|
||||
public final /* synthetic */ Function1 $onEnd;
|
||||
public final /* synthetic */ Function1 $onRepeat;
|
||||
public final /* synthetic */ Function1 $onStart;
|
||||
public final /* synthetic */ Function1<Animator, Unit> $onCancel;
|
||||
public final /* synthetic */ Function1<Animator, Unit> $onEnd;
|
||||
public final /* synthetic */ Function1<Animator, Unit> $onRepeat;
|
||||
public final /* synthetic */ Function1<Animator, Unit> $onStart;
|
||||
|
||||
public AnimatorKt$addListener$listener$1(Function1 function1, Function1 function12, Function1 function13, Function1 function14) {
|
||||
/* JADX DEBUG: Multi-variable search result rejected for r1v0, resolved type: kotlin.jvm.functions.Function1<? super android.animation.Animator, kotlin.Unit> */
|
||||
/* JADX DEBUG: Multi-variable search result rejected for r2v0, resolved type: kotlin.jvm.functions.Function1<? super android.animation.Animator, kotlin.Unit> */
|
||||
/* JADX DEBUG: Multi-variable search result rejected for r3v0, resolved type: kotlin.jvm.functions.Function1<? super android.animation.Animator, kotlin.Unit> */
|
||||
/* JADX DEBUG: Multi-variable search result rejected for r4v0, resolved type: kotlin.jvm.functions.Function1<? super android.animation.Animator, kotlin.Unit> */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public AnimatorKt$addListener$listener$1(Function1<? super Animator, Unit> function1, Function1<? super Animator, Unit> function12, Function1<? super Animator, Unit> function13, Function1<? super Animator, Unit> function14) {
|
||||
this.$onRepeat = function1;
|
||||
this.$onEnd = function12;
|
||||
this.$onCancel = function13;
|
||||
|
@ -19,25 +25,25 @@ public final class AnimatorKt$addListener$listener$1 implements Animator.Animato
|
|||
|
||||
@Override // android.animation.Animator.AnimatorListener
|
||||
public void onAnimationCancel(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
this.$onCancel.invoke(animator);
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorListener
|
||||
public void onAnimationEnd(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
this.$onEnd.invoke(animator);
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorListener
|
||||
public void onAnimationRepeat(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
this.$onRepeat.invoke(animator);
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorListener
|
||||
public void onAnimationStart(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
this.$onStart.invoke(animator);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,6 @@ public final class AnimatorKt$addPauseListener$1 extends o implements Function1<
|
|||
}
|
||||
|
||||
public final void invoke(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "it");
|
||||
m.checkNotNullParameter(animator, "it");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,6 @@ public final class AnimatorKt$addPauseListener$2 extends o implements Function1<
|
|||
}
|
||||
|
||||
public final void invoke(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "it");
|
||||
m.checkNotNullParameter(animator, "it");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,26 +2,30 @@ package androidx.core.animation;
|
|||
|
||||
import android.animation.Animator;
|
||||
import d0.z.d.m;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
/* compiled from: Animator.kt */
|
||||
public final class AnimatorKt$addPauseListener$listener$1 implements Animator.AnimatorPauseListener {
|
||||
public final /* synthetic */ Function1 $onPause;
|
||||
public final /* synthetic */ Function1 $onResume;
|
||||
public final /* synthetic */ Function1<Animator, Unit> $onPause;
|
||||
public final /* synthetic */ Function1<Animator, Unit> $onResume;
|
||||
|
||||
public AnimatorKt$addPauseListener$listener$1(Function1 function1, Function1 function12) {
|
||||
/* JADX DEBUG: Multi-variable search result rejected for r1v0, resolved type: kotlin.jvm.functions.Function1<? super android.animation.Animator, kotlin.Unit> */
|
||||
/* JADX DEBUG: Multi-variable search result rejected for r2v0, resolved type: kotlin.jvm.functions.Function1<? super android.animation.Animator, kotlin.Unit> */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public AnimatorKt$addPauseListener$listener$1(Function1<? super Animator, Unit> function1, Function1<? super Animator, Unit> function12) {
|
||||
this.$onPause = function1;
|
||||
this.$onResume = function12;
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorPauseListener
|
||||
public void onAnimationPause(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
this.$onPause.invoke(animator);
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorPauseListener
|
||||
public void onAnimationResume(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
this.$onResume.invoke(animator);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,31 +4,31 @@ import android.animation.Animator;
|
|||
import d0.z.d.m;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
/* compiled from: Animator.kt */
|
||||
public final class AnimatorKt$doOnCancel$$inlined$addListener$1 implements Animator.AnimatorListener {
|
||||
public final class AnimatorKt$doOnCancel$$inlined$addListener$default$1 implements Animator.AnimatorListener {
|
||||
public final /* synthetic */ Function1 $onCancel;
|
||||
|
||||
public AnimatorKt$doOnCancel$$inlined$addListener$1(Function1 function1) {
|
||||
public AnimatorKt$doOnCancel$$inlined$addListener$default$1(Function1 function1) {
|
||||
this.$onCancel = function1;
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorListener
|
||||
public void onAnimationCancel(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
this.$onCancel.invoke(animator);
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorListener
|
||||
public void onAnimationEnd(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorListener
|
||||
public void onAnimationRepeat(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorListener
|
||||
public void onAnimationStart(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
}
|
||||
}
|
|
@ -4,31 +4,31 @@ import android.animation.Animator;
|
|||
import d0.z.d.m;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
/* compiled from: Animator.kt */
|
||||
public final class AnimatorKt$doOnEnd$$inlined$addListener$1 implements Animator.AnimatorListener {
|
||||
public final class AnimatorKt$doOnEnd$$inlined$addListener$default$1 implements Animator.AnimatorListener {
|
||||
public final /* synthetic */ Function1 $onEnd;
|
||||
|
||||
public AnimatorKt$doOnEnd$$inlined$addListener$1(Function1 function1) {
|
||||
public AnimatorKt$doOnEnd$$inlined$addListener$default$1(Function1 function1) {
|
||||
this.$onEnd = function1;
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorListener
|
||||
public void onAnimationCancel(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorListener
|
||||
public void onAnimationEnd(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
this.$onEnd.invoke(animator);
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorListener
|
||||
public void onAnimationRepeat(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorListener
|
||||
public void onAnimationStart(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
}
|
||||
}
|
|
@ -4,21 +4,21 @@ import android.animation.Animator;
|
|||
import d0.z.d.m;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
/* compiled from: Animator.kt */
|
||||
public final class AnimatorKt$doOnPause$$inlined$addPauseListener$1 implements Animator.AnimatorPauseListener {
|
||||
public final class AnimatorKt$doOnPause$$inlined$addPauseListener$default$1 implements Animator.AnimatorPauseListener {
|
||||
public final /* synthetic */ Function1 $onPause;
|
||||
|
||||
public AnimatorKt$doOnPause$$inlined$addPauseListener$1(Function1 function1) {
|
||||
public AnimatorKt$doOnPause$$inlined$addPauseListener$default$1(Function1 function1) {
|
||||
this.$onPause = function1;
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorPauseListener
|
||||
public void onAnimationPause(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
this.$onPause.invoke(animator);
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorPauseListener
|
||||
public void onAnimationResume(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
}
|
||||
}
|
|
@ -4,31 +4,31 @@ import android.animation.Animator;
|
|||
import d0.z.d.m;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
/* compiled from: Animator.kt */
|
||||
public final class AnimatorKt$doOnRepeat$$inlined$addListener$1 implements Animator.AnimatorListener {
|
||||
public final class AnimatorKt$doOnRepeat$$inlined$addListener$default$1 implements Animator.AnimatorListener {
|
||||
public final /* synthetic */ Function1 $onRepeat;
|
||||
|
||||
public AnimatorKt$doOnRepeat$$inlined$addListener$1(Function1 function1) {
|
||||
public AnimatorKt$doOnRepeat$$inlined$addListener$default$1(Function1 function1) {
|
||||
this.$onRepeat = function1;
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorListener
|
||||
public void onAnimationCancel(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorListener
|
||||
public void onAnimationEnd(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorListener
|
||||
public void onAnimationRepeat(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
this.$onRepeat.invoke(animator);
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorListener
|
||||
public void onAnimationStart(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
}
|
||||
}
|
|
@ -4,21 +4,21 @@ import android.animation.Animator;
|
|||
import d0.z.d.m;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
/* compiled from: Animator.kt */
|
||||
public final class AnimatorKt$doOnResume$$inlined$addPauseListener$1 implements Animator.AnimatorPauseListener {
|
||||
public final class AnimatorKt$doOnResume$$inlined$addPauseListener$default$1 implements Animator.AnimatorPauseListener {
|
||||
public final /* synthetic */ Function1 $onResume;
|
||||
|
||||
public AnimatorKt$doOnResume$$inlined$addPauseListener$1(Function1 function1) {
|
||||
public AnimatorKt$doOnResume$$inlined$addPauseListener$default$1(Function1 function1) {
|
||||
this.$onResume = function1;
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorPauseListener
|
||||
public void onAnimationPause(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorPauseListener
|
||||
public void onAnimationResume(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
this.$onResume.invoke(animator);
|
||||
}
|
||||
}
|
|
@ -4,31 +4,31 @@ import android.animation.Animator;
|
|||
import d0.z.d.m;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
/* compiled from: Animator.kt */
|
||||
public final class AnimatorKt$doOnStart$$inlined$addListener$1 implements Animator.AnimatorListener {
|
||||
public final class AnimatorKt$doOnStart$$inlined$addListener$default$1 implements Animator.AnimatorListener {
|
||||
public final /* synthetic */ Function1 $onStart;
|
||||
|
||||
public AnimatorKt$doOnStart$$inlined$addListener$1(Function1 function1) {
|
||||
public AnimatorKt$doOnStart$$inlined$addListener$default$1(Function1 function1) {
|
||||
this.$onStart = function1;
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorListener
|
||||
public void onAnimationCancel(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorListener
|
||||
public void onAnimationEnd(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorListener
|
||||
public void onAnimationRepeat(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
}
|
||||
|
||||
@Override // android.animation.Animator.AnimatorListener
|
||||
public void onAnimationStart(Animator animator) {
|
||||
m.checkParameterIsNotNull(animator, "animator");
|
||||
m.checkNotNullParameter(animator, "animator");
|
||||
this.$onStart.invoke(animator);
|
||||
}
|
||||
}
|
|
@ -8,11 +8,11 @@ import kotlin.jvm.functions.Function1;
|
|||
/* compiled from: Animator.kt */
|
||||
public final class AnimatorKt {
|
||||
public static final Animator.AnimatorListener addListener(Animator animator, Function1<? super Animator, Unit> function1, Function1<? super Animator, Unit> function12, Function1<? super Animator, Unit> function13, Function1<? super Animator, Unit> function14) {
|
||||
m.checkParameterIsNotNull(animator, "$this$addListener");
|
||||
m.checkParameterIsNotNull(function1, "onEnd");
|
||||
m.checkParameterIsNotNull(function12, "onStart");
|
||||
m.checkParameterIsNotNull(function13, "onCancel");
|
||||
m.checkParameterIsNotNull(function14, "onRepeat");
|
||||
m.checkNotNullParameter(animator, "<this>");
|
||||
m.checkNotNullParameter(function1, "onEnd");
|
||||
m.checkNotNullParameter(function12, "onStart");
|
||||
m.checkNotNullParameter(function13, "onCancel");
|
||||
m.checkNotNullParameter(function14, "onRepeat");
|
||||
AnimatorKt$addListener$listener$1 animatorKt$addListener$listener$1 = new AnimatorKt$addListener$listener$1(function14, function1, function13, function12);
|
||||
animator.addListener(animatorKt$addListener$listener$1);
|
||||
return animatorKt$addListener$listener$1;
|
||||
|
@ -31,11 +31,11 @@ public final class AnimatorKt {
|
|||
if ((i & 8) != 0) {
|
||||
function14 = AnimatorKt$addListener$4.INSTANCE;
|
||||
}
|
||||
m.checkParameterIsNotNull(animator, "$this$addListener");
|
||||
m.checkParameterIsNotNull(function1, "onEnd");
|
||||
m.checkParameterIsNotNull(function12, "onStart");
|
||||
m.checkParameterIsNotNull(function13, "onCancel");
|
||||
m.checkParameterIsNotNull(function14, "onRepeat");
|
||||
m.checkNotNullParameter(animator, "<this>");
|
||||
m.checkNotNullParameter(function1, "onEnd");
|
||||
m.checkNotNullParameter(function12, "onStart");
|
||||
m.checkNotNullParameter(function13, "onCancel");
|
||||
m.checkNotNullParameter(function14, "onRepeat");
|
||||
AnimatorKt$addListener$listener$1 animatorKt$addListener$listener$1 = new AnimatorKt$addListener$listener$1(function14, function1, function13, function12);
|
||||
animator.addListener(animatorKt$addListener$listener$1);
|
||||
return animatorKt$addListener$listener$1;
|
||||
|
@ -43,9 +43,9 @@ public final class AnimatorKt {
|
|||
|
||||
@RequiresApi(19)
|
||||
public static final Animator.AnimatorPauseListener addPauseListener(Animator animator, Function1<? super Animator, Unit> function1, Function1<? super Animator, Unit> function12) {
|
||||
m.checkParameterIsNotNull(animator, "$this$addPauseListener");
|
||||
m.checkParameterIsNotNull(function1, "onResume");
|
||||
m.checkParameterIsNotNull(function12, "onPause");
|
||||
m.checkNotNullParameter(animator, "<this>");
|
||||
m.checkNotNullParameter(function1, "onResume");
|
||||
m.checkNotNullParameter(function12, "onPause");
|
||||
AnimatorKt$addPauseListener$listener$1 animatorKt$addPauseListener$listener$1 = new AnimatorKt$addPauseListener$listener$1(function12, function1);
|
||||
animator.addPauseListener(animatorKt$addPauseListener$listener$1);
|
||||
return animatorKt$addPauseListener$listener$1;
|
||||
|
@ -58,61 +58,61 @@ public final class AnimatorKt {
|
|||
if ((i & 2) != 0) {
|
||||
function12 = AnimatorKt$addPauseListener$2.INSTANCE;
|
||||
}
|
||||
m.checkParameterIsNotNull(animator, "$this$addPauseListener");
|
||||
m.checkParameterIsNotNull(function1, "onResume");
|
||||
m.checkParameterIsNotNull(function12, "onPause");
|
||||
m.checkNotNullParameter(animator, "<this>");
|
||||
m.checkNotNullParameter(function1, "onResume");
|
||||
m.checkNotNullParameter(function12, "onPause");
|
||||
AnimatorKt$addPauseListener$listener$1 animatorKt$addPauseListener$listener$1 = new AnimatorKt$addPauseListener$listener$1(function12, function1);
|
||||
animator.addPauseListener(animatorKt$addPauseListener$listener$1);
|
||||
return animatorKt$addPauseListener$listener$1;
|
||||
}
|
||||
|
||||
public static final Animator.AnimatorListener doOnCancel(Animator animator, Function1<? super Animator, Unit> function1) {
|
||||
m.checkParameterIsNotNull(animator, "$this$doOnCancel");
|
||||
m.checkParameterIsNotNull(function1, "action");
|
||||
AnimatorKt$doOnCancel$$inlined$addListener$1 animatorKt$doOnCancel$$inlined$addListener$1 = new AnimatorKt$doOnCancel$$inlined$addListener$1(function1);
|
||||
animator.addListener(animatorKt$doOnCancel$$inlined$addListener$1);
|
||||
return animatorKt$doOnCancel$$inlined$addListener$1;
|
||||
m.checkNotNullParameter(animator, "<this>");
|
||||
m.checkNotNullParameter(function1, "action");
|
||||
AnimatorKt$doOnCancel$$inlined$addListener$default$1 animatorKt$doOnCancel$$inlined$addListener$default$1 = new AnimatorKt$doOnCancel$$inlined$addListener$default$1(function1);
|
||||
animator.addListener(animatorKt$doOnCancel$$inlined$addListener$default$1);
|
||||
return animatorKt$doOnCancel$$inlined$addListener$default$1;
|
||||
}
|
||||
|
||||
public static final Animator.AnimatorListener doOnEnd(Animator animator, Function1<? super Animator, Unit> function1) {
|
||||
m.checkParameterIsNotNull(animator, "$this$doOnEnd");
|
||||
m.checkParameterIsNotNull(function1, "action");
|
||||
AnimatorKt$doOnEnd$$inlined$addListener$1 animatorKt$doOnEnd$$inlined$addListener$1 = new AnimatorKt$doOnEnd$$inlined$addListener$1(function1);
|
||||
animator.addListener(animatorKt$doOnEnd$$inlined$addListener$1);
|
||||
return animatorKt$doOnEnd$$inlined$addListener$1;
|
||||
m.checkNotNullParameter(animator, "<this>");
|
||||
m.checkNotNullParameter(function1, "action");
|
||||
AnimatorKt$doOnEnd$$inlined$addListener$default$1 animatorKt$doOnEnd$$inlined$addListener$default$1 = new AnimatorKt$doOnEnd$$inlined$addListener$default$1(function1);
|
||||
animator.addListener(animatorKt$doOnEnd$$inlined$addListener$default$1);
|
||||
return animatorKt$doOnEnd$$inlined$addListener$default$1;
|
||||
}
|
||||
|
||||
@RequiresApi(19)
|
||||
public static final Animator.AnimatorPauseListener doOnPause(Animator animator, Function1<? super Animator, Unit> function1) {
|
||||
m.checkParameterIsNotNull(animator, "$this$doOnPause");
|
||||
m.checkParameterIsNotNull(function1, "action");
|
||||
AnimatorKt$doOnPause$$inlined$addPauseListener$1 animatorKt$doOnPause$$inlined$addPauseListener$1 = new AnimatorKt$doOnPause$$inlined$addPauseListener$1(function1);
|
||||
animator.addPauseListener(animatorKt$doOnPause$$inlined$addPauseListener$1);
|
||||
return animatorKt$doOnPause$$inlined$addPauseListener$1;
|
||||
m.checkNotNullParameter(animator, "<this>");
|
||||
m.checkNotNullParameter(function1, "action");
|
||||
AnimatorKt$doOnPause$$inlined$addPauseListener$default$1 animatorKt$doOnPause$$inlined$addPauseListener$default$1 = new AnimatorKt$doOnPause$$inlined$addPauseListener$default$1(function1);
|
||||
animator.addPauseListener(animatorKt$doOnPause$$inlined$addPauseListener$default$1);
|
||||
return animatorKt$doOnPause$$inlined$addPauseListener$default$1;
|
||||
}
|
||||
|
||||
public static final Animator.AnimatorListener doOnRepeat(Animator animator, Function1<? super Animator, Unit> function1) {
|
||||
m.checkParameterIsNotNull(animator, "$this$doOnRepeat");
|
||||
m.checkParameterIsNotNull(function1, "action");
|
||||
AnimatorKt$doOnRepeat$$inlined$addListener$1 animatorKt$doOnRepeat$$inlined$addListener$1 = new AnimatorKt$doOnRepeat$$inlined$addListener$1(function1);
|
||||
animator.addListener(animatorKt$doOnRepeat$$inlined$addListener$1);
|
||||
return animatorKt$doOnRepeat$$inlined$addListener$1;
|
||||
m.checkNotNullParameter(animator, "<this>");
|
||||
m.checkNotNullParameter(function1, "action");
|
||||
AnimatorKt$doOnRepeat$$inlined$addListener$default$1 animatorKt$doOnRepeat$$inlined$addListener$default$1 = new AnimatorKt$doOnRepeat$$inlined$addListener$default$1(function1);
|
||||
animator.addListener(animatorKt$doOnRepeat$$inlined$addListener$default$1);
|
||||
return animatorKt$doOnRepeat$$inlined$addListener$default$1;
|
||||
}
|
||||
|
||||
@RequiresApi(19)
|
||||
public static final Animator.AnimatorPauseListener doOnResume(Animator animator, Function1<? super Animator, Unit> function1) {
|
||||
m.checkParameterIsNotNull(animator, "$this$doOnResume");
|
||||
m.checkParameterIsNotNull(function1, "action");
|
||||
AnimatorKt$doOnResume$$inlined$addPauseListener$1 animatorKt$doOnResume$$inlined$addPauseListener$1 = new AnimatorKt$doOnResume$$inlined$addPauseListener$1(function1);
|
||||
animator.addPauseListener(animatorKt$doOnResume$$inlined$addPauseListener$1);
|
||||
return animatorKt$doOnResume$$inlined$addPauseListener$1;
|
||||
m.checkNotNullParameter(animator, "<this>");
|
||||
m.checkNotNullParameter(function1, "action");
|
||||
AnimatorKt$doOnResume$$inlined$addPauseListener$default$1 animatorKt$doOnResume$$inlined$addPauseListener$default$1 = new AnimatorKt$doOnResume$$inlined$addPauseListener$default$1(function1);
|
||||
animator.addPauseListener(animatorKt$doOnResume$$inlined$addPauseListener$default$1);
|
||||
return animatorKt$doOnResume$$inlined$addPauseListener$default$1;
|
||||
}
|
||||
|
||||
public static final Animator.AnimatorListener doOnStart(Animator animator, Function1<? super Animator, Unit> function1) {
|
||||
m.checkParameterIsNotNull(animator, "$this$doOnStart");
|
||||
m.checkParameterIsNotNull(function1, "action");
|
||||
AnimatorKt$doOnStart$$inlined$addListener$1 animatorKt$doOnStart$$inlined$addListener$1 = new AnimatorKt$doOnStart$$inlined$addListener$1(function1);
|
||||
animator.addListener(animatorKt$doOnStart$$inlined$addListener$1);
|
||||
return animatorKt$doOnStart$$inlined$addListener$1;
|
||||
m.checkNotNullParameter(animator, "<this>");
|
||||
m.checkNotNullParameter(function1, "action");
|
||||
AnimatorKt$doOnStart$$inlined$addListener$default$1 animatorKt$doOnStart$$inlined$addListener$default$1 = new AnimatorKt$doOnStart$$inlined$addListener$default$1(function1);
|
||||
animator.addListener(animatorKt$doOnStart$$inlined$addListener$default$1);
|
||||
return animatorKt$doOnStart$$inlined$addListener$default$1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import android.os.Bundle;
|
|||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.DragEvent;
|
||||
import android.view.View;
|
||||
import androidx.annotation.IdRes;
|
||||
|
@ -24,7 +25,10 @@ import androidx.annotation.RequiresApi;
|
|||
import androidx.annotation.RestrictTo;
|
||||
import androidx.core.app.SharedElementCallback;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.LocusIdCompat;
|
||||
import androidx.core.view.DragAndDropPermissionsCompat;
|
||||
import c.d.b.a.a;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
public class ActivityCompat extends ContextCompat {
|
||||
|
@ -71,6 +75,16 @@ public class ActivityCompat extends ContextCompat {
|
|||
}
|
||||
}
|
||||
|
||||
@RequiresApi(30)
|
||||
public static class Api30Impl {
|
||||
private Api30Impl() {
|
||||
}
|
||||
|
||||
public static void setLocusContext(@NonNull Activity activity, @Nullable LocusIdCompat locusIdCompat, @Nullable Bundle bundle) {
|
||||
activity.setLocusContext(locusIdCompat == null ? null : locusIdCompat.toLocusId(), bundle);
|
||||
}
|
||||
}
|
||||
|
||||
public interface OnRequestPermissionsResultCallback {
|
||||
void onRequestPermissionsResult(int i, @NonNull String[] strArr, @NonNull int[] iArr);
|
||||
}
|
||||
|
@ -203,16 +217,20 @@ public class ActivityCompat extends ContextCompat {
|
|||
|
||||
public static void requestPermissions(@NonNull Activity activity, @NonNull String[] strArr, @IntRange(from = 0) int i) {
|
||||
PermissionCompatDelegate permissionCompatDelegate = sDelegate;
|
||||
if (permissionCompatDelegate != null && permissionCompatDelegate.requestPermissions(activity, strArr, i)) {
|
||||
return;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
if (activity instanceof RequestPermissionsRequestCodeValidator) {
|
||||
((RequestPermissionsRequestCodeValidator) activity).validateRequestPermissionsRequestCode(i);
|
||||
if (permissionCompatDelegate == null || !permissionCompatDelegate.requestPermissions(activity, strArr, i)) {
|
||||
for (String str : strArr) {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
throw new IllegalArgumentException(a.H(a.P("Permission request for permissions "), Arrays.toString(strArr), " must not contain null or empty values"));
|
||||
}
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
if (activity instanceof RequestPermissionsRequestCodeValidator) {
|
||||
((RequestPermissionsRequestCodeValidator) activity).validateRequestPermissionsRequestCode(i);
|
||||
}
|
||||
activity.requestPermissions(strArr, i);
|
||||
} else if (activity instanceof OnRequestPermissionsResultCallback) {
|
||||
new Handler(Looper.getMainLooper()).post(new AnonymousClass1(strArr, activity, i));
|
||||
}
|
||||
activity.requestPermissions(strArr, i);
|
||||
} else if (activity instanceof OnRequestPermissionsResultCallback) {
|
||||
new Handler(Looper.getMainLooper()).post(new AnonymousClass1(strArr, activity, i));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -236,6 +254,12 @@ public class ActivityCompat extends ContextCompat {
|
|||
activity.setExitSharedElementCallback(sharedElementCallback != null ? new SharedElementCallback21Impl(sharedElementCallback) : null);
|
||||
}
|
||||
|
||||
public static void setLocusContext(@NonNull Activity activity, @Nullable LocusIdCompat locusIdCompat, @Nullable Bundle bundle) {
|
||||
if (Build.VERSION.SDK_INT >= 30) {
|
||||
Api30Impl.setLocusContext(activity, locusIdCompat, bundle);
|
||||
}
|
||||
}
|
||||
|
||||
public static void setPermissionCompatDelegate(@Nullable PermissionCompatDelegate permissionCompatDelegate) {
|
||||
sDelegate = permissionCompatDelegate;
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import androidx.work.impl.background.systemalarm.CommandHandler;
|
|||
import c.d.b.a.a;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@Deprecated
|
||||
public abstract class JobIntentService extends Service {
|
||||
public static final boolean DEBUG = false;
|
||||
public static final String TAG = "JobIntentService";
|
||||
|
|
|
@ -0,0 +1,268 @@
|
|||
package androidx.core.app;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.media.AudioAttributes;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.core.util.Preconditions;
|
||||
public class NotificationChannelCompat {
|
||||
public static final String DEFAULT_CHANNEL_ID = "miscellaneous";
|
||||
private static final int DEFAULT_LIGHT_COLOR = 0;
|
||||
private static final boolean DEFAULT_SHOW_BADGE = true;
|
||||
public AudioAttributes mAudioAttributes;
|
||||
private boolean mBypassDnd;
|
||||
private boolean mCanBubble;
|
||||
public String mConversationId;
|
||||
public String mDescription;
|
||||
public String mGroupId;
|
||||
@NonNull
|
||||
public final String mId;
|
||||
public int mImportance;
|
||||
private boolean mImportantConversation;
|
||||
public int mLightColor;
|
||||
public boolean mLights;
|
||||
private int mLockscreenVisibility;
|
||||
public CharSequence mName;
|
||||
public String mParentId;
|
||||
public boolean mShowBadge;
|
||||
public Uri mSound;
|
||||
public boolean mVibrationEnabled;
|
||||
public long[] mVibrationPattern;
|
||||
|
||||
public static class Builder {
|
||||
private final NotificationChannelCompat mChannel;
|
||||
|
||||
public Builder(@NonNull String str, int i) {
|
||||
this.mChannel = new NotificationChannelCompat(str, i);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public NotificationChannelCompat build() {
|
||||
return this.mChannel;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Builder setConversationId(@NonNull String str, @NonNull String str2) {
|
||||
if (Build.VERSION.SDK_INT >= 30) {
|
||||
NotificationChannelCompat notificationChannelCompat = this.mChannel;
|
||||
notificationChannelCompat.mParentId = str;
|
||||
notificationChannelCompat.mConversationId = str2;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Builder setDescription(@Nullable String str) {
|
||||
this.mChannel.mDescription = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Builder setGroup(@Nullable String str) {
|
||||
this.mChannel.mGroupId = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Builder setImportance(int i) {
|
||||
this.mChannel.mImportance = i;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Builder setLightColor(int i) {
|
||||
this.mChannel.mLightColor = i;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Builder setLightsEnabled(boolean z2) {
|
||||
this.mChannel.mLights = z2;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Builder setName(@Nullable CharSequence charSequence) {
|
||||
this.mChannel.mName = charSequence;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Builder setShowBadge(boolean z2) {
|
||||
this.mChannel.mShowBadge = z2;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Builder setSound(@Nullable Uri uri, @Nullable AudioAttributes audioAttributes) {
|
||||
NotificationChannelCompat notificationChannelCompat = this.mChannel;
|
||||
notificationChannelCompat.mSound = uri;
|
||||
notificationChannelCompat.mAudioAttributes = audioAttributes;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Builder setVibrationEnabled(boolean z2) {
|
||||
this.mChannel.mVibrationEnabled = z2;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Builder setVibrationPattern(@Nullable long[] jArr) {
|
||||
NotificationChannelCompat notificationChannelCompat = this.mChannel;
|
||||
notificationChannelCompat.mVibrationEnabled = jArr != null && jArr.length > 0;
|
||||
notificationChannelCompat.mVibrationPattern = jArr;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(26)
|
||||
public NotificationChannelCompat(@NonNull NotificationChannel notificationChannel) {
|
||||
this(notificationChannel.getId(), notificationChannel.getImportance());
|
||||
this.mName = notificationChannel.getName();
|
||||
this.mDescription = notificationChannel.getDescription();
|
||||
this.mGroupId = notificationChannel.getGroup();
|
||||
this.mShowBadge = notificationChannel.canShowBadge();
|
||||
this.mSound = notificationChannel.getSound();
|
||||
this.mAudioAttributes = notificationChannel.getAudioAttributes();
|
||||
this.mLights = notificationChannel.shouldShowLights();
|
||||
this.mLightColor = notificationChannel.getLightColor();
|
||||
this.mVibrationEnabled = notificationChannel.shouldVibrate();
|
||||
this.mVibrationPattern = notificationChannel.getVibrationPattern();
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i >= 30) {
|
||||
this.mParentId = notificationChannel.getParentChannelId();
|
||||
this.mConversationId = notificationChannel.getConversationId();
|
||||
}
|
||||
this.mBypassDnd = notificationChannel.canBypassDnd();
|
||||
this.mLockscreenVisibility = notificationChannel.getLockscreenVisibility();
|
||||
if (i >= 29) {
|
||||
this.mCanBubble = notificationChannel.canBubble();
|
||||
}
|
||||
if (i >= 30) {
|
||||
this.mImportantConversation = notificationChannel.isImportantConversation();
|
||||
}
|
||||
}
|
||||
|
||||
public NotificationChannelCompat(@NonNull String str, int i) {
|
||||
this.mShowBadge = true;
|
||||
this.mSound = Settings.System.DEFAULT_NOTIFICATION_URI;
|
||||
this.mLightColor = 0;
|
||||
this.mId = (String) Preconditions.checkNotNull(str);
|
||||
this.mImportance = i;
|
||||
this.mAudioAttributes = Notification.AUDIO_ATTRIBUTES_DEFAULT;
|
||||
}
|
||||
|
||||
public boolean canBubble() {
|
||||
return this.mCanBubble;
|
||||
}
|
||||
|
||||
public boolean canBypassDnd() {
|
||||
return this.mBypassDnd;
|
||||
}
|
||||
|
||||
public boolean canShowBadge() {
|
||||
return this.mShowBadge;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public AudioAttributes getAudioAttributes() {
|
||||
return this.mAudioAttributes;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getConversationId() {
|
||||
return this.mConversationId;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getDescription() {
|
||||
return this.mDescription;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getGroup() {
|
||||
return this.mGroupId;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getId() {
|
||||
return this.mId;
|
||||
}
|
||||
|
||||
public int getImportance() {
|
||||
return this.mImportance;
|
||||
}
|
||||
|
||||
public int getLightColor() {
|
||||
return this.mLightColor;
|
||||
}
|
||||
|
||||
public int getLockscreenVisibility() {
|
||||
return this.mLockscreenVisibility;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public CharSequence getName() {
|
||||
return this.mName;
|
||||
}
|
||||
|
||||
public NotificationChannel getNotificationChannel() {
|
||||
String str;
|
||||
String str2;
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i < 26) {
|
||||
return null;
|
||||
}
|
||||
NotificationChannel notificationChannel = new NotificationChannel(this.mId, this.mName, this.mImportance);
|
||||
notificationChannel.setDescription(this.mDescription);
|
||||
notificationChannel.setGroup(this.mGroupId);
|
||||
notificationChannel.setShowBadge(this.mShowBadge);
|
||||
notificationChannel.setSound(this.mSound, this.mAudioAttributes);
|
||||
notificationChannel.enableLights(this.mLights);
|
||||
notificationChannel.setLightColor(this.mLightColor);
|
||||
notificationChannel.setVibrationPattern(this.mVibrationPattern);
|
||||
notificationChannel.enableVibration(this.mVibrationEnabled);
|
||||
if (!(i < 30 || (str = this.mParentId) == null || (str2 = this.mConversationId) == null)) {
|
||||
notificationChannel.setConversationId(str, str2);
|
||||
}
|
||||
return notificationChannel;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getParentChannelId() {
|
||||
return this.mParentId;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Uri getSound() {
|
||||
return this.mSound;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public long[] getVibrationPattern() {
|
||||
return this.mVibrationPattern;
|
||||
}
|
||||
|
||||
public boolean isImportantConversation() {
|
||||
return this.mImportantConversation;
|
||||
}
|
||||
|
||||
public boolean shouldShowLights() {
|
||||
return this.mLights;
|
||||
}
|
||||
|
||||
public boolean shouldVibrate() {
|
||||
return this.mVibrationEnabled;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Builder toBuilder() {
|
||||
return new Builder(this.mId, this.mImportance).setName(this.mName).setDescription(this.mDescription).setGroup(this.mGroupId).setShowBadge(this.mShowBadge).setSound(this.mSound, this.mAudioAttributes).setLightsEnabled(this.mLights).setLightColor(this.mLightColor).setVibrationEnabled(this.mVibrationEnabled).setVibrationPattern(this.mVibrationPattern).setConversationId(this.mParentId, this.mConversationId);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,122 @@
|
|||
package androidx.core.app;
|
||||
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationChannelGroup;
|
||||
import android.os.Build;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.core.util.Preconditions;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
public class NotificationChannelGroupCompat {
|
||||
private boolean mBlocked;
|
||||
private List<NotificationChannelCompat> mChannels;
|
||||
public String mDescription;
|
||||
public final String mId;
|
||||
public CharSequence mName;
|
||||
|
||||
public static class Builder {
|
||||
public final NotificationChannelGroupCompat mGroup;
|
||||
|
||||
public Builder(@NonNull String str) {
|
||||
this.mGroup = new NotificationChannelGroupCompat(str);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public NotificationChannelGroupCompat build() {
|
||||
return this.mGroup;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Builder setDescription(@Nullable String str) {
|
||||
this.mGroup.mDescription = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Builder setName(@Nullable CharSequence charSequence) {
|
||||
this.mGroup.mName = charSequence;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(28)
|
||||
public NotificationChannelGroupCompat(@NonNull NotificationChannelGroup notificationChannelGroup) {
|
||||
this(notificationChannelGroup, Collections.emptyList());
|
||||
}
|
||||
|
||||
@RequiresApi(26)
|
||||
public NotificationChannelGroupCompat(@NonNull NotificationChannelGroup notificationChannelGroup, @NonNull List<NotificationChannel> list) {
|
||||
this(notificationChannelGroup.getId());
|
||||
this.mName = notificationChannelGroup.getName();
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i >= 28) {
|
||||
this.mDescription = notificationChannelGroup.getDescription();
|
||||
}
|
||||
if (i >= 28) {
|
||||
this.mBlocked = notificationChannelGroup.isBlocked();
|
||||
this.mChannels = getChannelsCompat(notificationChannelGroup.getChannels());
|
||||
return;
|
||||
}
|
||||
this.mChannels = getChannelsCompat(list);
|
||||
}
|
||||
|
||||
public NotificationChannelGroupCompat(@NonNull String str) {
|
||||
this.mChannels = Collections.emptyList();
|
||||
this.mId = (String) Preconditions.checkNotNull(str);
|
||||
}
|
||||
|
||||
@RequiresApi(26)
|
||||
private List<NotificationChannelCompat> getChannelsCompat(List<NotificationChannel> list) {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
for (NotificationChannel notificationChannel : list) {
|
||||
if (this.mId.equals(notificationChannel.getGroup())) {
|
||||
arrayList.add(new NotificationChannelCompat(notificationChannel));
|
||||
}
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public List<NotificationChannelCompat> getChannels() {
|
||||
return this.mChannels;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getDescription() {
|
||||
return this.mDescription;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getId() {
|
||||
return this.mId;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public CharSequence getName() {
|
||||
return this.mName;
|
||||
}
|
||||
|
||||
public NotificationChannelGroup getNotificationChannelGroup() {
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i < 26) {
|
||||
return null;
|
||||
}
|
||||
NotificationChannelGroup notificationChannelGroup = new NotificationChannelGroup(this.mId, this.mName);
|
||||
if (i >= 28) {
|
||||
notificationChannelGroup.setDescription(this.mDescription);
|
||||
}
|
||||
return notificationChannelGroup;
|
||||
}
|
||||
|
||||
public boolean isBlocked() {
|
||||
return this.mBlocked;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Builder toBuilder() {
|
||||
return new Builder(this.mId).setName(this.mName).setDescription(this.mDescription);
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -2,12 +2,17 @@ package androidx.core.app;
|
|||
|
||||
import android.app.Notification;
|
||||
import android.app.RemoteInput;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Icon;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.RemoteViews;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RestrictTo;
|
||||
import androidx.collection.ArraySet;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.core.content.LocusIdCompat;
|
||||
import androidx.core.graphics.drawable.IconCompat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
@ -19,12 +24,15 @@ public class NotificationCompatBuilder implements NotificationBuilderWithBuilder
|
|||
private final Notification.Builder mBuilder;
|
||||
private final NotificationCompat.Builder mBuilderCompat;
|
||||
private RemoteViews mContentView;
|
||||
private final Context mContext;
|
||||
private final Bundle mExtras = new Bundle();
|
||||
private int mGroupAlertBehavior;
|
||||
private RemoteViews mHeadsUpContentView;
|
||||
|
||||
public NotificationCompatBuilder(NotificationCompat.Builder builder) {
|
||||
Icon icon;
|
||||
this.mBuilderCompat = builder;
|
||||
this.mContext = builder.mContext;
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
this.mBuilder = new Notification.Builder(builder.mContext, builder.mChannelId);
|
||||
} else {
|
||||
|
@ -41,30 +49,38 @@ public class NotificationCompatBuilder implements NotificationBuilderWithBuilder
|
|||
if (bundle != null) {
|
||||
this.mExtras.putAll(bundle);
|
||||
}
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
this.mContentView = builder.mContentView;
|
||||
this.mBigContentView = builder.mBigContentView;
|
||||
this.mBuilder.setShowWhen(builder.mShowWhen);
|
||||
this.mBuilder.setLocalOnly(builder.mLocalOnly).setGroup(builder.mGroupKey).setGroupSummary(builder.mGroupSummary).setSortKey(builder.mSortKey);
|
||||
this.mGroupAlertBehavior = builder.mGroupAlertBehavior;
|
||||
this.mBuilder.setCategory(builder.mCategory).setColor(builder.mColor).setVisibility(builder.mVisibility).setPublicVersion(builder.mPublicVersion).setSound(notification.sound, notification.audioAttributes);
|
||||
Iterator<String> it2 = builder.mPeople.iterator();
|
||||
while (it2.hasNext()) {
|
||||
this.mBuilder.addPerson(it2.next());
|
||||
List<String> combineLists = i < 28 ? combineLists(getPeople(builder.mPersonList), builder.mPeople) : builder.mPeople;
|
||||
if (combineLists != null && !combineLists.isEmpty()) {
|
||||
for (String str : combineLists) {
|
||||
this.mBuilder.addPerson(str);
|
||||
}
|
||||
}
|
||||
this.mHeadsUpContentView = builder.mHeadsUpContentView;
|
||||
if (builder.mInvisibleActions.size() > 0) {
|
||||
Bundle bundle2 = builder.getExtras().getBundle(NotificationCompat.CarExtender.EXTRA_CAR_EXTENDER);
|
||||
bundle2 = bundle2 == null ? new Bundle() : bundle2;
|
||||
Bundle bundle3 = new Bundle();
|
||||
for (int i = 0; i < builder.mInvisibleActions.size(); i++) {
|
||||
bundle3.putBundle(Integer.toString(i), NotificationCompatJellybean.getBundleForAction(builder.mInvisibleActions.get(i)));
|
||||
Bundle bundle3 = new Bundle(bundle2);
|
||||
Bundle bundle4 = new Bundle();
|
||||
for (int i2 = 0; i2 < builder.mInvisibleActions.size(); i2++) {
|
||||
bundle4.putBundle(Integer.toString(i2), NotificationCompatJellybean.getBundleForAction(builder.mInvisibleActions.get(i2)));
|
||||
}
|
||||
bundle2.putBundle(NotificationCompat.CarExtender.EXTRA_INVISIBLE_ACTIONS, bundle3);
|
||||
bundle2.putBundle(NotificationCompat.CarExtender.EXTRA_INVISIBLE_ACTIONS, bundle4);
|
||||
bundle3.putBundle(NotificationCompat.CarExtender.EXTRA_INVISIBLE_ACTIONS, bundle4);
|
||||
builder.getExtras().putBundle(NotificationCompat.CarExtender.EXTRA_CAR_EXTENDER, bundle2);
|
||||
this.mExtras.putBundle(NotificationCompat.CarExtender.EXTRA_CAR_EXTENDER, bundle2);
|
||||
this.mExtras.putBundle(NotificationCompat.CarExtender.EXTRA_CAR_EXTENDER, bundle3);
|
||||
}
|
||||
int i2 = Build.VERSION.SDK_INT;
|
||||
if (i2 >= 24) {
|
||||
int i3 = Build.VERSION.SDK_INT;
|
||||
if (i3 >= 23 && (icon = builder.mSmallIcon) != null) {
|
||||
this.mBuilder.setSmallIcon(icon);
|
||||
}
|
||||
if (i3 >= 24) {
|
||||
this.mBuilder.setExtras(builder.mExtras).setRemoteInputHistory(builder.mRemoteInputHistory);
|
||||
RemoteViews remoteViews = builder.mContentView;
|
||||
if (remoteViews != null) {
|
||||
|
@ -79,8 +95,8 @@ public class NotificationCompatBuilder implements NotificationBuilderWithBuilder
|
|||
this.mBuilder.setCustomHeadsUpContentView(remoteViews3);
|
||||
}
|
||||
}
|
||||
if (i2 >= 26) {
|
||||
this.mBuilder.setBadgeIconType(builder.mBadgeIcon).setShortcutId(builder.mShortcutId).setTimeoutAfter(builder.mTimeout).setGroupAlertBehavior(builder.mGroupAlertBehavior);
|
||||
if (i3 >= 26) {
|
||||
this.mBuilder.setBadgeIconType(builder.mBadgeIcon).setSettingsText(builder.mSettingsText).setShortcutId(builder.mShortcutId).setTimeoutAfter(builder.mTimeout).setGroupAlertBehavior(builder.mGroupAlertBehavior);
|
||||
if (builder.mColorizedSet) {
|
||||
this.mBuilder.setColorized(builder.mColorized);
|
||||
}
|
||||
|
@ -88,9 +104,20 @@ public class NotificationCompatBuilder implements NotificationBuilderWithBuilder
|
|||
this.mBuilder.setSound(null).setDefaults(0).setLights(0, 0, 0).setVibrate(null);
|
||||
}
|
||||
}
|
||||
if (i2 >= 29) {
|
||||
if (i3 >= 28) {
|
||||
Iterator<Person> it2 = builder.mPersonList.iterator();
|
||||
while (it2.hasNext()) {
|
||||
this.mBuilder.addPerson(it2.next().toAndroidPerson());
|
||||
}
|
||||
}
|
||||
int i4 = Build.VERSION.SDK_INT;
|
||||
if (i4 >= 29) {
|
||||
this.mBuilder.setAllowSystemGeneratedContextualActions(builder.mAllowSystemGeneratedContextualActions);
|
||||
this.mBuilder.setBubbleMetadata(NotificationCompat.BubbleMetadata.toPlatform(builder.mBubbleMetadata));
|
||||
LocusIdCompat locusIdCompat = builder.mLocusId;
|
||||
if (locusIdCompat != null) {
|
||||
this.mBuilder.setLocusId(locusIdCompat.toLocusId());
|
||||
}
|
||||
}
|
||||
if (builder.mSilent) {
|
||||
if (this.mBuilderCompat.mGroupSummary) {
|
||||
|
@ -100,12 +127,12 @@ public class NotificationCompatBuilder implements NotificationBuilderWithBuilder
|
|||
}
|
||||
this.mBuilder.setVibrate(null);
|
||||
this.mBuilder.setSound(null);
|
||||
int i3 = notification.defaults & -2;
|
||||
notification.defaults = i3;
|
||||
int i4 = i3 & -3;
|
||||
notification.defaults = i4;
|
||||
this.mBuilder.setDefaults(i4);
|
||||
if (i2 >= 26) {
|
||||
int i5 = notification.defaults & -2;
|
||||
notification.defaults = i5;
|
||||
int i6 = i5 & -3;
|
||||
notification.defaults = i6;
|
||||
this.mBuilder.setDefaults(i6);
|
||||
if (i4 >= 26) {
|
||||
if (TextUtils.isEmpty(this.mBuilderCompat.mGroupKey)) {
|
||||
this.mBuilder.setGroup(NotificationCompat.GROUP_KEY_SILENT);
|
||||
}
|
||||
|
@ -141,6 +168,32 @@ public class NotificationCompatBuilder implements NotificationBuilderWithBuilder
|
|||
this.mBuilder.addAction(builder.build());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static List<String> combineLists(@Nullable List<String> list, @Nullable List<String> list2) {
|
||||
if (list == null) {
|
||||
return list2;
|
||||
}
|
||||
if (list2 == null) {
|
||||
return list;
|
||||
}
|
||||
ArraySet arraySet = new ArraySet(list2.size() + list.size());
|
||||
arraySet.addAll(list);
|
||||
arraySet.addAll(list2);
|
||||
return new ArrayList(arraySet);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static List<String> getPeople(@Nullable List<Person> list) {
|
||||
if (list == null) {
|
||||
return null;
|
||||
}
|
||||
ArrayList arrayList = new ArrayList(list.size());
|
||||
for (Person person : list) {
|
||||
arrayList.add(person.resolveToLegacyUri());
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
private void removeSoundAndVibration(Notification notification) {
|
||||
notification.sound = null;
|
||||
notification.vibrate = null;
|
||||
|
@ -225,4 +278,8 @@ public class NotificationCompatBuilder implements NotificationBuilderWithBuilder
|
|||
public Notification.Builder getBuilder() {
|
||||
return this.mBuilder;
|
||||
}
|
||||
|
||||
public Context getContext() {
|
||||
return this.mContext;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import android.os.RemoteException;
|
|||
import x.a.b.a.a;
|
||||
public abstract class NotificationCompatSideChannelService extends Service {
|
||||
|
||||
public class NotificationSideChannelStub extends a.AbstractBinderC0355a {
|
||||
public class NotificationSideChannelStub extends a.AbstractBinderC0357a {
|
||||
public NotificationSideChannelStub() {
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,8 @@ import androidx.annotation.NonNull;
|
|||
import androidx.annotation.Nullable;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
@ -224,7 +226,7 @@ public final class NotificationManagerCompat {
|
|||
private void handleServiceConnected(ComponentName componentName, IBinder iBinder) {
|
||||
ListenerRecord listenerRecord = this.mRecordMap.get(componentName);
|
||||
if (listenerRecord != null) {
|
||||
listenerRecord.service = a.AbstractBinderC0355a.asInterface(iBinder);
|
||||
listenerRecord.service = a.AbstractBinderC0357a.asInterface(iBinder);
|
||||
listenerRecord.retryCount = 0;
|
||||
processListenerQueue(listenerRecord);
|
||||
}
|
||||
|
@ -476,24 +478,52 @@ public final class NotificationManagerCompat {
|
|||
}
|
||||
}
|
||||
|
||||
public void createNotificationChannel(@NonNull NotificationChannelCompat notificationChannelCompat) {
|
||||
createNotificationChannel(notificationChannelCompat.getNotificationChannel());
|
||||
}
|
||||
|
||||
public void createNotificationChannelGroup(@NonNull NotificationChannelGroup notificationChannelGroup) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
this.mNotificationManager.createNotificationChannelGroup(notificationChannelGroup);
|
||||
}
|
||||
}
|
||||
|
||||
public void createNotificationChannelGroup(@NonNull NotificationChannelGroupCompat notificationChannelGroupCompat) {
|
||||
createNotificationChannelGroup(notificationChannelGroupCompat.getNotificationChannelGroup());
|
||||
}
|
||||
|
||||
public void createNotificationChannelGroups(@NonNull List<NotificationChannelGroup> list) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
this.mNotificationManager.createNotificationChannelGroups(list);
|
||||
}
|
||||
}
|
||||
|
||||
public void createNotificationChannelGroupsCompat(@NonNull List<NotificationChannelGroupCompat> list) {
|
||||
if (Build.VERSION.SDK_INT >= 26 && !list.isEmpty()) {
|
||||
ArrayList arrayList = new ArrayList(list.size());
|
||||
for (NotificationChannelGroupCompat notificationChannelGroupCompat : list) {
|
||||
arrayList.add(notificationChannelGroupCompat.getNotificationChannelGroup());
|
||||
}
|
||||
this.mNotificationManager.createNotificationChannelGroups(arrayList);
|
||||
}
|
||||
}
|
||||
|
||||
public void createNotificationChannels(@NonNull List<NotificationChannel> list) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
this.mNotificationManager.createNotificationChannels(list);
|
||||
}
|
||||
}
|
||||
|
||||
public void createNotificationChannelsCompat(@NonNull List<NotificationChannelCompat> list) {
|
||||
if (Build.VERSION.SDK_INT >= 26 && !list.isEmpty()) {
|
||||
ArrayList arrayList = new ArrayList(list.size());
|
||||
for (NotificationChannelCompat notificationChannelCompat : list) {
|
||||
arrayList.add(notificationChannelCompat.getNotificationChannel());
|
||||
}
|
||||
this.mNotificationManager.createNotificationChannels(arrayList);
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteNotificationChannel(@NonNull String str) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
this.mNotificationManager.deleteNotificationChannel(str);
|
||||
|
@ -506,6 +536,16 @@ public final class NotificationManagerCompat {
|
|||
}
|
||||
}
|
||||
|
||||
public void deleteUnlistedNotificationChannels(@NonNull Collection<String> collection) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
for (NotificationChannel notificationChannel : this.mNotificationManager.getNotificationChannels()) {
|
||||
if (!collection.contains(notificationChannel.getId()) && (Build.VERSION.SDK_INT < 30 || !collection.contains(notificationChannel.getParentChannelId()))) {
|
||||
this.mNotificationManager.deleteNotificationChannel(notificationChannel.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getImportance() {
|
||||
return Build.VERSION.SDK_INT >= 24 ? this.mNotificationManager.getImportance() : IMPORTANCE_UNSPECIFIED;
|
||||
}
|
||||
|
@ -518,6 +558,29 @@ public final class NotificationManagerCompat {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public NotificationChannel getNotificationChannel(@NonNull String str, @NonNull String str2) {
|
||||
return Build.VERSION.SDK_INT >= 30 ? this.mNotificationManager.getNotificationChannel(str, str2) : getNotificationChannel(str);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public NotificationChannelCompat getNotificationChannelCompat(@NonNull String str) {
|
||||
NotificationChannel notificationChannel;
|
||||
if (Build.VERSION.SDK_INT < 26 || (notificationChannel = getNotificationChannel(str)) == null) {
|
||||
return null;
|
||||
}
|
||||
return new NotificationChannelCompat(notificationChannel);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public NotificationChannelCompat getNotificationChannelCompat(@NonNull String str, @NonNull String str2) {
|
||||
NotificationChannel notificationChannel;
|
||||
if (Build.VERSION.SDK_INT < 26 || (notificationChannel = getNotificationChannel(str, str2)) == null) {
|
||||
return null;
|
||||
}
|
||||
return new NotificationChannelCompat(notificationChannel);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public NotificationChannelGroup getNotificationChannelGroup(@NonNull String str) {
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
|
@ -534,16 +597,69 @@ public final class NotificationManagerCompat {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public NotificationChannelGroupCompat getNotificationChannelGroupCompat(@NonNull String str) {
|
||||
NotificationChannelGroup notificationChannelGroup;
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i >= 28) {
|
||||
NotificationChannelGroup notificationChannelGroup2 = getNotificationChannelGroup(str);
|
||||
if (notificationChannelGroup2 != null) {
|
||||
return new NotificationChannelGroupCompat(notificationChannelGroup2);
|
||||
}
|
||||
return null;
|
||||
} else if (i < 26 || (notificationChannelGroup = getNotificationChannelGroup(str)) == null) {
|
||||
return null;
|
||||
} else {
|
||||
return new NotificationChannelGroupCompat(notificationChannelGroup, getNotificationChannels());
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public List<NotificationChannelGroup> getNotificationChannelGroups() {
|
||||
return Build.VERSION.SDK_INT >= 26 ? this.mNotificationManager.getNotificationChannelGroups() : Collections.emptyList();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public List<NotificationChannelGroupCompat> getNotificationChannelGroupsCompat() {
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i >= 26) {
|
||||
List<NotificationChannelGroup> notificationChannelGroups = getNotificationChannelGroups();
|
||||
if (!notificationChannelGroups.isEmpty()) {
|
||||
List<NotificationChannel> emptyList = i >= 28 ? Collections.emptyList() : getNotificationChannels();
|
||||
ArrayList arrayList = new ArrayList(notificationChannelGroups.size());
|
||||
for (NotificationChannelGroup notificationChannelGroup : notificationChannelGroups) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
arrayList.add(new NotificationChannelGroupCompat(notificationChannelGroup));
|
||||
} else {
|
||||
arrayList.add(new NotificationChannelGroupCompat(notificationChannelGroup, emptyList));
|
||||
}
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public List<NotificationChannel> getNotificationChannels() {
|
||||
return Build.VERSION.SDK_INT >= 26 ? this.mNotificationManager.getNotificationChannels() : Collections.emptyList();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public List<NotificationChannelCompat> getNotificationChannelsCompat() {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
List<NotificationChannel> notificationChannels = getNotificationChannels();
|
||||
if (!notificationChannels.isEmpty()) {
|
||||
ArrayList arrayList = new ArrayList(notificationChannels.size());
|
||||
for (NotificationChannel notificationChannel : notificationChannels) {
|
||||
arrayList.add(new NotificationChannelCompat(notificationChannel));
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
public void notify(int i, @NonNull Notification notification) {
|
||||
notify(null, i, notification);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import androidx.annotation.Nullable;
|
|||
import androidx.annotation.RequiresApi;
|
||||
import androidx.annotation.RestrictTo;
|
||||
import androidx.core.graphics.drawable.IconCompat;
|
||||
import c.d.b.a.a;
|
||||
public class Person {
|
||||
private static final String ICON_KEY = "icon";
|
||||
private static final String IS_BOT_KEY = "isBot";
|
||||
|
@ -149,6 +150,21 @@ public class Person {
|
|||
return this.mIsImportant;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
||||
public String resolveToLegacyUri() {
|
||||
String str = this.mUri;
|
||||
if (str != null) {
|
||||
return str;
|
||||
}
|
||||
if (this.mName == null) {
|
||||
return "";
|
||||
}
|
||||
StringBuilder P = a.P("name:");
|
||||
P.append((Object) this.mName);
|
||||
return P.toString();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@RequiresApi(28)
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
||||
|
|
|
@ -177,7 +177,13 @@ public final class RemoteInput {
|
|||
|
||||
@RequiresApi(20)
|
||||
public static android.app.RemoteInput fromCompat(RemoteInput remoteInput) {
|
||||
Set<String> allowedDataTypes;
|
||||
RemoteInput.Builder addExtras = new RemoteInput.Builder(remoteInput.getResultKey()).setLabel(remoteInput.getLabel()).setChoices(remoteInput.getChoices()).setAllowFreeFormInput(remoteInput.getAllowFreeFormInput()).addExtras(remoteInput.getExtras());
|
||||
if (Build.VERSION.SDK_INT >= 26 && (allowedDataTypes = remoteInput.getAllowedDataTypes()) != null) {
|
||||
for (String str : allowedDataTypes) {
|
||||
addExtras.setAllowDataType(str, true);
|
||||
}
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 29) {
|
||||
addExtras.setEditChoicesBeforeSending(remoteInput.getEditChoicesBeforeSending());
|
||||
}
|
||||
|
@ -196,6 +202,21 @@ public final class RemoteInput {
|
|||
return remoteInputArr2;
|
||||
}
|
||||
|
||||
@RequiresApi(20)
|
||||
public static RemoteInput fromPlatform(android.app.RemoteInput remoteInput) {
|
||||
Set<String> allowedDataTypes;
|
||||
Builder addExtras = new Builder(remoteInput.getResultKey()).setLabel(remoteInput.getLabel()).setChoices(remoteInput.getChoices()).setAllowFreeFormInput(remoteInput.getAllowFreeFormInput()).addExtras(remoteInput.getExtras());
|
||||
if (Build.VERSION.SDK_INT >= 26 && (allowedDataTypes = remoteInput.getAllowedDataTypes()) != null) {
|
||||
for (String str : allowedDataTypes) {
|
||||
addExtras.setAllowDataType(str, true);
|
||||
}
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 29) {
|
||||
addExtras.setEditChoicesBeforeSending(remoteInput.getEditChoicesBeforeSending());
|
||||
}
|
||||
return addExtras.build();
|
||||
}
|
||||
|
||||
@RequiresApi(16)
|
||||
private static Intent getClipDataIntentFromIntent(Intent intent) {
|
||||
ClipData clipData = intent.getClipData();
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package androidx.core.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ClipData;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
@ -17,6 +19,7 @@ import android.widget.ShareActionProvider;
|
|||
import androidx.annotation.IdRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.core.content.IntentCompat;
|
||||
import androidx.core.util.Preconditions;
|
||||
|
@ -29,6 +32,27 @@ public final class ShareCompat {
|
|||
public static final String EXTRA_CALLING_PACKAGE_INTEROP = "android.support.v4.app.EXTRA_CALLING_PACKAGE";
|
||||
private static final String HISTORY_FILENAME_PREFIX = ".sharecompat_";
|
||||
|
||||
@RequiresApi(16)
|
||||
public static class Api16Impl {
|
||||
private Api16Impl() {
|
||||
}
|
||||
|
||||
public static void migrateExtraStreamToClipData(@NonNull Intent intent, @NonNull ArrayList<Uri> arrayList) {
|
||||
ClipData clipData = new ClipData(null, new String[]{intent.getType()}, new ClipData.Item(intent.getCharSequenceExtra("android.intent.extra.TEXT"), intent.getStringExtra(IntentCompat.EXTRA_HTML_TEXT), null, arrayList.get(0)));
|
||||
int size = arrayList.size();
|
||||
for (int i = 1; i < size; i++) {
|
||||
clipData.addItem(new ClipData.Item(arrayList.get(i)));
|
||||
}
|
||||
intent.setClipData(clipData);
|
||||
intent.addFlags(1);
|
||||
}
|
||||
|
||||
public static void removeClipData(@NonNull Intent intent) {
|
||||
intent.setClipData(null);
|
||||
intent.setFlags(intent.getFlags() & -2);
|
||||
}
|
||||
}
|
||||
|
||||
public static class IntentBuilder {
|
||||
@Nullable
|
||||
private ArrayList<String> mBccAddresses;
|
||||
|
@ -45,15 +69,30 @@ public final class ShareCompat {
|
|||
@Nullable
|
||||
private ArrayList<String> mToAddresses;
|
||||
|
||||
private IntentBuilder(@NonNull Context context, @Nullable ComponentName componentName) {
|
||||
public IntentBuilder(@NonNull Context context) {
|
||||
Activity activity;
|
||||
this.mContext = (Context) Preconditions.checkNotNull(context);
|
||||
Intent action = new Intent().setAction("android.intent.action.SEND");
|
||||
this.mIntent = action;
|
||||
action.putExtra(ShareCompat.EXTRA_CALLING_PACKAGE, context.getPackageName());
|
||||
action.putExtra(ShareCompat.EXTRA_CALLING_PACKAGE_INTEROP, context.getPackageName());
|
||||
action.putExtra(ShareCompat.EXTRA_CALLING_ACTIVITY, componentName);
|
||||
action.putExtra(ShareCompat.EXTRA_CALLING_ACTIVITY_INTEROP, componentName);
|
||||
action.addFlags(524288);
|
||||
while (true) {
|
||||
if (!(context instanceof ContextWrapper)) {
|
||||
activity = null;
|
||||
break;
|
||||
} else if (context instanceof Activity) {
|
||||
activity = (Activity) context;
|
||||
break;
|
||||
} else {
|
||||
context = ((ContextWrapper) context).getBaseContext();
|
||||
}
|
||||
}
|
||||
if (activity != null) {
|
||||
ComponentName componentName = activity.getComponentName();
|
||||
this.mIntent.putExtra(ShareCompat.EXTRA_CALLING_ACTIVITY, componentName);
|
||||
this.mIntent.putExtra(ShareCompat.EXTRA_CALLING_ACTIVITY_INTEROP, componentName);
|
||||
}
|
||||
}
|
||||
|
||||
private void combineArrayExtra(String str, ArrayList<String> arrayList) {
|
||||
|
@ -80,13 +119,9 @@ public final class ShareCompat {
|
|||
}
|
||||
|
||||
@NonNull
|
||||
@Deprecated
|
||||
public static IntentBuilder from(@NonNull Activity activity) {
|
||||
return from((Context) Preconditions.checkNotNull(activity), activity.getComponentName());
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private static IntentBuilder from(@NonNull Context context, @Nullable ComponentName componentName) {
|
||||
return new IntentBuilder(context, componentName);
|
||||
return new IntentBuilder(activity);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
@ -136,18 +171,9 @@ public final class ShareCompat {
|
|||
|
||||
@NonNull
|
||||
public IntentBuilder addStream(@NonNull Uri uri) {
|
||||
Uri uri2 = (Uri) this.mIntent.getParcelableExtra("android.intent.extra.STREAM");
|
||||
ArrayList<Uri> arrayList = this.mStreams;
|
||||
if (arrayList == null && uri2 == null) {
|
||||
return setStream(uri);
|
||||
}
|
||||
if (arrayList == null) {
|
||||
if (this.mStreams == null) {
|
||||
this.mStreams = new ArrayList<>();
|
||||
}
|
||||
if (uri2 != null) {
|
||||
this.mIntent.removeExtra("android.intent.extra.STREAM");
|
||||
this.mStreams.add(uri2);
|
||||
}
|
||||
this.mStreams.add(uri);
|
||||
return this;
|
||||
}
|
||||
|
@ -184,25 +210,20 @@ public final class ShareCompat {
|
|||
if (arrayList4 == null || arrayList4.size() <= 1) {
|
||||
z2 = false;
|
||||
}
|
||||
boolean equals = "android.intent.action.SEND_MULTIPLE".equals(this.mIntent.getAction());
|
||||
if (!z2 && equals) {
|
||||
if (!z2) {
|
||||
this.mIntent.setAction("android.intent.action.SEND");
|
||||
ArrayList<Uri> arrayList5 = this.mStreams;
|
||||
if (arrayList5 == null || arrayList5.isEmpty()) {
|
||||
this.mIntent.removeExtra("android.intent.extra.STREAM");
|
||||
Api16Impl.removeClipData(this.mIntent);
|
||||
} else {
|
||||
this.mIntent.putExtra("android.intent.extra.STREAM", this.mStreams.get(0));
|
||||
Api16Impl.migrateExtraStreamToClipData(this.mIntent, this.mStreams);
|
||||
}
|
||||
this.mStreams = null;
|
||||
}
|
||||
if (z2 && !equals) {
|
||||
} else {
|
||||
this.mIntent.setAction("android.intent.action.SEND_MULTIPLE");
|
||||
ArrayList<Uri> arrayList6 = this.mStreams;
|
||||
if (arrayList6 == null || arrayList6.isEmpty()) {
|
||||
this.mIntent.removeExtra("android.intent.extra.STREAM");
|
||||
} else {
|
||||
this.mIntent.putParcelableArrayListExtra("android.intent.extra.STREAM", this.mStreams);
|
||||
}
|
||||
this.mIntent.putParcelableArrayListExtra("android.intent.extra.STREAM", this.mStreams);
|
||||
Api16Impl.migrateExtraStreamToClipData(this.mIntent, this.mStreams);
|
||||
}
|
||||
return this.mIntent;
|
||||
}
|
||||
|
@ -250,11 +271,10 @@ public final class ShareCompat {
|
|||
|
||||
@NonNull
|
||||
public IntentBuilder setStream(@Nullable Uri uri) {
|
||||
if (!"android.intent.action.SEND".equals(this.mIntent.getAction())) {
|
||||
this.mIntent.setAction("android.intent.action.SEND");
|
||||
}
|
||||
this.mStreams = null;
|
||||
this.mIntent.putExtra("android.intent.extra.STREAM", uri);
|
||||
if (uri != null) {
|
||||
addStream(uri);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -294,7 +314,11 @@ public final class ShareCompat {
|
|||
@Nullable
|
||||
private ArrayList<Uri> mStreams;
|
||||
|
||||
private IntentReader(@NonNull Context context, @NonNull Intent intent) {
|
||||
public IntentReader(@NonNull Activity activity) {
|
||||
this((Context) Preconditions.checkNotNull(activity), activity.getIntent());
|
||||
}
|
||||
|
||||
public IntentReader(@NonNull Context context, @NonNull Intent intent) {
|
||||
this.mContext = (Context) Preconditions.checkNotNull(context);
|
||||
this.mIntent = (Intent) Preconditions.checkNotNull(intent);
|
||||
this.mCallingPackage = ShareCompat.getCallingPackage(intent);
|
||||
|
@ -302,13 +326,9 @@ public final class ShareCompat {
|
|||
}
|
||||
|
||||
@NonNull
|
||||
@Deprecated
|
||||
public static IntentReader from(@NonNull Activity activity) {
|
||||
return from((Context) Preconditions.checkNotNull(activity), activity.getIntent());
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private static IntentReader from(@NonNull Context context, @NonNull Intent intent) {
|
||||
return new IntentReader(context, intent);
|
||||
return new IntentReader(activity);
|
||||
}
|
||||
|
||||
private static void withinStyle(StringBuilder sb, CharSequence charSequence, int i, int i2) {
|
||||
|
@ -480,6 +500,7 @@ public final class ShareCompat {
|
|||
private ShareCompat() {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void configureMenuItem(@NonNull Menu menu, @IdRes int i, @NonNull IntentBuilder intentBuilder) {
|
||||
MenuItem findItem = menu.findItem(i);
|
||||
if (findItem != null) {
|
||||
|
@ -489,6 +510,7 @@ public final class ShareCompat {
|
|||
throw new IllegalArgumentException(a.n("Could not find menu item with id ", i, " in the supplied menu"));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void configureMenuItem(@NonNull MenuItem menuItem, @NonNull IntentBuilder intentBuilder) {
|
||||
ActionProvider actionProvider = menuItem.getActionProvider();
|
||||
ShareActionProvider shareActionProvider = !(actionProvider instanceof ShareActionProvider) ? new ShareActionProvider(intentBuilder.getContext()) : (ShareActionProvider) actionProvider;
|
||||
|
|
|
@ -6,9 +6,13 @@ import kotlin.Pair;
|
|||
/* compiled from: ContentValues.kt */
|
||||
public final class ContentValuesKt {
|
||||
public static final ContentValues contentValuesOf(Pair<String, ? extends Object>... pairArr) {
|
||||
m.checkParameterIsNotNull(pairArr, "pairs");
|
||||
m.checkNotNullParameter(pairArr, "pairs");
|
||||
ContentValues contentValues = new ContentValues(pairArr.length);
|
||||
for (Pair<String, ? extends Object> pair : pairArr) {
|
||||
int length = pairArr.length;
|
||||
int i = 0;
|
||||
while (i < length) {
|
||||
Pair<String, ? extends Object> pair = pairArr[i];
|
||||
i++;
|
||||
String component1 = pair.component1();
|
||||
Object component2 = pair.component2();
|
||||
if (component2 == null) {
|
||||
|
@ -32,7 +36,8 @@ public final class ContentValuesKt {
|
|||
} else if (component2 instanceof Short) {
|
||||
contentValues.put(component1, (Short) component2);
|
||||
} else {
|
||||
throw new IllegalArgumentException("Illegal value type " + component2.getClass().getCanonicalName() + " for key \"" + component1 + '\"');
|
||||
String canonicalName = component2.getClass().getCanonicalName();
|
||||
throw new IllegalArgumentException("Illegal value type " + ((Object) canonicalName) + " for key \"" + component1 + '\"');
|
||||
}
|
||||
}
|
||||
return contentValues;
|
||||
|
|
|
@ -16,6 +16,7 @@ import android.app.usage.UsageStatsManager;
|
|||
import android.appwidget.AppWidgetManager;
|
||||
import android.bluetooth.BluetoothManager;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.RestrictionsManager;
|
||||
|
@ -63,22 +64,164 @@ import android.view.inputmethod.InputMethodManager;
|
|||
import android.view.textservice.TextServicesManager;
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.ColorRes;
|
||||
import androidx.annotation.DoNotInline;
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.appcompat.widget.ActivityChooserModel;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.core.os.ExecutorCompat;
|
||||
import com.discord.utilities.analytics.ChatInputComponentTypes;
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
import org.webrtc.MediaStreamTrack;
|
||||
public class ContextCompat {
|
||||
private static final String TAG = "ContextCompat";
|
||||
private static final Object sLock = new Object();
|
||||
private static final Object sSync = new Object();
|
||||
private static TypedValue sTempValue;
|
||||
|
||||
@RequiresApi(16)
|
||||
public static class Api16Impl {
|
||||
private Api16Impl() {
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static void startActivities(Context context, Intent[] intentArr, Bundle bundle) {
|
||||
context.startActivities(intentArr, bundle);
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static void startActivity(Context context, Intent intent, Bundle bundle) {
|
||||
context.startActivity(intent, bundle);
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(19)
|
||||
public static class Api19Impl {
|
||||
private Api19Impl() {
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static File[] getExternalCacheDirs(Context context) {
|
||||
return context.getExternalCacheDirs();
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static File[] getExternalFilesDirs(Context context, String str) {
|
||||
return context.getExternalFilesDirs(str);
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static File[] getObbDirs(Context context) {
|
||||
return context.getObbDirs();
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(21)
|
||||
public static class Api21Impl {
|
||||
private Api21Impl() {
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static File getCodeCacheDir(Context context) {
|
||||
return context.getCodeCacheDir();
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static Drawable getDrawable(Context context, int i) {
|
||||
return context.getDrawable(i);
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static File getNoBackupFilesDir(Context context) {
|
||||
return context.getNoBackupFilesDir();
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(23)
|
||||
public static class Api23Impl {
|
||||
private Api23Impl() {
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static int getColor(Context context, int i) {
|
||||
return context.getColor(i);
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static ColorStateList getColorStateList(Context context, int i) {
|
||||
return context.getColorStateList(i);
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static <T> T getSystemService(Context context, Class<T> cls) {
|
||||
return (T) context.getSystemService(cls);
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static String getSystemServiceName(Context context, Class<?> cls) {
|
||||
return context.getSystemServiceName(cls);
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(24)
|
||||
public static class Api24Impl {
|
||||
private Api24Impl() {
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static Context createDeviceProtectedStorageContext(Context context) {
|
||||
return context.createDeviceProtectedStorageContext();
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static File getDataDir(Context context) {
|
||||
return context.getDataDir();
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static boolean isDeviceProtectedStorage(Context context) {
|
||||
return context.isDeviceProtectedStorage();
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(26)
|
||||
public static class Api26Impl {
|
||||
private Api26Impl() {
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static ComponentName startForegroundService(Context context, Intent intent) {
|
||||
return context.startForegroundService(intent);
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(28)
|
||||
public static class Api28Impl {
|
||||
private Api28Impl() {
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static Executor getMainExecutor(Context context) {
|
||||
return context.getMainExecutor();
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(30)
|
||||
public static class Api30Impl {
|
||||
private Api30Impl() {
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static String getAttributionTag(Context context) {
|
||||
return context.getAttributionTag();
|
||||
}
|
||||
}
|
||||
|
||||
public static final class LegacyServiceMapHolder {
|
||||
public static final HashMap<Class<?>, String> SERVICES;
|
||||
|
||||
|
@ -144,21 +287,6 @@ public class ContextCompat {
|
|||
}
|
||||
}
|
||||
|
||||
public static class MainHandlerExecutor implements Executor {
|
||||
private final Handler mHandler;
|
||||
|
||||
public MainHandlerExecutor(@NonNull Handler handler) {
|
||||
this.mHandler = handler;
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Executor
|
||||
public void execute(Runnable runnable) {
|
||||
if (!this.mHandler.post(runnable)) {
|
||||
throw new RejectedExecutionException(this.mHandler + " is shutting down");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int checkSelfPermission(@NonNull Context context, @NonNull String str) {
|
||||
if (str != null) {
|
||||
return context.checkPermission(str, Process.myPid(), Process.myUid());
|
||||
|
@ -169,42 +297,49 @@ public class ContextCompat {
|
|||
@Nullable
|
||||
public static Context createDeviceProtectedStorageContext(@NonNull Context context) {
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
return context.createDeviceProtectedStorageContext();
|
||||
return Api24Impl.createDeviceProtectedStorageContext(context);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static synchronized File createFilesDir(File file) {
|
||||
synchronized (ContextCompat.class) {
|
||||
if (file.exists() || file.mkdirs()) {
|
||||
return file;
|
||||
private static File createFilesDir(File file) {
|
||||
synchronized (sSync) {
|
||||
if (!file.exists()) {
|
||||
if (file.mkdirs()) {
|
||||
return file;
|
||||
}
|
||||
Log.w(TAG, "Unable to create files subdir " + file.getPath());
|
||||
}
|
||||
if (file.exists()) {
|
||||
return file;
|
||||
}
|
||||
Log.w(TAG, "Unable to create files subdir " + file.getPath());
|
||||
return null;
|
||||
return file;
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static String getAttributionTag(@NonNull Context context) {
|
||||
if (Build.VERSION.SDK_INT >= 30) {
|
||||
return Api30Impl.getAttributionTag(context);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static File getCodeCacheDir(@NonNull Context context) {
|
||||
return context.getCodeCacheDir();
|
||||
return Api21Impl.getCodeCacheDir(context);
|
||||
}
|
||||
|
||||
@ColorInt
|
||||
public static int getColor(@NonNull Context context, @ColorRes int i) {
|
||||
return Build.VERSION.SDK_INT >= 23 ? context.getColor(i) : context.getResources().getColor(i);
|
||||
return Build.VERSION.SDK_INT >= 23 ? Api23Impl.getColor(context, i) : context.getResources().getColor(i);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static ColorStateList getColorStateList(@NonNull Context context, @ColorRes int i) {
|
||||
return Build.VERSION.SDK_INT >= 23 ? context.getColorStateList(i) : context.getResources().getColorStateList(i);
|
||||
return ResourcesCompat.getColorStateList(context.getResources(), i, context.getTheme());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static File getDataDir(@NonNull Context context) {
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
return context.getDataDir();
|
||||
return Api24Impl.getDataDir(context);
|
||||
}
|
||||
String str = context.getApplicationInfo().dataDir;
|
||||
if (str != null) {
|
||||
|
@ -215,37 +350,37 @@ public class ContextCompat {
|
|||
|
||||
@Nullable
|
||||
public static Drawable getDrawable(@NonNull Context context, @DrawableRes int i) {
|
||||
return context.getDrawable(i);
|
||||
return Api21Impl.getDrawable(context, i);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static File[] getExternalCacheDirs(@NonNull Context context) {
|
||||
return context.getExternalCacheDirs();
|
||||
return Api19Impl.getExternalCacheDirs(context);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static File[] getExternalFilesDirs(@NonNull Context context, @Nullable String str) {
|
||||
return context.getExternalFilesDirs(str);
|
||||
return Api19Impl.getExternalFilesDirs(context, str);
|
||||
}
|
||||
|
||||
public static Executor getMainExecutor(Context context) {
|
||||
return Build.VERSION.SDK_INT >= 28 ? context.getMainExecutor() : new MainHandlerExecutor(new Handler(context.getMainLooper()));
|
||||
return Build.VERSION.SDK_INT >= 28 ? Api28Impl.getMainExecutor(context) : ExecutorCompat.create(new Handler(context.getMainLooper()));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static File getNoBackupFilesDir(@NonNull Context context) {
|
||||
return context.getNoBackupFilesDir();
|
||||
return Api21Impl.getNoBackupFilesDir(context);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static File[] getObbDirs(@NonNull Context context) {
|
||||
return context.getObbDirs();
|
||||
return Api19Impl.getObbDirs(context);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static <T> T getSystemService(@NonNull Context context, @NonNull Class<T> cls) {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
return (T) context.getSystemService(cls);
|
||||
return (T) Api23Impl.getSystemService(context, cls);
|
||||
}
|
||||
String systemServiceName = getSystemServiceName(context, cls);
|
||||
if (systemServiceName != null) {
|
||||
|
@ -256,12 +391,12 @@ public class ContextCompat {
|
|||
|
||||
@Nullable
|
||||
public static String getSystemServiceName(@NonNull Context context, @NonNull Class<?> cls) {
|
||||
return Build.VERSION.SDK_INT >= 23 ? context.getSystemServiceName(cls) : LegacyServiceMapHolder.SERVICES.get(cls);
|
||||
return Build.VERSION.SDK_INT >= 23 ? Api23Impl.getSystemServiceName(context, cls) : LegacyServiceMapHolder.SERVICES.get(cls);
|
||||
}
|
||||
|
||||
public static boolean isDeviceProtectedStorage(@NonNull Context context) {
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
return context.isDeviceProtectedStorage();
|
||||
return Api24Impl.isDeviceProtectedStorage(context);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -271,17 +406,17 @@ public class ContextCompat {
|
|||
}
|
||||
|
||||
public static boolean startActivities(@NonNull Context context, @NonNull Intent[] intentArr, @Nullable Bundle bundle) {
|
||||
context.startActivities(intentArr, bundle);
|
||||
Api16Impl.startActivities(context, intentArr, bundle);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void startActivity(@NonNull Context context, @NonNull Intent intent, @Nullable Bundle bundle) {
|
||||
context.startActivity(intent, bundle);
|
||||
Api16Impl.startActivity(context, intent, bundle);
|
||||
}
|
||||
|
||||
public static void startForegroundService(@NonNull Context context, @NonNull Intent intent) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
context.startForegroundService(intent);
|
||||
Api26Impl.startForegroundService(context, intent);
|
||||
} else {
|
||||
context.startService(intent);
|
||||
}
|
||||
|
|
|
@ -12,25 +12,27 @@ import kotlin.jvm.functions.Function1;
|
|||
/* compiled from: Context.kt */
|
||||
public final class ContextKt {
|
||||
public static final /* synthetic */ <T> T getSystemService(Context context) {
|
||||
m.checkParameterIsNotNull(context, "$this$getSystemService");
|
||||
m.checkNotNullParameter(context, "<this>");
|
||||
m.reifiedOperationMarker(4, ExifInterface.GPS_DIRECTION_TRUE);
|
||||
return (T) ContextCompat.getSystemService(context, Object.class);
|
||||
}
|
||||
|
||||
public static final void withStyledAttributes(Context context, @StyleRes int i, int[] iArr, Function1<? super TypedArray, Unit> function1) {
|
||||
m.checkParameterIsNotNull(context, "$this$withStyledAttributes");
|
||||
m.checkParameterIsNotNull(iArr, "attrs");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(context, "<this>");
|
||||
m.checkNotNullParameter(iArr, "attrs");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(i, iArr);
|
||||
m.checkNotNullExpressionValue(obtainStyledAttributes, "obtainStyledAttributes(resourceId, attrs)");
|
||||
function1.invoke(obtainStyledAttributes);
|
||||
obtainStyledAttributes.recycle();
|
||||
}
|
||||
|
||||
public static final void withStyledAttributes(Context context, AttributeSet attributeSet, int[] iArr, @AttrRes int i, @StyleRes int i2, Function1<? super TypedArray, Unit> function1) {
|
||||
m.checkParameterIsNotNull(context, "$this$withStyledAttributes");
|
||||
m.checkParameterIsNotNull(iArr, "attrs");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(context, "<this>");
|
||||
m.checkNotNullParameter(iArr, "attrs");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, iArr, i, i2);
|
||||
m.checkNotNullExpressionValue(obtainStyledAttributes, "obtainStyledAttributes(set, attrs, defStyleAttr, defStyleRes)");
|
||||
function1.invoke(obtainStyledAttributes);
|
||||
obtainStyledAttributes.recycle();
|
||||
}
|
||||
|
@ -45,10 +47,11 @@ public final class ContextKt {
|
|||
if ((i3 & 8) != 0) {
|
||||
i2 = 0;
|
||||
}
|
||||
m.checkParameterIsNotNull(context, "$this$withStyledAttributes");
|
||||
m.checkParameterIsNotNull(iArr, "attrs");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(context, "<this>");
|
||||
m.checkNotNullParameter(iArr, "attrs");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, iArr, i, i2);
|
||||
m.checkNotNullExpressionValue(obtainStyledAttributes, "obtainStyledAttributes(set, attrs, defStyleAttr, defStyleRes)");
|
||||
function1.invoke(obtainStyledAttributes);
|
||||
obtainStyledAttributes.recycle();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package androidx.core.content;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ContentProvider;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
|
@ -29,6 +30,7 @@ public class FileProvider extends ContentProvider {
|
|||
private static final String ATTR_PATH = "path";
|
||||
private static final String[] COLUMNS = {"_display_name", "_size"};
|
||||
private static final File DEVICE_ROOT = new File(AutocompleteViewModel.COMMAND_DISCOVER_TOKEN);
|
||||
private static final String DISPLAYNAME_FIELD = "displayName";
|
||||
private static final String META_DATA_FILE_PROVIDER_PATHS = "android.support.FILE_PROVIDER_PATHS";
|
||||
private static final String TAG_CACHE_PATH = "cache-path";
|
||||
private static final String TAG_EXTERNAL = "external-path";
|
||||
|
@ -156,6 +158,12 @@ public class FileProvider extends ContentProvider {
|
|||
return getPathStrategy(context, str).getUriForFile(file);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@SuppressLint({"StreamFiles"})
|
||||
public static Uri getUriForFile(@NonNull Context context, @NonNull String str, @NonNull File file, @NonNull String str2) {
|
||||
return getUriForFile(context, str, file).buildUpon().appendQueryParameter(DISPLAYNAME_FIELD, str2).build();
|
||||
}
|
||||
|
||||
private static int modeToMode(String str) {
|
||||
if ("r".equals(str)) {
|
||||
return 268435456;
|
||||
|
@ -234,7 +242,7 @@ public class FileProvider extends ContentProvider {
|
|||
if (providerInfo.exported) {
|
||||
throw new SecurityException("Provider must not be exported");
|
||||
} else if (providerInfo.grantUriPermissions) {
|
||||
this.mStrategy = getPathStrategy(context, providerInfo.authority);
|
||||
this.mStrategy = getPathStrategy(context, providerInfo.authority.split(";")[0]);
|
||||
} else {
|
||||
throw new SecurityException("Provider must grant uri permissions");
|
||||
}
|
||||
|
@ -264,6 +272,7 @@ public class FileProvider extends ContentProvider {
|
|||
}
|
||||
|
||||
@Override // android.content.ContentProvider
|
||||
@SuppressLint({"UnknownNullness"})
|
||||
public ParcelFileDescriptor openFile(@NonNull Uri uri, @NonNull String str) throws FileNotFoundException {
|
||||
return ParcelFileDescriptor.open(this.mStrategy.getFileForUri(uri), modeToMode(str));
|
||||
}
|
||||
|
@ -272,6 +281,7 @@ public class FileProvider extends ContentProvider {
|
|||
public Cursor query(@NonNull Uri uri, @Nullable String[] strArr, @Nullable String str, @Nullable String[] strArr2, @Nullable String str2) {
|
||||
int i;
|
||||
File fileForUri = this.mStrategy.getFileForUri(uri);
|
||||
String queryParameter = uri.getQueryParameter(DISPLAYNAME_FIELD);
|
||||
if (strArr == null) {
|
||||
strArr = COLUMNS;
|
||||
}
|
||||
|
@ -282,7 +292,7 @@ public class FileProvider extends ContentProvider {
|
|||
if ("_display_name".equals(str3)) {
|
||||
strArr3[i2] = "_display_name";
|
||||
i = i2 + 1;
|
||||
objArr[i2] = fileForUri.getName();
|
||||
objArr[i2] = queryParameter == null ? fileForUri.getName() : queryParameter;
|
||||
} else if ("_size".equals(str3)) {
|
||||
strArr3[i2] = "_size";
|
||||
i = i2 + 1;
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
package androidx.core.content;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import androidx.annotation.NonNull;
|
||||
public final class IntentCompat {
|
||||
@SuppressLint({"ActionValue"})
|
||||
public static final String ACTION_CREATE_REMINDER = "android.intent.action.CREATE_REMINDER";
|
||||
public static final String CATEGORY_LEANBACK_LAUNCHER = "android.intent.category.LEANBACK_LAUNCHER";
|
||||
public static final String EXTRA_HTML_TEXT = "android.intent.extra.HTML_TEXT";
|
||||
public static final String EXTRA_START_PLAYBACK = "android.intent.extra.START_PLAYBACK";
|
||||
@SuppressLint({"ActionValue"})
|
||||
public static final String EXTRA_TIME = "android.intent.extra.TIME";
|
||||
|
||||
private IntentCompat() {
|
||||
}
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
package androidx.core.content;
|
||||
|
||||
import android.content.LocusId;
|
||||
import android.os.Build;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.core.util.Preconditions;
|
||||
import c.d.b.a.a;
|
||||
public final class LocusIdCompat {
|
||||
private final String mId;
|
||||
private final LocusId mWrapped;
|
||||
|
||||
@RequiresApi(29)
|
||||
public static class Api29Impl {
|
||||
private Api29Impl() {
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static LocusId create(@NonNull String str) {
|
||||
return new LocusId(str);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static String getId(@NonNull LocusId locusId) {
|
||||
return locusId.getId();
|
||||
}
|
||||
}
|
||||
|
||||
public LocusIdCompat(@NonNull String str) {
|
||||
this.mId = (String) Preconditions.checkStringNotEmpty(str, "id cannot be empty");
|
||||
if (Build.VERSION.SDK_INT >= 29) {
|
||||
this.mWrapped = Api29Impl.create(str);
|
||||
} else {
|
||||
this.mWrapped = null;
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private String getSanitizedId() {
|
||||
int length = this.mId.length();
|
||||
return length + "_chars";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@RequiresApi(29)
|
||||
public static LocusIdCompat toLocusIdCompat(@NonNull LocusId locusId) {
|
||||
Preconditions.checkNotNull(locusId, "locusId cannot be null");
|
||||
return new LocusIdCompat((String) Preconditions.checkStringNotEmpty(Api29Impl.getId(locusId), "id cannot be empty"));
|
||||
}
|
||||
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null || LocusIdCompat.class != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
LocusIdCompat locusIdCompat = (LocusIdCompat) obj;
|
||||
String str = this.mId;
|
||||
return str == null ? locusIdCompat.mId == null : str.equals(locusIdCompat.mId);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getId() {
|
||||
return this.mId;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
String str = this.mId;
|
||||
return 31 + (str == null ? 0 : str.hashCode());
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@RequiresApi(29)
|
||||
public LocusId toLocusId() {
|
||||
return this.mWrapped;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String toString() {
|
||||
return a.H(a.P("LocusIdCompat["), getSanitizedId(), "]");
|
||||
}
|
||||
}
|
|
@ -9,10 +9,10 @@ import kotlin.jvm.functions.Function1;
|
|||
public final class SharedPreferencesKt {
|
||||
@SuppressLint({"ApplySharedPref"})
|
||||
public static final void edit(SharedPreferences sharedPreferences, boolean z2, Function1<? super SharedPreferences.Editor, Unit> function1) {
|
||||
m.checkParameterIsNotNull(sharedPreferences, "$this$edit");
|
||||
m.checkParameterIsNotNull(function1, "action");
|
||||
m.checkNotNullParameter(sharedPreferences, "<this>");
|
||||
m.checkNotNullParameter(function1, "action");
|
||||
SharedPreferences.Editor edit = sharedPreferences.edit();
|
||||
m.checkExpressionValueIsNotNull(edit, "editor");
|
||||
m.checkNotNullExpressionValue(edit, "editor");
|
||||
function1.invoke(edit);
|
||||
if (z2) {
|
||||
edit.commit();
|
||||
|
@ -25,10 +25,10 @@ public final class SharedPreferencesKt {
|
|||
if ((i & 1) != 0) {
|
||||
z2 = false;
|
||||
}
|
||||
m.checkParameterIsNotNull(sharedPreferences, "$this$edit");
|
||||
m.checkParameterIsNotNull(function1, "action");
|
||||
m.checkNotNullParameter(sharedPreferences, "<this>");
|
||||
m.checkNotNullParameter(function1, "action");
|
||||
SharedPreferences.Editor edit = sharedPreferences.edit();
|
||||
m.checkExpressionValueIsNotNull(edit, "editor");
|
||||
m.checkNotNullExpressionValue(edit, "editor");
|
||||
function1.invoke(edit);
|
||||
if (z2) {
|
||||
edit.commit();
|
||||
|
|
|
@ -1,13 +1,139 @@
|
|||
package androidx.core.content.pm;
|
||||
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.Signature;
|
||||
import android.content.pm.SigningInfo;
|
||||
import android.os.Build;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.annotation.Size;
|
||||
import c.d.b.a.a;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
public final class PackageInfoCompat {
|
||||
|
||||
@RequiresApi(28)
|
||||
public static class Api28Impl {
|
||||
private Api28Impl() {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Signature[] getApkContentsSigners(@NonNull SigningInfo signingInfo) {
|
||||
return signingInfo.getApkContentsSigners();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Signature[] getSigningCertificateHistory(@NonNull SigningInfo signingInfo) {
|
||||
return signingInfo.getSigningCertificateHistory();
|
||||
}
|
||||
|
||||
public static boolean hasMultipleSigners(@NonNull SigningInfo signingInfo) {
|
||||
return signingInfo.hasMultipleSigners();
|
||||
}
|
||||
|
||||
public static boolean hasSigningCertificate(@NonNull PackageManager packageManager, @NonNull String str, @NonNull byte[] bArr, int i) {
|
||||
return packageManager.hasSigningCertificate(str, bArr, i);
|
||||
}
|
||||
}
|
||||
|
||||
private PackageInfoCompat() {
|
||||
}
|
||||
|
||||
private static boolean byteArrayContains(@NonNull byte[][] bArr, @NonNull byte[] bArr2) {
|
||||
for (byte[] bArr3 : bArr) {
|
||||
if (Arrays.equals(bArr2, bArr3)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static byte[] computeSHA256Digest(byte[] bArr) {
|
||||
try {
|
||||
return MessageDigest.getInstance("SHA256").digest(bArr);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException("Device doesn't support SHA256 cert checking", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static long getLongVersionCode(@NonNull PackageInfo packageInfo) {
|
||||
return Build.VERSION.SDK_INT >= 28 ? packageInfo.getLongVersionCode() : (long) packageInfo.versionCode;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static List<Signature> getSignatures(@NonNull PackageManager packageManager, @NonNull String str) throws PackageManager.NameNotFoundException {
|
||||
Signature[] signatureArr;
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
SigningInfo signingInfo = packageManager.getPackageInfo(str, 134217728).signingInfo;
|
||||
signatureArr = Api28Impl.hasMultipleSigners(signingInfo) ? Api28Impl.getApkContentsSigners(signingInfo) : Api28Impl.getSigningCertificateHistory(signingInfo);
|
||||
} else {
|
||||
signatureArr = packageManager.getPackageInfo(str, 64).signatures;
|
||||
}
|
||||
return signatureArr == null ? Collections.emptyList() : Arrays.asList(signatureArr);
|
||||
}
|
||||
|
||||
public static boolean hasSignatures(@NonNull PackageManager packageManager, @NonNull String str, @NonNull @Size(min = 1) Map<byte[], Integer> map, boolean z2) throws PackageManager.NameNotFoundException {
|
||||
if (map.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
Set<byte[]> keySet = map.keySet();
|
||||
for (byte[] bArr : keySet) {
|
||||
if (bArr != null) {
|
||||
Integer num = map.get(bArr);
|
||||
if (num != null) {
|
||||
int intValue = num.intValue();
|
||||
if (!(intValue == 0 || intValue == 1)) {
|
||||
throw new IllegalArgumentException("Unsupported certificate type " + num + " when verifying " + str);
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException(a.u("Type must be specified for cert when verifying ", str));
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException(a.u("Cert byte array cannot be null when verifying ", str));
|
||||
}
|
||||
}
|
||||
List<Signature> signatures = getSignatures(packageManager, str);
|
||||
if (z2 || Build.VERSION.SDK_INT < 28) {
|
||||
if (signatures.size() != 0 && map.size() <= signatures.size() && (!z2 || map.size() == signatures.size())) {
|
||||
byte[][] bArr2 = null;
|
||||
if (map.containsValue(1)) {
|
||||
bArr2 = new byte[signatures.size()][];
|
||||
for (int i = 0; i < signatures.size(); i++) {
|
||||
bArr2[i] = computeSHA256Digest(signatures.get(i).toByteArray());
|
||||
}
|
||||
}
|
||||
Iterator<byte[]> it = keySet.iterator();
|
||||
if (it.hasNext()) {
|
||||
byte[] next = it.next();
|
||||
Integer num2 = map.get(next);
|
||||
int intValue2 = num2.intValue();
|
||||
if (intValue2 != 0) {
|
||||
if (intValue2 != 1) {
|
||||
throw new IllegalArgumentException("Unsupported certificate type " + num2);
|
||||
} else if (!byteArrayContains(bArr2, next)) {
|
||||
return false;
|
||||
}
|
||||
} else if (!signatures.contains(new Signature(next))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
for (byte[] bArr3 : keySet) {
|
||||
if (!Api28Impl.hasSigningCertificate(packageManager, str, bArr3, map.get(bArr3).intValue())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
package androidx.core.content.pm;
|
||||
|
||||
import androidx.annotation.AnyThread;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RestrictTo;
|
||||
import java.util.List;
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
||||
public abstract class ShortcutInfoChangeListener {
|
||||
@AnyThread
|
||||
public void onAllShortcutsRemoved() {
|
||||
}
|
||||
|
||||
@AnyThread
|
||||
public void onShortcutAdded(@NonNull List<ShortcutInfoCompat> list) {
|
||||
}
|
||||
|
||||
@AnyThread
|
||||
public void onShortcutRemoved(@NonNull List<String> list) {
|
||||
}
|
||||
|
||||
@AnyThread
|
||||
public void onShortcutUpdated(@NonNull List<ShortcutInfoCompat> list) {
|
||||
}
|
||||
|
||||
@AnyThread
|
||||
public void onShortcutUsageReported(@NonNull List<String> list) {
|
||||
}
|
||||
}
|
|
@ -1,13 +1,16 @@
|
|||
package androidx.core.content.pm;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ShortcutInfo;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.PersistableBundle;
|
||||
import android.os.UserHandle;
|
||||
import android.text.TextUtils;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
@ -15,31 +18,58 @@ import androidx.annotation.RequiresApi;
|
|||
import androidx.annotation.RestrictTo;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.core.app.Person;
|
||||
import androidx.core.content.LocusIdCompat;
|
||||
import androidx.core.graphics.drawable.IconCompat;
|
||||
import androidx.core.net.UriCompat;
|
||||
import c.d.b.a.a;
|
||||
import com.discord.widgets.chat.input.autocomplete.AutocompleteViewModel;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
public class ShortcutInfoCompat {
|
||||
private static final String EXTRA_LOCUS_ID = "extraLocusId";
|
||||
private static final String EXTRA_LONG_LIVED = "extraLongLived";
|
||||
private static final String EXTRA_PERSON_ = "extraPerson_";
|
||||
private static final String EXTRA_PERSON_COUNT = "extraPersonCount";
|
||||
private static final String EXTRA_SLICE_URI = "extraSliceUri";
|
||||
public ComponentName mActivity;
|
||||
public Set<String> mCategories;
|
||||
public Context mContext;
|
||||
public CharSequence mDisabledMessage;
|
||||
public int mDisabledReason;
|
||||
public PersistableBundle mExtras;
|
||||
public boolean mHasKeyFieldsOnly;
|
||||
public IconCompat mIcon;
|
||||
public String mId;
|
||||
public Intent[] mIntents;
|
||||
public boolean mIsAlwaysBadged;
|
||||
public boolean mIsCached;
|
||||
public boolean mIsDeclaredInManifest;
|
||||
public boolean mIsDynamic;
|
||||
public boolean mIsEnabled = true;
|
||||
public boolean mIsImmutable;
|
||||
public boolean mIsLongLived;
|
||||
public boolean mIsPinned;
|
||||
public CharSequence mLabel;
|
||||
public long mLastChangedTimestamp;
|
||||
@Nullable
|
||||
public LocusIdCompat mLocusId;
|
||||
public CharSequence mLongLabel;
|
||||
public String mPackageName;
|
||||
public Person[] mPersons;
|
||||
public int mRank;
|
||||
public UserHandle mUser;
|
||||
|
||||
public static class Builder {
|
||||
private Map<String, Map<String, List<String>>> mCapabilityBindingParams;
|
||||
private Set<String> mCapabilityBindings;
|
||||
private final ShortcutInfoCompat mInfo;
|
||||
private boolean mIsConversation;
|
||||
private Uri mSliceUri;
|
||||
|
||||
@RequiresApi(25)
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
||||
|
@ -48,15 +78,35 @@ public class ShortcutInfoCompat {
|
|||
this.mInfo = shortcutInfoCompat;
|
||||
shortcutInfoCompat.mContext = context;
|
||||
shortcutInfoCompat.mId = shortcutInfo.getId();
|
||||
shortcutInfoCompat.mPackageName = shortcutInfo.getPackage();
|
||||
Intent[] intents = shortcutInfo.getIntents();
|
||||
shortcutInfoCompat.mIntents = (Intent[]) Arrays.copyOf(intents, intents.length);
|
||||
shortcutInfoCompat.mActivity = shortcutInfo.getActivity();
|
||||
shortcutInfoCompat.mLabel = shortcutInfo.getShortLabel();
|
||||
shortcutInfoCompat.mLongLabel = shortcutInfo.getLongLabel();
|
||||
shortcutInfoCompat.mDisabledMessage = shortcutInfo.getDisabledMessage();
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i >= 28) {
|
||||
shortcutInfoCompat.mDisabledReason = shortcutInfo.getDisabledReason();
|
||||
} else {
|
||||
shortcutInfoCompat.mDisabledReason = shortcutInfo.isEnabled() ? 0 : 3;
|
||||
}
|
||||
shortcutInfoCompat.mCategories = shortcutInfo.getCategories();
|
||||
shortcutInfoCompat.mPersons = ShortcutInfoCompat.getPersonsFromExtra(shortcutInfo.getExtras());
|
||||
shortcutInfoCompat.mUser = shortcutInfo.getUserHandle();
|
||||
shortcutInfoCompat.mLastChangedTimestamp = shortcutInfo.getLastChangedTimestamp();
|
||||
if (i >= 30) {
|
||||
shortcutInfoCompat.mIsCached = shortcutInfo.isCached();
|
||||
}
|
||||
shortcutInfoCompat.mIsDynamic = shortcutInfo.isDynamic();
|
||||
shortcutInfoCompat.mIsPinned = shortcutInfo.isPinned();
|
||||
shortcutInfoCompat.mIsDeclaredInManifest = shortcutInfo.isDeclaredInManifest();
|
||||
shortcutInfoCompat.mIsImmutable = shortcutInfo.isImmutable();
|
||||
shortcutInfoCompat.mIsEnabled = shortcutInfo.isEnabled();
|
||||
shortcutInfoCompat.mHasKeyFieldsOnly = shortcutInfo.hasKeyFieldsOnly();
|
||||
shortcutInfoCompat.mLocusId = ShortcutInfoCompat.getLocusId(shortcutInfo);
|
||||
shortcutInfoCompat.mRank = shortcutInfo.getRank();
|
||||
shortcutInfoCompat.mExtras = shortcutInfo.getExtras();
|
||||
}
|
||||
|
||||
public Builder(@NonNull Context context, @NonNull String str) {
|
||||
|
@ -72,15 +122,27 @@ public class ShortcutInfoCompat {
|
|||
this.mInfo = shortcutInfoCompat2;
|
||||
shortcutInfoCompat2.mContext = shortcutInfoCompat.mContext;
|
||||
shortcutInfoCompat2.mId = shortcutInfoCompat.mId;
|
||||
shortcutInfoCompat2.mPackageName = shortcutInfoCompat.mPackageName;
|
||||
Intent[] intentArr = shortcutInfoCompat.mIntents;
|
||||
shortcutInfoCompat2.mIntents = (Intent[]) Arrays.copyOf(intentArr, intentArr.length);
|
||||
shortcutInfoCompat2.mActivity = shortcutInfoCompat.mActivity;
|
||||
shortcutInfoCompat2.mLabel = shortcutInfoCompat.mLabel;
|
||||
shortcutInfoCompat2.mLongLabel = shortcutInfoCompat.mLongLabel;
|
||||
shortcutInfoCompat2.mDisabledMessage = shortcutInfoCompat.mDisabledMessage;
|
||||
shortcutInfoCompat2.mDisabledReason = shortcutInfoCompat.mDisabledReason;
|
||||
shortcutInfoCompat2.mIcon = shortcutInfoCompat.mIcon;
|
||||
shortcutInfoCompat2.mIsAlwaysBadged = shortcutInfoCompat.mIsAlwaysBadged;
|
||||
shortcutInfoCompat2.mUser = shortcutInfoCompat.mUser;
|
||||
shortcutInfoCompat2.mLastChangedTimestamp = shortcutInfoCompat.mLastChangedTimestamp;
|
||||
shortcutInfoCompat2.mIsCached = shortcutInfoCompat.mIsCached;
|
||||
shortcutInfoCompat2.mIsDynamic = shortcutInfoCompat.mIsDynamic;
|
||||
shortcutInfoCompat2.mIsPinned = shortcutInfoCompat.mIsPinned;
|
||||
shortcutInfoCompat2.mIsDeclaredInManifest = shortcutInfoCompat.mIsDeclaredInManifest;
|
||||
shortcutInfoCompat2.mIsImmutable = shortcutInfoCompat.mIsImmutable;
|
||||
shortcutInfoCompat2.mIsEnabled = shortcutInfoCompat.mIsEnabled;
|
||||
shortcutInfoCompat2.mLocusId = shortcutInfoCompat.mLocusId;
|
||||
shortcutInfoCompat2.mIsLongLived = shortcutInfoCompat.mIsLongLived;
|
||||
shortcutInfoCompat2.mHasKeyFieldsOnly = shortcutInfoCompat.mHasKeyFieldsOnly;
|
||||
shortcutInfoCompat2.mRank = shortcutInfoCompat.mRank;
|
||||
Person[] personArr = shortcutInfoCompat.mPersons;
|
||||
if (personArr != null) {
|
||||
|
@ -89,17 +151,82 @@ public class ShortcutInfoCompat {
|
|||
if (shortcutInfoCompat.mCategories != null) {
|
||||
shortcutInfoCompat2.mCategories = new HashSet(shortcutInfoCompat.mCategories);
|
||||
}
|
||||
PersistableBundle persistableBundle = shortcutInfoCompat.mExtras;
|
||||
if (persistableBundle != null) {
|
||||
shortcutInfoCompat2.mExtras = persistableBundle;
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@SuppressLint({"MissingGetterMatchingBuilder"})
|
||||
public Builder addCapabilityBinding(@NonNull String str) {
|
||||
if (this.mCapabilityBindings == null) {
|
||||
this.mCapabilityBindings = new HashSet();
|
||||
}
|
||||
this.mCapabilityBindings.add(str);
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@SuppressLint({"MissingGetterMatchingBuilder"})
|
||||
public Builder addCapabilityBinding(@NonNull String str, @NonNull String str2, @NonNull List<String> list) {
|
||||
addCapabilityBinding(str);
|
||||
if (!list.isEmpty()) {
|
||||
if (this.mCapabilityBindingParams == null) {
|
||||
this.mCapabilityBindingParams = new HashMap();
|
||||
}
|
||||
if (this.mCapabilityBindingParams.get(str) == null) {
|
||||
this.mCapabilityBindingParams.put(str, new HashMap());
|
||||
}
|
||||
this.mCapabilityBindingParams.get(str).put(str2, list);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@SuppressLint({"UnsafeNewApiCall"})
|
||||
public ShortcutInfoCompat build() {
|
||||
if (!TextUtils.isEmpty(this.mInfo.mLabel)) {
|
||||
ShortcutInfoCompat shortcutInfoCompat = this.mInfo;
|
||||
Intent[] intentArr = shortcutInfoCompat.mIntents;
|
||||
if (intentArr != null && intentArr.length != 0) {
|
||||
return shortcutInfoCompat;
|
||||
if (intentArr == null || intentArr.length == 0) {
|
||||
throw new IllegalArgumentException("Shortcut must have an intent");
|
||||
}
|
||||
throw new IllegalArgumentException("Shortcut must have an intent");
|
||||
if (this.mIsConversation) {
|
||||
if (shortcutInfoCompat.mLocusId == null) {
|
||||
shortcutInfoCompat.mLocusId = new LocusIdCompat(shortcutInfoCompat.mId);
|
||||
}
|
||||
this.mInfo.mIsLongLived = true;
|
||||
}
|
||||
if (this.mCapabilityBindings != null) {
|
||||
ShortcutInfoCompat shortcutInfoCompat2 = this.mInfo;
|
||||
if (shortcutInfoCompat2.mCategories == null) {
|
||||
shortcutInfoCompat2.mCategories = new HashSet();
|
||||
}
|
||||
this.mInfo.mCategories.addAll(this.mCapabilityBindings);
|
||||
}
|
||||
if (this.mCapabilityBindingParams != null) {
|
||||
ShortcutInfoCompat shortcutInfoCompat3 = this.mInfo;
|
||||
if (shortcutInfoCompat3.mExtras == null) {
|
||||
shortcutInfoCompat3.mExtras = new PersistableBundle();
|
||||
}
|
||||
for (String str : this.mCapabilityBindingParams.keySet()) {
|
||||
Map<String, List<String>> map = this.mCapabilityBindingParams.get(str);
|
||||
this.mInfo.mExtras.putStringArray(str, (String[]) map.keySet().toArray(new String[0]));
|
||||
for (String str2 : map.keySet()) {
|
||||
List<String> list = map.get(str2);
|
||||
this.mInfo.mExtras.putStringArray(a.v(str, AutocompleteViewModel.COMMAND_DISCOVER_TOKEN, str2), list == null ? new String[0] : (String[]) list.toArray(new String[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.mSliceUri != null) {
|
||||
ShortcutInfoCompat shortcutInfoCompat4 = this.mInfo;
|
||||
if (shortcutInfoCompat4.mExtras == null) {
|
||||
shortcutInfoCompat4.mExtras = new PersistableBundle();
|
||||
}
|
||||
this.mInfo.mExtras.putString(ShortcutInfoCompat.EXTRA_SLICE_URI, UriCompat.toSafeString(this.mSliceUri));
|
||||
}
|
||||
return this.mInfo;
|
||||
}
|
||||
throw new IllegalArgumentException("Shortcut must have a non-empty label");
|
||||
}
|
||||
|
@ -128,6 +255,12 @@ public class ShortcutInfoCompat {
|
|||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Builder setExtras(@NonNull PersistableBundle persistableBundle) {
|
||||
this.mInfo.mExtras = persistableBundle;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Builder setIcon(IconCompat iconCompat) {
|
||||
this.mInfo.mIcon = iconCompat;
|
||||
|
@ -145,6 +278,18 @@ public class ShortcutInfoCompat {
|
|||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Builder setIsConversation() {
|
||||
this.mIsConversation = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Builder setLocusId(@Nullable LocusIdCompat locusIdCompat) {
|
||||
this.mInfo.mLocusId = locusIdCompat;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Builder setLongLabel(@NonNull CharSequence charSequence) {
|
||||
this.mInfo.mLongLabel = charSequence;
|
||||
|
@ -186,17 +331,27 @@ public class ShortcutInfoCompat {
|
|||
this.mInfo.mLabel = charSequence;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@SuppressLint({"MissingGetterMatchingBuilder"})
|
||||
public Builder setSliceUri(@NonNull Uri uri) {
|
||||
this.mSliceUri = uri;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(22)
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
||||
private PersistableBundle buildLegacyExtrasBundle() {
|
||||
PersistableBundle persistableBundle = new PersistableBundle();
|
||||
if (this.mExtras == null) {
|
||||
this.mExtras = new PersistableBundle();
|
||||
}
|
||||
Person[] personArr = this.mPersons;
|
||||
if (personArr != null && personArr.length > 0) {
|
||||
persistableBundle.putInt(EXTRA_PERSON_COUNT, personArr.length);
|
||||
this.mExtras.putInt(EXTRA_PERSON_COUNT, personArr.length);
|
||||
int i = 0;
|
||||
while (i < this.mPersons.length) {
|
||||
PersistableBundle persistableBundle = this.mExtras;
|
||||
StringBuilder P = a.P(EXTRA_PERSON_);
|
||||
int i2 = i + 1;
|
||||
P.append(i2);
|
||||
|
@ -204,14 +359,51 @@ public class ShortcutInfoCompat {
|
|||
i = i2;
|
||||
}
|
||||
}
|
||||
persistableBundle.putBoolean(EXTRA_LONG_LIVED, this.mIsLongLived);
|
||||
return persistableBundle;
|
||||
LocusIdCompat locusIdCompat = this.mLocusId;
|
||||
if (locusIdCompat != null) {
|
||||
this.mExtras.putString(EXTRA_LOCUS_ID, locusIdCompat.getId());
|
||||
}
|
||||
this.mExtras.putBoolean(EXTRA_LONG_LIVED, this.mIsLongLived);
|
||||
return this.mExtras;
|
||||
}
|
||||
|
||||
@RequiresApi(25)
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
||||
public static List<ShortcutInfoCompat> fromShortcuts(@NonNull Context context, @NonNull List<ShortcutInfo> list) {
|
||||
ArrayList arrayList = new ArrayList(list.size());
|
||||
for (ShortcutInfo shortcutInfo : list) {
|
||||
arrayList.add(new Builder(context, shortcutInfo).build());
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@RequiresApi(25)
|
||||
public static LocusIdCompat getLocusId(@NonNull ShortcutInfo shortcutInfo) {
|
||||
if (Build.VERSION.SDK_INT < 29) {
|
||||
return getLocusIdFromExtra(shortcutInfo.getExtras());
|
||||
}
|
||||
if (shortcutInfo.getLocusId() == null) {
|
||||
return null;
|
||||
}
|
||||
return LocusIdCompat.toLocusIdCompat(shortcutInfo.getLocusId());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@RequiresApi(25)
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
||||
private static LocusIdCompat getLocusIdFromExtra(@Nullable PersistableBundle persistableBundle) {
|
||||
String string;
|
||||
if (persistableBundle == null || (string = persistableBundle.getString(EXTRA_LOCUS_ID)) == null) {
|
||||
return null;
|
||||
}
|
||||
return new LocusIdCompat(string);
|
||||
}
|
||||
|
||||
@RequiresApi(25)
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
||||
@VisibleForTesting
|
||||
public static boolean getLongLivedFromExtra(@NonNull PersistableBundle persistableBundle) {
|
||||
public static boolean getLongLivedFromExtra(@Nullable PersistableBundle persistableBundle) {
|
||||
if (persistableBundle == null || !persistableBundle.containsKey(EXTRA_LONG_LIVED)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -277,6 +469,15 @@ public class ShortcutInfoCompat {
|
|||
return this.mDisabledMessage;
|
||||
}
|
||||
|
||||
public int getDisabledReason() {
|
||||
return this.mDisabledReason;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public PersistableBundle getExtras() {
|
||||
return this.mExtras;
|
||||
}
|
||||
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
||||
public IconCompat getIcon() {
|
||||
return this.mIcon;
|
||||
|
@ -299,11 +500,25 @@ public class ShortcutInfoCompat {
|
|||
return (Intent[]) Arrays.copyOf(intentArr, intentArr.length);
|
||||
}
|
||||
|
||||
public long getLastChangedTimestamp() {
|
||||
return this.mLastChangedTimestamp;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public LocusIdCompat getLocusId() {
|
||||
return this.mLocusId;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public CharSequence getLongLabel() {
|
||||
return this.mLongLabel;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getPackage() {
|
||||
return this.mPackageName;
|
||||
}
|
||||
|
||||
public int getRank() {
|
||||
return this.mRank;
|
||||
}
|
||||
|
@ -313,6 +528,39 @@ public class ShortcutInfoCompat {
|
|||
return this.mLabel;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public UserHandle getUserHandle() {
|
||||
return this.mUser;
|
||||
}
|
||||
|
||||
public boolean hasKeyFieldsOnly() {
|
||||
return this.mHasKeyFieldsOnly;
|
||||
}
|
||||
|
||||
public boolean isCached() {
|
||||
return this.mIsCached;
|
||||
}
|
||||
|
||||
public boolean isDeclaredInManifest() {
|
||||
return this.mIsDeclaredInManifest;
|
||||
}
|
||||
|
||||
public boolean isDynamic() {
|
||||
return this.mIsDynamic;
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return this.mIsEnabled;
|
||||
}
|
||||
|
||||
public boolean isImmutable() {
|
||||
return this.mIsImmutable;
|
||||
}
|
||||
|
||||
public boolean isPinned() {
|
||||
return this.mIsPinned;
|
||||
}
|
||||
|
||||
@RequiresApi(25)
|
||||
public ShortcutInfo toShortcutInfo() {
|
||||
ShortcutInfo.Builder intents = new ShortcutInfo.Builder(this.mContext, this.mId).setShortLabel(this.mLabel).setIntents(this.mIntents);
|
||||
|
@ -335,6 +583,10 @@ public class ShortcutInfoCompat {
|
|||
intents.setCategories(set);
|
||||
}
|
||||
intents.setRank(this.mRank);
|
||||
PersistableBundle persistableBundle = this.mExtras;
|
||||
if (persistableBundle != null) {
|
||||
intents.setExtras(persistableBundle);
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 29) {
|
||||
Person[] personArr = this.mPersons;
|
||||
if (personArr != null && personArr.length > 0) {
|
||||
|
@ -345,6 +597,10 @@ public class ShortcutInfoCompat {
|
|||
}
|
||||
intents.setPersons(personArr2);
|
||||
}
|
||||
LocusIdCompat locusIdCompat = this.mLocusId;
|
||||
if (locusIdCompat != null) {
|
||||
intents.setLocusId(locusIdCompat.toLocusId());
|
||||
}
|
||||
intents.setLongLived(this.mIsLongLived);
|
||||
} else {
|
||||
intents.setExtras(buildLegacyExtrasBundle());
|
||||
|
|
|
@ -1,28 +1,55 @@
|
|||
package androidx.core.content.pm;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentSender;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.content.pm.ShortcutInfo;
|
||||
import android.content.pm.ShortcutManager;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.DisplayMetrics;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.annotation.RestrictTo;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.appcompat.widget.ActivityChooserModel;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.pm.ShortcutInfoCompat;
|
||||
import androidx.core.content.pm.ShortcutInfoCompatSaver;
|
||||
import androidx.core.graphics.drawable.IconCompat;
|
||||
import androidx.core.util.Preconditions;
|
||||
import java.io.InputStream;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
public class ShortcutManagerCompat {
|
||||
@VisibleForTesting
|
||||
public static final String ACTION_INSTALL_SHORTCUT = "com.android.launcher.action.INSTALL_SHORTCUT";
|
||||
private static final int DEFAULT_MAX_ICON_DIMENSION_DP = 96;
|
||||
private static final int DEFAULT_MAX_ICON_DIMENSION_LOWRAM_DP = 48;
|
||||
public static final String EXTRA_SHORTCUT_ID = "android.intent.extra.shortcut.ID";
|
||||
public static final int FLAG_MATCH_CACHED = 8;
|
||||
public static final int FLAG_MATCH_DYNAMIC = 2;
|
||||
public static final int FLAG_MATCH_MANIFEST = 1;
|
||||
public static final int FLAG_MATCH_PINNED = 4;
|
||||
@VisibleForTesting
|
||||
public static final String INSTALL_SHORTCUT_PERMISSION = "com.android.launcher.permission.INSTALL_SHORTCUT";
|
||||
private static final String SHORTCUT_LISTENER_INTENT_FILTER_ACTION = "androidx.core.content.pm.SHORTCUT_LISTENER";
|
||||
private static final String SHORTCUT_LISTENER_META_DATA_KEY = "androidx.core.content.pm.shortcut_listener_impl";
|
||||
private static volatile List<ShortcutInfoChangeListener> sShortcutInfoChangeListeners;
|
||||
private static volatile ShortcutInfoCompatSaver<?> sShortcutInfoCompatSaver;
|
||||
|
||||
/* renamed from: androidx.core.content.pm.ShortcutManagerCompat$1 reason: invalid class name */
|
||||
|
@ -42,11 +69,38 @@ public class ShortcutManagerCompat {
|
|||
}
|
||||
}
|
||||
|
||||
@RequiresApi(25)
|
||||
public static class Api25Impl {
|
||||
private Api25Impl() {
|
||||
}
|
||||
|
||||
public static String getShortcutInfoWithLowestRank(@NonNull List<ShortcutInfo> list) {
|
||||
int i = -1;
|
||||
String str = null;
|
||||
for (ShortcutInfo shortcutInfo : list) {
|
||||
if (shortcutInfo.getRank() > i) {
|
||||
str = shortcutInfo.getId();
|
||||
i = shortcutInfo.getRank();
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
||||
public @interface ShortcutMatchFlags {
|
||||
}
|
||||
|
||||
private ShortcutManagerCompat() {
|
||||
}
|
||||
|
||||
public static boolean addDynamicShortcuts(@NonNull Context context, @NonNull List<ShortcutInfoCompat> list) {
|
||||
if (Build.VERSION.SDK_INT >= 25) {
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i <= 29) {
|
||||
convertUriIconsToBitmapIcons(context, list);
|
||||
}
|
||||
if (i >= 25) {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
for (ShortcutInfoCompat shortcutInfoCompat : list) {
|
||||
arrayList.add(shortcutInfoCompat.toShortcutInfo());
|
||||
|
@ -56,9 +110,42 @@ public class ShortcutManagerCompat {
|
|||
}
|
||||
}
|
||||
getShortcutInfoSaverInstance(context).addShortcuts(list);
|
||||
for (ShortcutInfoChangeListener shortcutInfoChangeListener : getShortcutInfoListeners(context)) {
|
||||
shortcutInfoChangeListener.onShortcutAdded(list);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public static boolean convertUriIconToBitmapIcon(@NonNull Context context, @NonNull ShortcutInfoCompat shortcutInfoCompat) {
|
||||
Bitmap decodeStream;
|
||||
IconCompat iconCompat = shortcutInfoCompat.mIcon;
|
||||
if (iconCompat == null) {
|
||||
return false;
|
||||
}
|
||||
int i = iconCompat.mType;
|
||||
if (i != 6 && i != 4) {
|
||||
return true;
|
||||
}
|
||||
InputStream uriInputStream = iconCompat.getUriInputStream(context);
|
||||
if (uriInputStream == null || (decodeStream = BitmapFactory.decodeStream(uriInputStream)) == null) {
|
||||
return false;
|
||||
}
|
||||
shortcutInfoCompat.mIcon = i == 6 ? IconCompat.createWithAdaptiveBitmap(decodeStream) : IconCompat.createWithBitmap(decodeStream);
|
||||
return true;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public static void convertUriIconsToBitmapIcons(@NonNull Context context, @NonNull List<ShortcutInfoCompat> list) {
|
||||
Iterator it = new ArrayList(list).iterator();
|
||||
while (it.hasNext()) {
|
||||
ShortcutInfoCompat shortcutInfoCompat = (ShortcutInfoCompat) it.next();
|
||||
if (!convertUriIconToBitmapIcon(context, shortcutInfoCompat)) {
|
||||
list.remove(shortcutInfoCompat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static Intent createShortcutResultIntent(@NonNull Context context, @NonNull ShortcutInfoCompat shortcutInfoCompat) {
|
||||
Intent createShortcutResultIntent = Build.VERSION.SDK_INT >= 26 ? ((ShortcutManager) context.getSystemService(ShortcutManager.class)).createShortcutResultIntent(shortcutInfoCompat.toShortcutInfo()) : null;
|
||||
|
@ -68,6 +155,30 @@ public class ShortcutManagerCompat {
|
|||
return shortcutInfoCompat.addToIntent(createShortcutResultIntent);
|
||||
}
|
||||
|
||||
public static void disableShortcuts(@NonNull Context context, @NonNull List<String> list, @Nullable CharSequence charSequence) {
|
||||
if (Build.VERSION.SDK_INT >= 25) {
|
||||
((ShortcutManager) context.getSystemService(ShortcutManager.class)).disableShortcuts(list, charSequence);
|
||||
}
|
||||
getShortcutInfoSaverInstance(context).removeShortcuts(list);
|
||||
for (ShortcutInfoChangeListener shortcutInfoChangeListener : getShortcutInfoListeners(context)) {
|
||||
shortcutInfoChangeListener.onShortcutRemoved(list);
|
||||
}
|
||||
}
|
||||
|
||||
public static void enableShortcuts(@NonNull Context context, @NonNull List<ShortcutInfoCompat> list) {
|
||||
if (Build.VERSION.SDK_INT >= 25) {
|
||||
ArrayList arrayList = new ArrayList(list.size());
|
||||
for (ShortcutInfoCompat shortcutInfoCompat : list) {
|
||||
arrayList.add(shortcutInfoCompat.mId);
|
||||
}
|
||||
((ShortcutManager) context.getSystemService(ShortcutManager.class)).enableShortcuts(arrayList);
|
||||
}
|
||||
getShortcutInfoSaverInstance(context).addShortcuts(list);
|
||||
for (ShortcutInfoChangeListener shortcutInfoChangeListener : getShortcutInfoListeners(context)) {
|
||||
shortcutInfoChangeListener.onShortcutAdded(list);
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static List<ShortcutInfoCompat> getDynamicShortcuts(@NonNull Context context) {
|
||||
if (Build.VERSION.SDK_INT >= 25) {
|
||||
|
@ -85,11 +196,70 @@ public class ShortcutManagerCompat {
|
|||
}
|
||||
}
|
||||
|
||||
private static int getIconDimensionInternal(@NonNull Context context, boolean z2) {
|
||||
ActivityManager activityManager = (ActivityManager) context.getSystemService(ActivityChooserModel.ATTRIBUTE_ACTIVITY);
|
||||
int max = Math.max(1, activityManager == null || activityManager.isLowRamDevice() ? 48 : 96);
|
||||
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
|
||||
return (int) (((float) max) * ((z2 ? displayMetrics.xdpi : displayMetrics.ydpi) / 160.0f));
|
||||
}
|
||||
|
||||
public static int getIconMaxHeight(@NonNull Context context) {
|
||||
Preconditions.checkNotNull(context);
|
||||
return Build.VERSION.SDK_INT >= 25 ? ((ShortcutManager) context.getSystemService(ShortcutManager.class)).getIconMaxHeight() : getIconDimensionInternal(context, false);
|
||||
}
|
||||
|
||||
public static int getIconMaxWidth(@NonNull Context context) {
|
||||
Preconditions.checkNotNull(context);
|
||||
return Build.VERSION.SDK_INT >= 25 ? ((ShortcutManager) context.getSystemService(ShortcutManager.class)).getIconMaxWidth() : getIconDimensionInternal(context, true);
|
||||
}
|
||||
|
||||
public static int getMaxShortcutCountPerActivity(@NonNull Context context) {
|
||||
Preconditions.checkNotNull(context);
|
||||
if (Build.VERSION.SDK_INT >= 25) {
|
||||
return ((ShortcutManager) context.getSystemService(ShortcutManager.class)).getMaxShortcutCountPerActivity();
|
||||
}
|
||||
return 0;
|
||||
return 5;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public static List<ShortcutInfoChangeListener> getShortcutInfoChangeListeners() {
|
||||
return sShortcutInfoChangeListeners;
|
||||
}
|
||||
|
||||
private static String getShortcutInfoCompatWithLowestRank(@NonNull List<ShortcutInfoCompat> list) {
|
||||
int i = -1;
|
||||
String str = null;
|
||||
for (ShortcutInfoCompat shortcutInfoCompat : list) {
|
||||
if (shortcutInfoCompat.getRank() > i) {
|
||||
str = shortcutInfoCompat.getId();
|
||||
i = shortcutInfoCompat.getRank();
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
private static List<ShortcutInfoChangeListener> getShortcutInfoListeners(Context context) {
|
||||
Bundle bundle;
|
||||
String string;
|
||||
if (sShortcutInfoChangeListeners == null) {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
PackageManager packageManager = context.getPackageManager();
|
||||
Intent intent = new Intent(SHORTCUT_LISTENER_INTENT_FILTER_ACTION);
|
||||
intent.setPackage(context.getPackageName());
|
||||
for (ResolveInfo resolveInfo : packageManager.queryIntentActivities(intent, 128)) {
|
||||
ActivityInfo activityInfo = resolveInfo.activityInfo;
|
||||
if (!(activityInfo == null || (bundle = activityInfo.metaData) == null || (string = bundle.getString(SHORTCUT_LISTENER_META_DATA_KEY)) == null)) {
|
||||
try {
|
||||
arrayList.add((ShortcutInfoChangeListener) Class.forName(string, false, ShortcutManagerCompat.class.getClassLoader()).getMethod("getInstance", Context.class).invoke(null, context));
|
||||
} catch (Exception unused) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sShortcutInfoChangeListeners == null) {
|
||||
sShortcutInfoChangeListeners = arrayList;
|
||||
}
|
||||
}
|
||||
return sShortcutInfoChangeListeners;
|
||||
}
|
||||
|
||||
private static ShortcutInfoCompatSaver<?> getShortcutInfoSaverInstance(Context context) {
|
||||
|
@ -107,6 +277,40 @@ public class ShortcutManagerCompat {
|
|||
return sShortcutInfoCompatSaver;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static List<ShortcutInfoCompat> getShortcuts(@NonNull Context context, int i) {
|
||||
int i2 = Build.VERSION.SDK_INT;
|
||||
if (i2 >= 30) {
|
||||
return ShortcutInfoCompat.fromShortcuts(context, ((ShortcutManager) context.getSystemService(ShortcutManager.class)).getShortcuts(i));
|
||||
}
|
||||
if (i2 >= 25) {
|
||||
ShortcutManager shortcutManager = (ShortcutManager) context.getSystemService(ShortcutManager.class);
|
||||
ArrayList arrayList = new ArrayList();
|
||||
if ((i & 1) != 0) {
|
||||
arrayList.addAll(shortcutManager.getManifestShortcuts());
|
||||
}
|
||||
if ((i & 2) != 0) {
|
||||
arrayList.addAll(shortcutManager.getDynamicShortcuts());
|
||||
}
|
||||
if ((i & 4) != 0) {
|
||||
arrayList.addAll(shortcutManager.getPinnedShortcuts());
|
||||
}
|
||||
return ShortcutInfoCompat.fromShortcuts(context, arrayList);
|
||||
}
|
||||
if ((i & 2) != 0) {
|
||||
try {
|
||||
return getShortcutInfoSaverInstance(context).getShortcuts();
|
||||
} catch (Exception unused) {
|
||||
}
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
public static boolean isRateLimitingActive(@NonNull Context context) {
|
||||
Preconditions.checkNotNull(context);
|
||||
return Build.VERSION.SDK_INT >= 25 ? ((ShortcutManager) context.getSystemService(ShortcutManager.class)).isRateLimitingActive() : getShortcuts(context, 3).size() == getMaxShortcutCountPerActivity(context);
|
||||
}
|
||||
|
||||
/* JADX WARNING: Removed duplicated region for block: B:10:0x0036 */
|
||||
public static boolean isRequestPinShortcutSupported(@NonNull Context context) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
|
@ -126,11 +330,65 @@ public class ShortcutManagerCompat {
|
|||
return false;
|
||||
}
|
||||
|
||||
public static boolean pushDynamicShortcut(@NonNull Context context, @NonNull ShortcutInfoCompat shortcutInfoCompat) {
|
||||
Preconditions.checkNotNull(context);
|
||||
Preconditions.checkNotNull(shortcutInfoCompat);
|
||||
int maxShortcutCountPerActivity = getMaxShortcutCountPerActivity(context);
|
||||
if (maxShortcutCountPerActivity == 0) {
|
||||
return false;
|
||||
}
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i <= 29) {
|
||||
convertUriIconToBitmapIcon(context, shortcutInfoCompat);
|
||||
}
|
||||
if (i >= 30) {
|
||||
((ShortcutManager) context.getSystemService(ShortcutManager.class)).pushDynamicShortcut(shortcutInfoCompat.toShortcutInfo());
|
||||
} else if (i >= 25) {
|
||||
ShortcutManager shortcutManager = (ShortcutManager) context.getSystemService(ShortcutManager.class);
|
||||
if (shortcutManager.isRateLimitingActive()) {
|
||||
return false;
|
||||
}
|
||||
List<ShortcutInfo> dynamicShortcuts = shortcutManager.getDynamicShortcuts();
|
||||
if (dynamicShortcuts.size() >= maxShortcutCountPerActivity) {
|
||||
shortcutManager.removeDynamicShortcuts(Arrays.asList(Api25Impl.getShortcutInfoWithLowestRank(dynamicShortcuts)));
|
||||
}
|
||||
shortcutManager.addDynamicShortcuts(Arrays.asList(shortcutInfoCompat.toShortcutInfo()));
|
||||
}
|
||||
ShortcutInfoCompatSaver<?> shortcutInfoSaverInstance = getShortcutInfoSaverInstance(context);
|
||||
try {
|
||||
List<ShortcutInfoCompat> shortcuts = shortcutInfoSaverInstance.getShortcuts();
|
||||
if (shortcuts.size() >= maxShortcutCountPerActivity) {
|
||||
shortcutInfoSaverInstance.removeShortcuts(Arrays.asList(getShortcutInfoCompatWithLowestRank(shortcuts)));
|
||||
}
|
||||
shortcutInfoSaverInstance.addShortcuts(Arrays.asList(shortcutInfoCompat));
|
||||
for (ShortcutInfoChangeListener shortcutInfoChangeListener : getShortcutInfoListeners(context)) {
|
||||
shortcutInfoChangeListener.onShortcutAdded(Collections.singletonList(shortcutInfoCompat));
|
||||
}
|
||||
reportShortcutUsed(context, shortcutInfoCompat.getId());
|
||||
return true;
|
||||
} catch (Exception unused) {
|
||||
for (ShortcutInfoChangeListener shortcutInfoChangeListener2 : getShortcutInfoListeners(context)) {
|
||||
shortcutInfoChangeListener2.onShortcutAdded(Collections.singletonList(shortcutInfoCompat));
|
||||
}
|
||||
reportShortcutUsed(context, shortcutInfoCompat.getId());
|
||||
return false;
|
||||
} catch (Throwable th) {
|
||||
for (ShortcutInfoChangeListener shortcutInfoChangeListener3 : getShortcutInfoListeners(context)) {
|
||||
shortcutInfoChangeListener3.onShortcutAdded(Collections.singletonList(shortcutInfoCompat));
|
||||
}
|
||||
reportShortcutUsed(context, shortcutInfoCompat.getId());
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
|
||||
public static void removeAllDynamicShortcuts(@NonNull Context context) {
|
||||
if (Build.VERSION.SDK_INT >= 25) {
|
||||
((ShortcutManager) context.getSystemService(ShortcutManager.class)).removeAllDynamicShortcuts();
|
||||
}
|
||||
getShortcutInfoSaverInstance(context).removeAllShortcuts();
|
||||
for (ShortcutInfoChangeListener shortcutInfoChangeListener : getShortcutInfoListeners(context)) {
|
||||
shortcutInfoChangeListener.onAllShortcutsRemoved();
|
||||
}
|
||||
}
|
||||
|
||||
public static void removeDynamicShortcuts(@NonNull Context context, @NonNull List<String> list) {
|
||||
|
@ -138,6 +396,32 @@ public class ShortcutManagerCompat {
|
|||
((ShortcutManager) context.getSystemService(ShortcutManager.class)).removeDynamicShortcuts(list);
|
||||
}
|
||||
getShortcutInfoSaverInstance(context).removeShortcuts(list);
|
||||
for (ShortcutInfoChangeListener shortcutInfoChangeListener : getShortcutInfoListeners(context)) {
|
||||
shortcutInfoChangeListener.onShortcutRemoved(list);
|
||||
}
|
||||
}
|
||||
|
||||
public static void removeLongLivedShortcuts(@NonNull Context context, @NonNull List<String> list) {
|
||||
if (Build.VERSION.SDK_INT < 30) {
|
||||
removeDynamicShortcuts(context, list);
|
||||
return;
|
||||
}
|
||||
((ShortcutManager) context.getSystemService(ShortcutManager.class)).removeLongLivedShortcuts(list);
|
||||
getShortcutInfoSaverInstance(context).removeShortcuts(list);
|
||||
for (ShortcutInfoChangeListener shortcutInfoChangeListener : getShortcutInfoListeners(context)) {
|
||||
shortcutInfoChangeListener.onShortcutRemoved(list);
|
||||
}
|
||||
}
|
||||
|
||||
public static void reportShortcutUsed(@NonNull Context context, @NonNull String str) {
|
||||
Preconditions.checkNotNull(context);
|
||||
Preconditions.checkNotNull(str);
|
||||
if (Build.VERSION.SDK_INT >= 25) {
|
||||
((ShortcutManager) context.getSystemService(ShortcutManager.class)).reportShortcutUsed(str);
|
||||
}
|
||||
for (ShortcutInfoChangeListener shortcutInfoChangeListener : getShortcutInfoListeners(context)) {
|
||||
shortcutInfoChangeListener.onShortcutUsageReported(Collections.singletonList(str));
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean requestPinShortcut(@NonNull Context context, @NonNull ShortcutInfoCompat shortcutInfoCompat, @Nullable IntentSender intentSender) {
|
||||
|
@ -156,8 +440,43 @@ public class ShortcutManagerCompat {
|
|||
return true;
|
||||
}
|
||||
|
||||
public static boolean updateShortcuts(@NonNull Context context, @NonNull List<ShortcutInfoCompat> list) {
|
||||
public static boolean setDynamicShortcuts(@NonNull Context context, @NonNull List<ShortcutInfoCompat> list) {
|
||||
Preconditions.checkNotNull(context);
|
||||
Preconditions.checkNotNull(list);
|
||||
if (Build.VERSION.SDK_INT >= 25) {
|
||||
ArrayList arrayList = new ArrayList(list.size());
|
||||
for (ShortcutInfoCompat shortcutInfoCompat : list) {
|
||||
arrayList.add(shortcutInfoCompat.toShortcutInfo());
|
||||
}
|
||||
if (!((ShortcutManager) context.getSystemService(ShortcutManager.class)).setDynamicShortcuts(arrayList)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
getShortcutInfoSaverInstance(context).removeAllShortcuts();
|
||||
getShortcutInfoSaverInstance(context).addShortcuts(list);
|
||||
for (ShortcutInfoChangeListener shortcutInfoChangeListener : getShortcutInfoListeners(context)) {
|
||||
shortcutInfoChangeListener.onAllShortcutsRemoved();
|
||||
shortcutInfoChangeListener.onShortcutAdded(list);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public static void setShortcutInfoChangeListeners(List<ShortcutInfoChangeListener> list) {
|
||||
sShortcutInfoChangeListeners = list;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public static void setShortcutInfoCompatSaver(ShortcutInfoCompatSaver<Void> shortcutInfoCompatSaver) {
|
||||
sShortcutInfoCompatSaver = shortcutInfoCompatSaver;
|
||||
}
|
||||
|
||||
public static boolean updateShortcuts(@NonNull Context context, @NonNull List<ShortcutInfoCompat> list) {
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i <= 29) {
|
||||
convertUriIconsToBitmapIcons(context, list);
|
||||
}
|
||||
if (i >= 25) {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
for (ShortcutInfoCompat shortcutInfoCompat : list) {
|
||||
arrayList.add(shortcutInfoCompat.toShortcutInfo());
|
||||
|
@ -167,6 +486,9 @@ public class ShortcutManagerCompat {
|
|||
}
|
||||
}
|
||||
getShortcutInfoSaverInstance(context).addShortcuts(list);
|
||||
for (ShortcutInfoChangeListener shortcutInfoChangeListener : getShortcutInfoListeners(context)) {
|
||||
shortcutInfoChangeListener.onShortcutUpdated(list);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,8 +7,10 @@ import android.graphics.Color;
|
|||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.util.StateSet;
|
||||
import android.util.TypedValue;
|
||||
import android.util.Xml;
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.ColorRes;
|
||||
import androidx.annotation.FloatRange;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
@ -21,6 +23,8 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
import org.xmlpull.v1.XmlPullParserException;
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
||||
public final class ColorStateListInflaterCompat {
|
||||
private static final ThreadLocal<TypedValue> sTempTypedValue = new ThreadLocal<>();
|
||||
|
||||
private ColorStateListInflaterCompat() {
|
||||
}
|
||||
|
||||
|
@ -49,6 +53,18 @@ public final class ColorStateListInflaterCompat {
|
|||
throw new XmlPullParserException(xmlPullParser.getPositionDescription() + ": invalid color state list tag " + name);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private static TypedValue getTypedValue() {
|
||||
ThreadLocal<TypedValue> threadLocal = sTempTypedValue;
|
||||
TypedValue typedValue = threadLocal.get();
|
||||
if (typedValue != null) {
|
||||
return typedValue;
|
||||
}
|
||||
TypedValue typedValue2 = new TypedValue();
|
||||
threadLocal.set(typedValue2);
|
||||
return typedValue2;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static ColorStateList inflate(@NonNull Resources resources, @XmlRes int i, @Nullable Resources.Theme theme) {
|
||||
try {
|
||||
|
@ -61,58 +77,76 @@ public final class ColorStateListInflaterCompat {
|
|||
|
||||
private static ColorStateList inflate(@NonNull Resources resources, @NonNull XmlPullParser xmlPullParser, @NonNull AttributeSet attributeSet, @Nullable Resources.Theme theme) throws XmlPullParserException, IOException {
|
||||
int depth;
|
||||
int i = 1;
|
||||
int i;
|
||||
int i2 = 1;
|
||||
int depth2 = xmlPullParser.getDepth() + 1;
|
||||
int[][] iArr = new int[20][];
|
||||
int[] iArr2 = new int[20];
|
||||
int i2 = 0;
|
||||
int i3 = 0;
|
||||
while (true) {
|
||||
int next = xmlPullParser.next();
|
||||
if (next == i || ((depth = xmlPullParser.getDepth()) < depth2 && next == 3)) {
|
||||
if (next == i2 || ((depth = xmlPullParser.getDepth()) < depth2 && next == 3)) {
|
||||
break;
|
||||
}
|
||||
if (next == 2 && depth <= depth2 && xmlPullParser.getName().equals("item")) {
|
||||
TypedArray obtainAttributes = obtainAttributes(resources, theme, attributeSet, R.styleable.ColorStateListItem);
|
||||
int color = obtainAttributes.getColor(R.styleable.ColorStateListItem_android_color, -65281);
|
||||
float f = 1.0f;
|
||||
int i3 = R.styleable.ColorStateListItem_android_alpha;
|
||||
if (obtainAttributes.hasValue(i3)) {
|
||||
f = obtainAttributes.getFloat(i3, 1.0f);
|
||||
int i4 = R.styleable.ColorStateListItem_android_color;
|
||||
int resourceId = obtainAttributes.getResourceId(i4, -1);
|
||||
if (resourceId == -1 || isColorInt(resources, resourceId)) {
|
||||
i = obtainAttributes.getColor(i4, -65281);
|
||||
} else {
|
||||
int i4 = R.styleable.ColorStateListItem_alpha;
|
||||
if (obtainAttributes.hasValue(i4)) {
|
||||
f = obtainAttributes.getFloat(i4, 1.0f);
|
||||
try {
|
||||
i = createFromXml(resources, resources.getXml(resourceId), theme).getDefaultColor();
|
||||
} catch (Exception unused) {
|
||||
i = obtainAttributes.getColor(R.styleable.ColorStateListItem_android_color, -65281);
|
||||
}
|
||||
}
|
||||
float f = 1.0f;
|
||||
int i5 = R.styleable.ColorStateListItem_android_alpha;
|
||||
if (obtainAttributes.hasValue(i5)) {
|
||||
f = obtainAttributes.getFloat(i5, 1.0f);
|
||||
} else {
|
||||
int i6 = R.styleable.ColorStateListItem_alpha;
|
||||
if (obtainAttributes.hasValue(i6)) {
|
||||
f = obtainAttributes.getFloat(i6, 1.0f);
|
||||
}
|
||||
}
|
||||
obtainAttributes.recycle();
|
||||
int attributeCount = attributeSet.getAttributeCount();
|
||||
int[] iArr3 = new int[attributeCount];
|
||||
int i5 = 0;
|
||||
for (int i6 = 0; i6 < attributeCount; i6++) {
|
||||
int attributeNameResource = attributeSet.getAttributeNameResource(i6);
|
||||
int i7 = 0;
|
||||
for (int i8 = 0; i8 < attributeCount; i8++) {
|
||||
int attributeNameResource = attributeSet.getAttributeNameResource(i8);
|
||||
if (!(attributeNameResource == 16843173 || attributeNameResource == 16843551 || attributeNameResource == R.attr.alpha)) {
|
||||
int i7 = i5 + 1;
|
||||
if (!attributeSet.getAttributeBooleanValue(i6, false)) {
|
||||
int i9 = i7 + 1;
|
||||
if (!attributeSet.getAttributeBooleanValue(i8, false)) {
|
||||
attributeNameResource = -attributeNameResource;
|
||||
}
|
||||
iArr3[i5] = attributeNameResource;
|
||||
i5 = i7;
|
||||
iArr3[i7] = attributeNameResource;
|
||||
i7 = i9;
|
||||
}
|
||||
}
|
||||
int[] trimStateSet = StateSet.trimStateSet(iArr3, i5);
|
||||
iArr2 = GrowingArrayUtils.append(iArr2, i2, modulateColorAlpha(color, f));
|
||||
iArr = (int[][]) GrowingArrayUtils.append(iArr, i2, trimStateSet);
|
||||
i2++;
|
||||
int[] trimStateSet = StateSet.trimStateSet(iArr3, i7);
|
||||
iArr2 = GrowingArrayUtils.append(iArr2, i3, modulateColorAlpha(i, f));
|
||||
iArr = (int[][]) GrowingArrayUtils.append(iArr, i3, trimStateSet);
|
||||
i3++;
|
||||
}
|
||||
i = 1;
|
||||
i2 = 1;
|
||||
}
|
||||
int[] iArr4 = new int[i2];
|
||||
int[][] iArr5 = new int[i2][];
|
||||
System.arraycopy(iArr2, 0, iArr4, 0, i2);
|
||||
System.arraycopy(iArr, 0, iArr5, 0, i2);
|
||||
int[] iArr4 = new int[i3];
|
||||
int[][] iArr5 = new int[i3][];
|
||||
System.arraycopy(iArr2, 0, iArr4, 0, i3);
|
||||
System.arraycopy(iArr, 0, iArr5, 0, i3);
|
||||
return new ColorStateList(iArr5, iArr4);
|
||||
}
|
||||
|
||||
private static boolean isColorInt(@NonNull Resources resources, @ColorRes int i) {
|
||||
TypedValue typedValue = getTypedValue();
|
||||
resources.getValue(i, typedValue, true);
|
||||
int i2 = typedValue.type;
|
||||
return i2 >= 28 && i2 <= 31;
|
||||
}
|
||||
|
||||
@ColorInt
|
||||
private static int modulateColorAlpha(@ColorInt int i, @FloatRange(from = 0.0d, to = 1.0d) float f) {
|
||||
return (i & ViewCompat.MEASURED_SIZE_MASK) | (Math.round(((float) Color.alpha(i)) * f) << 24);
|
||||
|
|
|
@ -97,12 +97,20 @@ public class FontResourcesParserCompat {
|
|||
@NonNull
|
||||
private final FontRequest mRequest;
|
||||
private final int mStrategy;
|
||||
@Nullable
|
||||
private final String mSystemFontFamilyName;
|
||||
private final int mTimeoutMs;
|
||||
|
||||
public ProviderResourceEntry(@NonNull FontRequest fontRequest, int i, int i2) {
|
||||
this(fontRequest, i, i2, null);
|
||||
}
|
||||
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
||||
public ProviderResourceEntry(@NonNull FontRequest fontRequest, int i, int i2, @Nullable String str) {
|
||||
this.mRequest = fontRequest;
|
||||
this.mStrategy = i;
|
||||
this.mTimeoutMs = i2;
|
||||
this.mSystemFontFamilyName = str;
|
||||
}
|
||||
|
||||
public int getFetchStrategy() {
|
||||
|
@ -114,6 +122,12 @@ public class FontResourcesParserCompat {
|
|||
return this.mRequest;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
||||
public String getSystemFontFamilyName() {
|
||||
return this.mSystemFontFamilyName;
|
||||
}
|
||||
|
||||
public int getTimeout() {
|
||||
return this.mTimeoutMs;
|
||||
}
|
||||
|
@ -187,6 +201,7 @@ public class FontResourcesParserCompat {
|
|||
int resourceId = obtainAttributes.getResourceId(R.styleable.FontFamily_fontProviderCerts, 0);
|
||||
int integer = obtainAttributes.getInteger(R.styleable.FontFamily_fontProviderFetchStrategy, 1);
|
||||
int integer2 = obtainAttributes.getInteger(R.styleable.FontFamily_fontProviderFetchTimeout, DEFAULT_TIMEOUT_MILLIS);
|
||||
String string4 = obtainAttributes.getString(R.styleable.FontFamily_fontProviderSystemFontFamily);
|
||||
obtainAttributes.recycle();
|
||||
if (string == null || string2 == null || string3 == null) {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
|
@ -207,7 +222,7 @@ public class FontResourcesParserCompat {
|
|||
while (xmlPullParser.next() != 3) {
|
||||
skip(xmlPullParser);
|
||||
}
|
||||
return new ProviderResourceEntry(new FontRequest(string, string2, string3, readCerts(resources, resourceId)), integer, integer2);
|
||||
return new ProviderResourceEntry(new FontRequest(string, string2, string3, readCerts(resources, resourceId)), integer, integer2, string4);
|
||||
}
|
||||
|
||||
private static FontFileResourceEntry readFont(XmlPullParser xmlPullParser, Resources resources) throws XmlPullParserException, IOException {
|
||||
|
|
|
@ -2,6 +2,7 @@ package androidx.core.content.res;
|
|||
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
@ -9,6 +10,7 @@ import android.os.Build;
|
|||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
import android.util.TypedValue;
|
||||
import androidx.annotation.AnyRes;
|
||||
import androidx.annotation.ColorInt;
|
||||
|
@ -22,16 +24,57 @@ import androidx.annotation.RequiresApi;
|
|||
import androidx.annotation.RestrictTo;
|
||||
import androidx.core.content.res.FontResourcesParserCompat;
|
||||
import androidx.core.graphics.TypefaceCompat;
|
||||
import androidx.core.util.ObjectsCompat;
|
||||
import androidx.core.util.Preconditions;
|
||||
import c.d.b.a.a;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.WeakHashMap;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
public final class ResourcesCompat {
|
||||
@AnyRes
|
||||
public static final int ID_NULL = 0;
|
||||
private static final String TAG = "ResourcesCompat";
|
||||
private static final Object sColorStateCacheLock = new Object();
|
||||
private static final WeakHashMap<ColorStateListCacheKey, SparseArray<ColorStateListCacheEntry>> sColorStateCaches = new WeakHashMap<>(0);
|
||||
private static final ThreadLocal<TypedValue> sTempTypedValue = new ThreadLocal<>();
|
||||
|
||||
public static class ColorStateListCacheEntry {
|
||||
public final Configuration mConfiguration;
|
||||
public final ColorStateList mValue;
|
||||
|
||||
public ColorStateListCacheEntry(@NonNull ColorStateList colorStateList, @NonNull Configuration configuration) {
|
||||
this.mValue = colorStateList;
|
||||
this.mConfiguration = configuration;
|
||||
}
|
||||
}
|
||||
|
||||
public static final class ColorStateListCacheKey {
|
||||
public final Resources mResources;
|
||||
@Nullable
|
||||
public final Resources.Theme mTheme;
|
||||
|
||||
public ColorStateListCacheKey(@NonNull Resources resources, @Nullable Resources.Theme theme) {
|
||||
this.mResources = resources;
|
||||
this.mTheme = theme;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null || ColorStateListCacheKey.class != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ColorStateListCacheKey colorStateListCacheKey = (ColorStateListCacheKey) obj;
|
||||
return this.mResources.equals(colorStateListCacheKey.mResources) && ObjectsCompat.equals(this.mTheme, colorStateListCacheKey.mTheme);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return ObjectsCompat.hash(this.mResources, this.mTheme);
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class FontCallback {
|
||||
|
||||
|
@ -63,20 +106,20 @@ public final class ResourcesCompat {
|
|||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
||||
public static Handler getHandler(@Nullable Handler handler) {
|
||||
return handler == null ? new Handler(Looper.getMainLooper()) : handler;
|
||||
}
|
||||
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
||||
public final void callbackFailAsync(int i, @Nullable Handler handler) {
|
||||
if (handler == null) {
|
||||
handler = new Handler(Looper.getMainLooper());
|
||||
}
|
||||
handler.post(new AnonymousClass2(i));
|
||||
getHandler(handler).post(new AnonymousClass2(i));
|
||||
}
|
||||
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
||||
public final void callbackSuccessAsync(Typeface typeface, @Nullable Handler handler) {
|
||||
if (handler == null) {
|
||||
handler = new Handler(Looper.getMainLooper());
|
||||
}
|
||||
handler.post(new AnonymousClass1(typeface));
|
||||
getHandler(handler).post(new AnonymousClass1(typeface));
|
||||
}
|
||||
|
||||
public abstract void onFontRetrievalFailed(int i);
|
||||
|
@ -84,6 +127,16 @@ public final class ResourcesCompat {
|
|||
public abstract void onFontRetrieved(@NonNull Typeface typeface);
|
||||
}
|
||||
|
||||
@RequiresApi(29)
|
||||
public static class ImplApi29 {
|
||||
private ImplApi29() {
|
||||
}
|
||||
|
||||
public static float getFloat(@NonNull Resources resources, @DimenRes int i) {
|
||||
return resources.getFloat(i);
|
||||
}
|
||||
}
|
||||
|
||||
public static final class ThemeCompat {
|
||||
|
||||
@RequiresApi(23)
|
||||
|
@ -146,6 +199,41 @@ public final class ResourcesCompat {
|
|||
private ResourcesCompat() {
|
||||
}
|
||||
|
||||
private static void addColorStateListToCache(@NonNull ColorStateListCacheKey colorStateListCacheKey, @ColorRes int i, @NonNull ColorStateList colorStateList) {
|
||||
synchronized (sColorStateCacheLock) {
|
||||
WeakHashMap<ColorStateListCacheKey, SparseArray<ColorStateListCacheEntry>> weakHashMap = sColorStateCaches;
|
||||
SparseArray<ColorStateListCacheEntry> sparseArray = weakHashMap.get(colorStateListCacheKey);
|
||||
if (sparseArray == null) {
|
||||
sparseArray = new SparseArray<>();
|
||||
weakHashMap.put(colorStateListCacheKey, sparseArray);
|
||||
}
|
||||
sparseArray.append(i, new ColorStateListCacheEntry(colorStateList, colorStateListCacheKey.mResources.getConfiguration()));
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static ColorStateList getCachedColorStateList(@NonNull ColorStateListCacheKey colorStateListCacheKey, @ColorRes int i) {
|
||||
ColorStateListCacheEntry colorStateListCacheEntry;
|
||||
synchronized (sColorStateCacheLock) {
|
||||
SparseArray<ColorStateListCacheEntry> sparseArray = sColorStateCaches.get(colorStateListCacheKey);
|
||||
if (!(sparseArray == null || sparseArray.size() <= 0 || (colorStateListCacheEntry = sparseArray.get(i)) == null)) {
|
||||
if (colorStateListCacheEntry.mConfiguration.equals(colorStateListCacheKey.mResources.getConfiguration())) {
|
||||
return colorStateListCacheEntry.mValue;
|
||||
}
|
||||
sparseArray.remove(i);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Typeface getCachedFont(@NonNull Context context, @FontRes int i) throws Resources.NotFoundException {
|
||||
if (context.isRestricted()) {
|
||||
return null;
|
||||
}
|
||||
return loadFont(context, i, new TypedValue(), 0, null, null, false, true);
|
||||
}
|
||||
|
||||
@ColorInt
|
||||
public static int getColor(@NonNull Resources resources, @ColorRes int i, @Nullable Resources.Theme theme) throws Resources.NotFoundException {
|
||||
return Build.VERSION.SDK_INT >= 23 ? resources.getColor(i, theme) : resources.getColor(i);
|
||||
|
@ -153,7 +241,20 @@ public final class ResourcesCompat {
|
|||
|
||||
@Nullable
|
||||
public static ColorStateList getColorStateList(@NonNull Resources resources, @ColorRes int i, @Nullable Resources.Theme theme) throws Resources.NotFoundException {
|
||||
return Build.VERSION.SDK_INT >= 23 ? resources.getColorStateList(i, theme) : resources.getColorStateList(i);
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
return resources.getColorStateList(i, theme);
|
||||
}
|
||||
ColorStateListCacheKey colorStateListCacheKey = new ColorStateListCacheKey(resources, theme);
|
||||
ColorStateList cachedColorStateList = getCachedColorStateList(colorStateListCacheKey, i);
|
||||
if (cachedColorStateList != null) {
|
||||
return cachedColorStateList;
|
||||
}
|
||||
ColorStateList inflateColorStateList = inflateColorStateList(resources, i, theme);
|
||||
if (inflateColorStateList == null) {
|
||||
return resources.getColorStateList(i);
|
||||
}
|
||||
addColorStateListToCache(colorStateListCacheKey, i, inflateColorStateList);
|
||||
return inflateColorStateList;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
@ -167,7 +268,10 @@ public final class ResourcesCompat {
|
|||
}
|
||||
|
||||
public static float getFloat(@NonNull Resources resources, @DimenRes int i) {
|
||||
TypedValue typedValue = new TypedValue();
|
||||
if (Build.VERSION.SDK_INT >= 29) {
|
||||
return ImplApi29.getFloat(resources, i);
|
||||
}
|
||||
TypedValue typedValue = getTypedValue();
|
||||
resources.getValue(i, typedValue, true);
|
||||
if (typedValue.type == 4) {
|
||||
return typedValue.getFloat();
|
||||
|
@ -185,7 +289,7 @@ public final class ResourcesCompat {
|
|||
if (context.isRestricted()) {
|
||||
return null;
|
||||
}
|
||||
return loadFont(context, i, new TypedValue(), 0, null, null, false);
|
||||
return loadFont(context, i, new TypedValue(), 0, null, null, false, false);
|
||||
}
|
||||
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
||||
|
@ -193,7 +297,7 @@ public final class ResourcesCompat {
|
|||
if (context.isRestricted()) {
|
||||
return null;
|
||||
}
|
||||
return loadFont(context, i, typedValue, i2, fontCallback, null, true);
|
||||
return loadFont(context, i, typedValue, i2, fontCallback, null, true, false);
|
||||
}
|
||||
|
||||
public static void getFont(@NonNull Context context, @FontRes int i, @NonNull FontCallback fontCallback, @Nullable Handler handler) throws Resources.NotFoundException {
|
||||
|
@ -201,15 +305,47 @@ public final class ResourcesCompat {
|
|||
if (context.isRestricted()) {
|
||||
fontCallback.callbackFailAsync(-4, handler);
|
||||
} else {
|
||||
loadFont(context, i, new TypedValue(), 0, fontCallback, handler, false);
|
||||
loadFont(context, i, new TypedValue(), 0, fontCallback, handler, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
private static Typeface loadFont(@NonNull Context context, int i, TypedValue typedValue, int i2, @Nullable FontCallback fontCallback, @Nullable Handler handler, boolean z2) {
|
||||
@NonNull
|
||||
private static TypedValue getTypedValue() {
|
||||
ThreadLocal<TypedValue> threadLocal = sTempTypedValue;
|
||||
TypedValue typedValue = threadLocal.get();
|
||||
if (typedValue != null) {
|
||||
return typedValue;
|
||||
}
|
||||
TypedValue typedValue2 = new TypedValue();
|
||||
threadLocal.set(typedValue2);
|
||||
return typedValue2;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static ColorStateList inflateColorStateList(Resources resources, int i, @Nullable Resources.Theme theme) {
|
||||
if (isColorInt(resources, i)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return ColorStateListInflaterCompat.createFromXml(resources, resources.getXml(i), theme);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Failed to inflate ColorStateList, leaving it to the framework", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isColorInt(@NonNull Resources resources, @ColorRes int i) {
|
||||
TypedValue typedValue = getTypedValue();
|
||||
resources.getValue(i, typedValue, true);
|
||||
int i2 = typedValue.type;
|
||||
return i2 >= 28 && i2 <= 31;
|
||||
}
|
||||
|
||||
private static Typeface loadFont(@NonNull Context context, int i, TypedValue typedValue, int i2, @Nullable FontCallback fontCallback, @Nullable Handler handler, boolean z2, boolean z3) {
|
||||
Resources resources = context.getResources();
|
||||
resources.getValue(i, typedValue, true);
|
||||
Typeface loadFont = loadFont(context, resources, typedValue, i, i2, fontCallback, handler, z2);
|
||||
if (loadFont != null || fontCallback != null) {
|
||||
Typeface loadFont = loadFont(context, resources, typedValue, i, i2, fontCallback, handler, z2, z3);
|
||||
if (loadFont != null || fontCallback != null || z3) {
|
||||
return loadFont;
|
||||
}
|
||||
StringBuilder P = a.P("Font resource ID #0x");
|
||||
|
@ -218,8 +354,8 @@ public final class ResourcesCompat {
|
|||
throw new Resources.NotFoundException(P.toString());
|
||||
}
|
||||
|
||||
/* JADX WARNING: Removed duplicated region for block: B:34:0x00a4 */
|
||||
private static Typeface loadFont(@NonNull Context context, Resources resources, TypedValue typedValue, int i, int i2, @Nullable FontCallback fontCallback, @Nullable Handler handler, boolean z2) {
|
||||
/* JADX WARNING: Removed duplicated region for block: B:36:0x00a7 */
|
||||
private static Typeface loadFont(@NonNull Context context, Resources resources, TypedValue typedValue, int i, int i2, @Nullable FontCallback fontCallback, @Nullable Handler handler, boolean z2, boolean z3) {
|
||||
CharSequence charSequence = typedValue.string;
|
||||
if (charSequence != null) {
|
||||
String charSequence2 = charSequence.toString();
|
||||
|
@ -235,39 +371,42 @@ public final class ResourcesCompat {
|
|||
fontCallback.callbackSuccessAsync(findFromCache, handler);
|
||||
}
|
||||
return findFromCache;
|
||||
}
|
||||
try {
|
||||
if (charSequence2.toLowerCase().endsWith(".xml")) {
|
||||
FontResourcesParserCompat.FamilyResourceEntry parse = FontResourcesParserCompat.parse(resources.getXml(i), resources);
|
||||
if (parse != null) {
|
||||
return TypefaceCompat.createFromResourcesFamilyXml(context, parse, resources, i, i2, fontCallback, handler, z2);
|
||||
} else if (z3) {
|
||||
return null;
|
||||
} else {
|
||||
try {
|
||||
if (charSequence2.toLowerCase().endsWith(".xml")) {
|
||||
FontResourcesParserCompat.FamilyResourceEntry parse = FontResourcesParserCompat.parse(resources.getXml(i), resources);
|
||||
if (parse != null) {
|
||||
return TypefaceCompat.createFromResourcesFamilyXml(context, parse, resources, i, i2, fontCallback, handler, z2);
|
||||
}
|
||||
Log.e(TAG, "Failed to find font-family tag");
|
||||
if (fontCallback != null) {
|
||||
fontCallback.callbackFailAsync(-3, handler);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Log.e(TAG, "Failed to find font-family tag");
|
||||
Typeface createFromResourcesFontFile = TypefaceCompat.createFromResourcesFontFile(context, resources, i, charSequence2, i2);
|
||||
if (fontCallback != null) {
|
||||
if (createFromResourcesFontFile != null) {
|
||||
fontCallback.callbackSuccessAsync(createFromResourcesFontFile, handler);
|
||||
} else {
|
||||
fontCallback.callbackFailAsync(-3, handler);
|
||||
}
|
||||
}
|
||||
return createFromResourcesFontFile;
|
||||
} catch (XmlPullParserException e) {
|
||||
Log.e(TAG, "Failed to parse xml resource " + charSequence2, e);
|
||||
if (fontCallback != null) {
|
||||
fontCallback.callbackFailAsync(-3, handler);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Typeface createFromResourcesFontFile = TypefaceCompat.createFromResourcesFontFile(context, resources, i, charSequence2, i2);
|
||||
if (fontCallback != null) {
|
||||
if (createFromResourcesFontFile != null) {
|
||||
fontCallback.callbackSuccessAsync(createFromResourcesFontFile, handler);
|
||||
} else {
|
||||
fontCallback.callbackFailAsync(-3, handler);
|
||||
} catch (IOException e2) {
|
||||
Log.e(TAG, "Failed to read xml resource " + charSequence2, e2);
|
||||
if (fontCallback != null) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return createFromResourcesFontFile;
|
||||
} catch (XmlPullParserException e) {
|
||||
Log.e(TAG, "Failed to parse xml resource " + charSequence2, e);
|
||||
if (fontCallback != null) {
|
||||
fontCallback.callbackFailAsync(-3, handler);
|
||||
}
|
||||
return null;
|
||||
} catch (IOException e2) {
|
||||
Log.e(TAG, "Failed to read xml resource " + charSequence2, e2);
|
||||
if (fontCallback != null) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
StringBuilder P = a.P("Resource \"");
|
||||
|
|
|
@ -20,20 +20,20 @@ public final class TypedArrayKt {
|
|||
}
|
||||
|
||||
public static final boolean getBooleanOrThrow(TypedArray typedArray, @StyleableRes int i) {
|
||||
m.checkParameterIsNotNull(typedArray, "$this$getBooleanOrThrow");
|
||||
m.checkNotNullParameter(typedArray, "<this>");
|
||||
checkAttribute(typedArray, i);
|
||||
return typedArray.getBoolean(i, false);
|
||||
}
|
||||
|
||||
@ColorInt
|
||||
public static final int getColorOrThrow(TypedArray typedArray, @StyleableRes int i) {
|
||||
m.checkParameterIsNotNull(typedArray, "$this$getColorOrThrow");
|
||||
m.checkNotNullParameter(typedArray, "<this>");
|
||||
checkAttribute(typedArray, i);
|
||||
return typedArray.getColor(i, 0);
|
||||
}
|
||||
|
||||
public static final ColorStateList getColorStateListOrThrow(TypedArray typedArray, @StyleableRes int i) {
|
||||
m.checkParameterIsNotNull(typedArray, "$this$getColorStateListOrThrow");
|
||||
m.checkNotNullParameter(typedArray, "<this>");
|
||||
checkAttribute(typedArray, i);
|
||||
ColorStateList colorStateList = typedArray.getColorStateList(i);
|
||||
if (colorStateList != null) {
|
||||
|
@ -43,73 +43,69 @@ public final class TypedArrayKt {
|
|||
}
|
||||
|
||||
public static final float getDimensionOrThrow(TypedArray typedArray, @StyleableRes int i) {
|
||||
m.checkParameterIsNotNull(typedArray, "$this$getDimensionOrThrow");
|
||||
m.checkNotNullParameter(typedArray, "<this>");
|
||||
checkAttribute(typedArray, i);
|
||||
return typedArray.getDimension(i, 0.0f);
|
||||
}
|
||||
|
||||
@Dimension
|
||||
public static final int getDimensionPixelOffsetOrThrow(TypedArray typedArray, @StyleableRes int i) {
|
||||
m.checkParameterIsNotNull(typedArray, "$this$getDimensionPixelOffsetOrThrow");
|
||||
m.checkNotNullParameter(typedArray, "<this>");
|
||||
checkAttribute(typedArray, i);
|
||||
return typedArray.getDimensionPixelOffset(i, 0);
|
||||
}
|
||||
|
||||
@Dimension
|
||||
public static final int getDimensionPixelSizeOrThrow(TypedArray typedArray, @StyleableRes int i) {
|
||||
m.checkParameterIsNotNull(typedArray, "$this$getDimensionPixelSizeOrThrow");
|
||||
m.checkNotNullParameter(typedArray, "<this>");
|
||||
checkAttribute(typedArray, i);
|
||||
return typedArray.getDimensionPixelSize(i, 0);
|
||||
}
|
||||
|
||||
public static final Drawable getDrawableOrThrow(TypedArray typedArray, @StyleableRes int i) {
|
||||
m.checkParameterIsNotNull(typedArray, "$this$getDrawableOrThrow");
|
||||
m.checkNotNullParameter(typedArray, "<this>");
|
||||
checkAttribute(typedArray, i);
|
||||
Drawable drawable = typedArray.getDrawable(i);
|
||||
if (drawable == null) {
|
||||
m.throwNpe();
|
||||
}
|
||||
m.checkNotNull(drawable);
|
||||
return drawable;
|
||||
}
|
||||
|
||||
public static final float getFloatOrThrow(TypedArray typedArray, @StyleableRes int i) {
|
||||
m.checkParameterIsNotNull(typedArray, "$this$getFloatOrThrow");
|
||||
m.checkNotNullParameter(typedArray, "<this>");
|
||||
checkAttribute(typedArray, i);
|
||||
return typedArray.getFloat(i, 0.0f);
|
||||
}
|
||||
|
||||
@RequiresApi(26)
|
||||
public static final Typeface getFontOrThrow(TypedArray typedArray, @StyleableRes int i) {
|
||||
m.checkParameterIsNotNull(typedArray, "$this$getFontOrThrow");
|
||||
m.checkNotNullParameter(typedArray, "<this>");
|
||||
checkAttribute(typedArray, i);
|
||||
Typeface font = typedArray.getFont(i);
|
||||
if (font == null) {
|
||||
m.throwNpe();
|
||||
}
|
||||
m.checkNotNull(font);
|
||||
return font;
|
||||
}
|
||||
|
||||
public static final int getIntOrThrow(TypedArray typedArray, @StyleableRes int i) {
|
||||
m.checkParameterIsNotNull(typedArray, "$this$getIntOrThrow");
|
||||
m.checkNotNullParameter(typedArray, "<this>");
|
||||
checkAttribute(typedArray, i);
|
||||
return typedArray.getInt(i, 0);
|
||||
}
|
||||
|
||||
public static final int getIntegerOrThrow(TypedArray typedArray, @StyleableRes int i) {
|
||||
m.checkParameterIsNotNull(typedArray, "$this$getIntegerOrThrow");
|
||||
m.checkNotNullParameter(typedArray, "<this>");
|
||||
checkAttribute(typedArray, i);
|
||||
return typedArray.getInteger(i, 0);
|
||||
}
|
||||
|
||||
@AnyRes
|
||||
public static final int getResourceIdOrThrow(TypedArray typedArray, @StyleableRes int i) {
|
||||
m.checkParameterIsNotNull(typedArray, "$this$getResourceIdOrThrow");
|
||||
m.checkNotNullParameter(typedArray, "<this>");
|
||||
checkAttribute(typedArray, i);
|
||||
return typedArray.getResourceId(i, 0);
|
||||
}
|
||||
|
||||
public static final String getStringOrThrow(TypedArray typedArray, @StyleableRes int i) {
|
||||
m.checkParameterIsNotNull(typedArray, "$this$getStringOrThrow");
|
||||
m.checkNotNullParameter(typedArray, "<this>");
|
||||
checkAttribute(typedArray, i);
|
||||
String string = typedArray.getString(i);
|
||||
if (string != null) {
|
||||
|
@ -119,15 +115,15 @@ public final class TypedArrayKt {
|
|||
}
|
||||
|
||||
public static final CharSequence[] getTextArrayOrThrow(TypedArray typedArray, @StyleableRes int i) {
|
||||
m.checkParameterIsNotNull(typedArray, "$this$getTextArrayOrThrow");
|
||||
m.checkNotNullParameter(typedArray, "<this>");
|
||||
checkAttribute(typedArray, i);
|
||||
CharSequence[] textArray = typedArray.getTextArray(i);
|
||||
m.checkExpressionValueIsNotNull(textArray, "getTextArray(index)");
|
||||
m.checkNotNullExpressionValue(textArray, "getTextArray(index)");
|
||||
return textArray;
|
||||
}
|
||||
|
||||
public static final CharSequence getTextOrThrow(TypedArray typedArray, @StyleableRes int i) {
|
||||
m.checkParameterIsNotNull(typedArray, "$this$getTextOrThrow");
|
||||
m.checkNotNullParameter(typedArray, "<this>");
|
||||
checkAttribute(typedArray, i);
|
||||
CharSequence text = typedArray.getText(i);
|
||||
if (text != null) {
|
||||
|
@ -137,8 +133,8 @@ public final class TypedArrayKt {
|
|||
}
|
||||
|
||||
public static final <R> R use(TypedArray typedArray, Function1<? super TypedArray, ? extends R> function1) {
|
||||
m.checkParameterIsNotNull(typedArray, "$this$use");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(typedArray, "<this>");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
R r = (R) function1.invoke(typedArray);
|
||||
typedArray.recycle();
|
||||
return r;
|
||||
|
|
|
@ -5,7 +5,7 @@ import d0.z.d.m;
|
|||
/* compiled from: Cursor.kt */
|
||||
public final class CursorKt {
|
||||
public static final byte[] getBlobOrNull(Cursor cursor, int i) {
|
||||
m.checkParameterIsNotNull(cursor, "$this$getBlobOrNull");
|
||||
m.checkNotNullParameter(cursor, "<this>");
|
||||
if (cursor.isNull(i)) {
|
||||
return null;
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ public final class CursorKt {
|
|||
}
|
||||
|
||||
public static final Double getDoubleOrNull(Cursor cursor, int i) {
|
||||
m.checkParameterIsNotNull(cursor, "$this$getDoubleOrNull");
|
||||
m.checkNotNullParameter(cursor, "<this>");
|
||||
if (cursor.isNull(i)) {
|
||||
return null;
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ public final class CursorKt {
|
|||
}
|
||||
|
||||
public static final Float getFloatOrNull(Cursor cursor, int i) {
|
||||
m.checkParameterIsNotNull(cursor, "$this$getFloatOrNull");
|
||||
m.checkNotNullParameter(cursor, "<this>");
|
||||
if (cursor.isNull(i)) {
|
||||
return null;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ public final class CursorKt {
|
|||
}
|
||||
|
||||
public static final Integer getIntOrNull(Cursor cursor, int i) {
|
||||
m.checkParameterIsNotNull(cursor, "$this$getIntOrNull");
|
||||
m.checkNotNullParameter(cursor, "<this>");
|
||||
if (cursor.isNull(i)) {
|
||||
return null;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public final class CursorKt {
|
|||
}
|
||||
|
||||
public static final Long getLongOrNull(Cursor cursor, int i) {
|
||||
m.checkParameterIsNotNull(cursor, "$this$getLongOrNull");
|
||||
m.checkNotNullParameter(cursor, "<this>");
|
||||
if (cursor.isNull(i)) {
|
||||
return null;
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public final class CursorKt {
|
|||
}
|
||||
|
||||
public static final Short getShortOrNull(Cursor cursor, int i) {
|
||||
m.checkParameterIsNotNull(cursor, "$this$getShortOrNull");
|
||||
m.checkNotNullParameter(cursor, "<this>");
|
||||
if (cursor.isNull(i)) {
|
||||
return null;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public final class CursorKt {
|
|||
}
|
||||
|
||||
public static final String getStringOrNull(Cursor cursor, int i) {
|
||||
m.checkParameterIsNotNull(cursor, "$this$getStringOrNull");
|
||||
m.checkNotNullParameter(cursor, "<this>");
|
||||
if (cursor.isNull(i)) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@ import kotlin.jvm.functions.Function1;
|
|||
/* compiled from: SQLiteDatabase.kt */
|
||||
public final class SQLiteDatabaseKt {
|
||||
public static final <T> T transaction(SQLiteDatabase sQLiteDatabase, boolean z2, Function1<? super SQLiteDatabase, ? extends T> function1) {
|
||||
m.checkParameterIsNotNull(sQLiteDatabase, "$this$transaction");
|
||||
m.checkParameterIsNotNull(function1, "body");
|
||||
m.checkNotNullParameter(sQLiteDatabase, "<this>");
|
||||
m.checkNotNullParameter(function1, "body");
|
||||
if (z2) {
|
||||
sQLiteDatabase.beginTransaction();
|
||||
} else {
|
||||
|
@ -31,8 +31,8 @@ public final class SQLiteDatabaseKt {
|
|||
if ((i & 1) != 0) {
|
||||
z2 = true;
|
||||
}
|
||||
m.checkParameterIsNotNull(sQLiteDatabase, "$this$transaction");
|
||||
m.checkParameterIsNotNull(function1, "body");
|
||||
m.checkNotNullParameter(sQLiteDatabase, "<this>");
|
||||
m.checkNotNullParameter(function1, "body");
|
||||
if (z2) {
|
||||
sQLiteDatabase.beginTransaction();
|
||||
} else {
|
||||
|
|
|
@ -13,45 +13,46 @@ import kotlin.jvm.functions.Function1;
|
|||
/* compiled from: Bitmap.kt */
|
||||
public final class BitmapKt {
|
||||
public static final Bitmap applyCanvas(Bitmap bitmap, Function1<? super Canvas, Unit> function1) {
|
||||
m.checkParameterIsNotNull(bitmap, "$this$applyCanvas");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(bitmap, "<this>");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
function1.invoke(new Canvas(bitmap));
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
public static final boolean contains(Bitmap bitmap, Point point) {
|
||||
int i;
|
||||
m.checkParameterIsNotNull(bitmap, "$this$contains");
|
||||
m.checkParameterIsNotNull(point, "p");
|
||||
m.checkNotNullParameter(bitmap, "<this>");
|
||||
m.checkNotNullParameter(point, "p");
|
||||
int i2 = point.x;
|
||||
return i2 >= 0 && i2 < bitmap.getWidth() && (i = point.y) >= 0 && i < bitmap.getHeight();
|
||||
}
|
||||
|
||||
public static final boolean contains(Bitmap bitmap, PointF pointF) {
|
||||
m.checkParameterIsNotNull(bitmap, "$this$contains");
|
||||
m.checkParameterIsNotNull(pointF, "p");
|
||||
m.checkNotNullParameter(bitmap, "<this>");
|
||||
m.checkNotNullParameter(pointF, "p");
|
||||
float f = pointF.x;
|
||||
float f2 = (float) 0;
|
||||
if (f < f2 || f >= ((float) bitmap.getWidth())) {
|
||||
return false;
|
||||
if (f >= 0.0f && f < ((float) bitmap.getWidth())) {
|
||||
float f2 = pointF.y;
|
||||
if (f2 >= 0.0f && f2 < ((float) bitmap.getHeight())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
float f3 = pointF.y;
|
||||
return f3 >= f2 && f3 < ((float) bitmap.getHeight());
|
||||
return false;
|
||||
}
|
||||
|
||||
public static final Bitmap createBitmap(int i, int i2, Bitmap.Config config) {
|
||||
m.checkParameterIsNotNull(config, "config");
|
||||
m.checkNotNullParameter(config, "config");
|
||||
Bitmap createBitmap = Bitmap.createBitmap(i, i2, config);
|
||||
m.checkExpressionValueIsNotNull(createBitmap, "Bitmap.createBitmap(width, height, config)");
|
||||
m.checkNotNullExpressionValue(createBitmap, "createBitmap(width, height, config)");
|
||||
return createBitmap;
|
||||
}
|
||||
|
||||
@RequiresApi(26)
|
||||
public static final Bitmap createBitmap(int i, int i2, Bitmap.Config config, boolean z2, ColorSpace colorSpace) {
|
||||
m.checkParameterIsNotNull(config, "config");
|
||||
m.checkParameterIsNotNull(colorSpace, "colorSpace");
|
||||
m.checkNotNullParameter(config, "config");
|
||||
m.checkNotNullParameter(colorSpace, "colorSpace");
|
||||
Bitmap createBitmap = Bitmap.createBitmap(i, i2, config, z2, colorSpace);
|
||||
m.checkExpressionValueIsNotNull(createBitmap, "Bitmap.createBitmap(widt…ig, hasAlpha, colorSpace)");
|
||||
m.checkNotNullExpressionValue(createBitmap, "createBitmap(width, height, config, hasAlpha, colorSpace)");
|
||||
return createBitmap;
|
||||
}
|
||||
|
||||
|
@ -59,9 +60,9 @@ public final class BitmapKt {
|
|||
if ((i3 & 4) != 0) {
|
||||
config = Bitmap.Config.ARGB_8888;
|
||||
}
|
||||
m.checkParameterIsNotNull(config, "config");
|
||||
m.checkNotNullParameter(config, "config");
|
||||
Bitmap createBitmap = Bitmap.createBitmap(i, i2, config);
|
||||
m.checkExpressionValueIsNotNull(createBitmap, "Bitmap.createBitmap(width, height, config)");
|
||||
m.checkNotNullExpressionValue(createBitmap, "createBitmap(width, height, config)");
|
||||
return createBitmap;
|
||||
}
|
||||
|
||||
|
@ -74,24 +75,24 @@ public final class BitmapKt {
|
|||
}
|
||||
if ((i3 & 16) != 0) {
|
||||
colorSpace = ColorSpace.get(ColorSpace.Named.SRGB);
|
||||
m.checkExpressionValueIsNotNull(colorSpace, "ColorSpace.get(ColorSpace.Named.SRGB)");
|
||||
m.checkNotNullExpressionValue(colorSpace, "get(ColorSpace.Named.SRGB)");
|
||||
}
|
||||
m.checkParameterIsNotNull(config, "config");
|
||||
m.checkParameterIsNotNull(colorSpace, "colorSpace");
|
||||
m.checkNotNullParameter(config, "config");
|
||||
m.checkNotNullParameter(colorSpace, "colorSpace");
|
||||
Bitmap createBitmap = Bitmap.createBitmap(i, i2, config, z2, colorSpace);
|
||||
m.checkExpressionValueIsNotNull(createBitmap, "Bitmap.createBitmap(widt…ig, hasAlpha, colorSpace)");
|
||||
m.checkNotNullExpressionValue(createBitmap, "createBitmap(width, height, config, hasAlpha, colorSpace)");
|
||||
return createBitmap;
|
||||
}
|
||||
|
||||
public static final int get(Bitmap bitmap, int i, int i2) {
|
||||
m.checkParameterIsNotNull(bitmap, "$this$get");
|
||||
m.checkNotNullParameter(bitmap, "<this>");
|
||||
return bitmap.getPixel(i, i2);
|
||||
}
|
||||
|
||||
public static final Bitmap scale(Bitmap bitmap, int i, int i2, boolean z2) {
|
||||
m.checkParameterIsNotNull(bitmap, "$this$scale");
|
||||
m.checkNotNullParameter(bitmap, "<this>");
|
||||
Bitmap createScaledBitmap = Bitmap.createScaledBitmap(bitmap, i, i2, z2);
|
||||
m.checkExpressionValueIsNotNull(createScaledBitmap, "Bitmap.createScaledBitma…s, width, height, filter)");
|
||||
m.checkNotNullExpressionValue(createScaledBitmap, "createScaledBitmap(this, width, height, filter)");
|
||||
return createScaledBitmap;
|
||||
}
|
||||
|
||||
|
@ -99,14 +100,14 @@ public final class BitmapKt {
|
|||
if ((i3 & 4) != 0) {
|
||||
z2 = true;
|
||||
}
|
||||
m.checkParameterIsNotNull(bitmap, "$this$scale");
|
||||
m.checkNotNullParameter(bitmap, "<this>");
|
||||
Bitmap createScaledBitmap = Bitmap.createScaledBitmap(bitmap, i, i2, z2);
|
||||
m.checkExpressionValueIsNotNull(createScaledBitmap, "Bitmap.createScaledBitma…s, width, height, filter)");
|
||||
m.checkNotNullExpressionValue(createScaledBitmap, "createScaledBitmap(this, width, height, filter)");
|
||||
return createScaledBitmap;
|
||||
}
|
||||
|
||||
public static final void set(Bitmap bitmap, int i, int i2, @ColorInt int i3) {
|
||||
m.checkParameterIsNotNull(bitmap, "$this$set");
|
||||
m.checkNotNullParameter(bitmap, "<this>");
|
||||
bitmap.setPixel(i, i2, i3);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@ import kotlin.jvm.functions.Function1;
|
|||
/* compiled from: Canvas.kt */
|
||||
public final class CanvasKt {
|
||||
public static final void withClip(Canvas canvas, float f, float f2, float f3, float f4, Function1<? super Canvas, Unit> function1) {
|
||||
m.checkParameterIsNotNull(canvas, "$this$withClip");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(canvas, "<this>");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
int save = canvas.save();
|
||||
canvas.clipRect(f, f2, f3, f4);
|
||||
int i = 1;
|
||||
|
@ -25,8 +25,8 @@ public final class CanvasKt {
|
|||
}
|
||||
|
||||
public static final void withClip(Canvas canvas, int i, int i2, int i3, int i4, Function1<? super Canvas, Unit> function1) {
|
||||
m.checkParameterIsNotNull(canvas, "$this$withClip");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(canvas, "<this>");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
int save = canvas.save();
|
||||
canvas.clipRect(i, i2, i3, i4);
|
||||
int i5 = 1;
|
||||
|
@ -38,9 +38,9 @@ public final class CanvasKt {
|
|||
}
|
||||
|
||||
public static final void withClip(Canvas canvas, Path path, Function1<? super Canvas, Unit> function1) {
|
||||
m.checkParameterIsNotNull(canvas, "$this$withClip");
|
||||
m.checkParameterIsNotNull(path, "clipPath");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(canvas, "<this>");
|
||||
m.checkNotNullParameter(path, "clipPath");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
int save = canvas.save();
|
||||
canvas.clipPath(path);
|
||||
int i = 1;
|
||||
|
@ -52,9 +52,9 @@ public final class CanvasKt {
|
|||
}
|
||||
|
||||
public static final void withClip(Canvas canvas, Rect rect, Function1<? super Canvas, Unit> function1) {
|
||||
m.checkParameterIsNotNull(canvas, "$this$withClip");
|
||||
m.checkParameterIsNotNull(rect, "clipRect");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(canvas, "<this>");
|
||||
m.checkNotNullParameter(rect, "clipRect");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
int save = canvas.save();
|
||||
canvas.clipRect(rect);
|
||||
int i = 1;
|
||||
|
@ -66,9 +66,9 @@ public final class CanvasKt {
|
|||
}
|
||||
|
||||
public static final void withClip(Canvas canvas, RectF rectF, Function1<? super Canvas, Unit> function1) {
|
||||
m.checkParameterIsNotNull(canvas, "$this$withClip");
|
||||
m.checkParameterIsNotNull(rectF, "clipRect");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(canvas, "<this>");
|
||||
m.checkNotNullParameter(rectF, "clipRect");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
int save = canvas.save();
|
||||
canvas.clipRect(rectF);
|
||||
int i = 1;
|
||||
|
@ -80,9 +80,9 @@ public final class CanvasKt {
|
|||
}
|
||||
|
||||
public static final void withMatrix(Canvas canvas, Matrix matrix, Function1<? super Canvas, Unit> function1) {
|
||||
m.checkParameterIsNotNull(canvas, "$this$withMatrix");
|
||||
m.checkParameterIsNotNull(matrix, "matrix");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(canvas, "<this>");
|
||||
m.checkNotNullParameter(matrix, "matrix");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
int save = canvas.save();
|
||||
canvas.concat(matrix);
|
||||
int i = 1;
|
||||
|
@ -98,9 +98,9 @@ public final class CanvasKt {
|
|||
if ((i & 1) != 0) {
|
||||
matrix = new Matrix();
|
||||
}
|
||||
m.checkParameterIsNotNull(canvas, "$this$withMatrix");
|
||||
m.checkParameterIsNotNull(matrix, "matrix");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(canvas, "<this>");
|
||||
m.checkNotNullParameter(matrix, "matrix");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
int save = canvas.save();
|
||||
canvas.concat(matrix);
|
||||
try {
|
||||
|
@ -111,8 +111,8 @@ public final class CanvasKt {
|
|||
}
|
||||
|
||||
public static final void withRotation(Canvas canvas, float f, float f2, float f3, Function1<? super Canvas, Unit> function1) {
|
||||
m.checkParameterIsNotNull(canvas, "$this$withRotation");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(canvas, "<this>");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
int save = canvas.save();
|
||||
canvas.rotate(f, f2, f3);
|
||||
int i = 1;
|
||||
|
@ -133,8 +133,8 @@ public final class CanvasKt {
|
|||
if ((i & 4) != 0) {
|
||||
f3 = 0.0f;
|
||||
}
|
||||
m.checkParameterIsNotNull(canvas, "$this$withRotation");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(canvas, "<this>");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
int save = canvas.save();
|
||||
canvas.rotate(f, f2, f3);
|
||||
int i2 = 1;
|
||||
|
@ -146,8 +146,8 @@ public final class CanvasKt {
|
|||
}
|
||||
|
||||
public static final void withSave(Canvas canvas, Function1<? super Canvas, Unit> function1) {
|
||||
m.checkParameterIsNotNull(canvas, "$this$withSave");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(canvas, "<this>");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
int save = canvas.save();
|
||||
int i = 1;
|
||||
try {
|
||||
|
@ -158,8 +158,8 @@ public final class CanvasKt {
|
|||
}
|
||||
|
||||
public static final void withScale(Canvas canvas, float f, float f2, float f3, float f4, Function1<? super Canvas, Unit> function1) {
|
||||
m.checkParameterIsNotNull(canvas, "$this$withScale");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(canvas, "<this>");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
int save = canvas.save();
|
||||
canvas.scale(f, f2, f3, f4);
|
||||
int i = 1;
|
||||
|
@ -183,8 +183,8 @@ public final class CanvasKt {
|
|||
if ((i & 8) != 0) {
|
||||
f4 = 0.0f;
|
||||
}
|
||||
m.checkParameterIsNotNull(canvas, "$this$withScale");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(canvas, "<this>");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
int save = canvas.save();
|
||||
canvas.scale(f, f2, f3, f4);
|
||||
int i2 = 1;
|
||||
|
@ -196,8 +196,8 @@ public final class CanvasKt {
|
|||
}
|
||||
|
||||
public static final void withSkew(Canvas canvas, float f, float f2, Function1<? super Canvas, Unit> function1) {
|
||||
m.checkParameterIsNotNull(canvas, "$this$withSkew");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(canvas, "<this>");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
int save = canvas.save();
|
||||
canvas.skew(f, f2);
|
||||
int i = 1;
|
||||
|
@ -215,8 +215,8 @@ public final class CanvasKt {
|
|||
if ((i & 2) != 0) {
|
||||
f2 = 0.0f;
|
||||
}
|
||||
m.checkParameterIsNotNull(canvas, "$this$withSkew");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(canvas, "<this>");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
int save = canvas.save();
|
||||
canvas.skew(f, f2);
|
||||
int i2 = 1;
|
||||
|
@ -228,8 +228,8 @@ public final class CanvasKt {
|
|||
}
|
||||
|
||||
public static final void withTranslation(Canvas canvas, float f, float f2, Function1<? super Canvas, Unit> function1) {
|
||||
m.checkParameterIsNotNull(canvas, "$this$withTranslation");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(canvas, "<this>");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
int save = canvas.save();
|
||||
canvas.translate(f, f2);
|
||||
int i = 1;
|
||||
|
@ -247,8 +247,8 @@ public final class CanvasKt {
|
|||
if ((i & 2) != 0) {
|
||||
f2 = 0.0f;
|
||||
}
|
||||
m.checkParameterIsNotNull(canvas, "$this$withTranslation");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(canvas, "<this>");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
int save = canvas.save();
|
||||
canvas.translate(f, f2);
|
||||
int i2 = 1;
|
||||
|
|
|
@ -14,7 +14,7 @@ public final class ColorKt {
|
|||
|
||||
@RequiresApi(26)
|
||||
public static final float component1(Color color) {
|
||||
m.checkParameterIsNotNull(color, "$this$component1");
|
||||
m.checkNotNullParameter(color, "<this>");
|
||||
return color.getComponent(0);
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ public final class ColorKt {
|
|||
|
||||
@RequiresApi(26)
|
||||
public static final float component2(Color color) {
|
||||
m.checkParameterIsNotNull(color, "$this$component2");
|
||||
m.checkNotNullParameter(color, "<this>");
|
||||
return color.getComponent(1);
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ public final class ColorKt {
|
|||
|
||||
@RequiresApi(26)
|
||||
public static final float component3(Color color) {
|
||||
m.checkParameterIsNotNull(color, "$this$component3");
|
||||
m.checkNotNullParameter(color, "<this>");
|
||||
return color.getComponent(2);
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ public final class ColorKt {
|
|||
|
||||
@RequiresApi(26)
|
||||
public static final float component4(Color color) {
|
||||
m.checkParameterIsNotNull(color, "$this$component4");
|
||||
m.checkNotNullParameter(color, "<this>");
|
||||
return color.getComponent(3);
|
||||
}
|
||||
|
||||
|
@ -69,43 +69,43 @@ public final class ColorKt {
|
|||
|
||||
@RequiresApi(26)
|
||||
public static final long convertTo(@ColorInt int i, ColorSpace.Named named) {
|
||||
m.checkParameterIsNotNull(named, "colorSpace");
|
||||
m.checkNotNullParameter(named, "colorSpace");
|
||||
return Color.convert(i, ColorSpace.get(named));
|
||||
}
|
||||
|
||||
@RequiresApi(26)
|
||||
public static final long convertTo(@ColorInt int i, ColorSpace colorSpace) {
|
||||
m.checkParameterIsNotNull(colorSpace, "colorSpace");
|
||||
m.checkNotNullParameter(colorSpace, "colorSpace");
|
||||
return Color.convert(i, colorSpace);
|
||||
}
|
||||
|
||||
@RequiresApi(26)
|
||||
public static final long convertTo(long j, ColorSpace.Named named) {
|
||||
m.checkParameterIsNotNull(named, "colorSpace");
|
||||
m.checkNotNullParameter(named, "colorSpace");
|
||||
return Color.convert(j, ColorSpace.get(named));
|
||||
}
|
||||
|
||||
@RequiresApi(26)
|
||||
public static final long convertTo(long j, ColorSpace colorSpace) {
|
||||
m.checkParameterIsNotNull(colorSpace, "colorSpace");
|
||||
m.checkNotNullParameter(colorSpace, "colorSpace");
|
||||
return Color.convert(j, colorSpace);
|
||||
}
|
||||
|
||||
@RequiresApi(26)
|
||||
public static final Color convertTo(Color color, ColorSpace.Named named) {
|
||||
m.checkParameterIsNotNull(color, "$this$convertTo");
|
||||
m.checkParameterIsNotNull(named, "colorSpace");
|
||||
m.checkNotNullParameter(color, "<this>");
|
||||
m.checkNotNullParameter(named, "colorSpace");
|
||||
Color convert = color.convert(ColorSpace.get(named));
|
||||
m.checkExpressionValueIsNotNull(convert, "convert(ColorSpace.get(colorSpace))");
|
||||
m.checkNotNullExpressionValue(convert, "convert(ColorSpace.get(colorSpace))");
|
||||
return convert;
|
||||
}
|
||||
|
||||
@RequiresApi(26)
|
||||
public static final Color convertTo(Color color, ColorSpace colorSpace) {
|
||||
m.checkParameterIsNotNull(color, "$this$convertTo");
|
||||
m.checkParameterIsNotNull(colorSpace, "colorSpace");
|
||||
m.checkNotNullParameter(color, "<this>");
|
||||
m.checkNotNullParameter(colorSpace, "colorSpace");
|
||||
Color convert = color.convert(colorSpace);
|
||||
m.checkExpressionValueIsNotNull(convert, "convert(colorSpace)");
|
||||
m.checkNotNullExpressionValue(convert, "convert(colorSpace)");
|
||||
return convert;
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ public final class ColorKt {
|
|||
@RequiresApi(26)
|
||||
public static final ColorSpace getColorSpace(long j) {
|
||||
ColorSpace colorSpace = Color.colorSpace(j);
|
||||
m.checkExpressionValueIsNotNull(colorSpace, "Color.colorSpace(this)");
|
||||
m.checkNotNullExpressionValue(colorSpace, "colorSpace(this)");
|
||||
return colorSpace;
|
||||
}
|
||||
|
||||
|
@ -174,24 +174,24 @@ public final class ColorKt {
|
|||
|
||||
@RequiresApi(26)
|
||||
public static final Color plus(Color color, Color color2) {
|
||||
m.checkParameterIsNotNull(color, "$this$plus");
|
||||
m.checkParameterIsNotNull(color2, "c");
|
||||
m.checkNotNullParameter(color, "<this>");
|
||||
m.checkNotNullParameter(color2, "c");
|
||||
Color compositeColors = ColorUtils.compositeColors(color2, color);
|
||||
m.checkExpressionValueIsNotNull(compositeColors, "ColorUtils.compositeColors(c, this)");
|
||||
m.checkNotNullExpressionValue(compositeColors, "compositeColors(c, this)");
|
||||
return compositeColors;
|
||||
}
|
||||
|
||||
@RequiresApi(26)
|
||||
public static final Color toColor(@ColorInt int i) {
|
||||
Color valueOf = Color.valueOf(i);
|
||||
m.checkExpressionValueIsNotNull(valueOf, "Color.valueOf(this)");
|
||||
m.checkNotNullExpressionValue(valueOf, "valueOf(this)");
|
||||
return valueOf;
|
||||
}
|
||||
|
||||
@RequiresApi(26)
|
||||
public static final Color toColor(long j) {
|
||||
Color valueOf = Color.valueOf(j);
|
||||
m.checkExpressionValueIsNotNull(valueOf, "Color.valueOf(this)");
|
||||
m.checkNotNullExpressionValue(valueOf, "valueOf(this)");
|
||||
return valueOf;
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ public final class ColorKt {
|
|||
|
||||
@ColorInt
|
||||
public static final int toColorInt(String str) {
|
||||
m.checkParameterIsNotNull(str, "$this$toColorInt");
|
||||
m.checkNotNullParameter(str, "<this>");
|
||||
return Color.parseColor(str);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,20 +2,23 @@ package androidx.core.graphics;
|
|||
|
||||
import android.graphics.ImageDecoder;
|
||||
import d0.z.d.m;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function3;
|
||||
/* compiled from: ImageDecoder.kt */
|
||||
public final class ImageDecoderKt$decodeBitmap$1 implements ImageDecoder.OnHeaderDecodedListener {
|
||||
public final /* synthetic */ Function3 $action;
|
||||
public final /* synthetic */ Function3<ImageDecoder, ImageDecoder.ImageInfo, ImageDecoder.Source, Unit> $action;
|
||||
|
||||
public ImageDecoderKt$decodeBitmap$1(Function3 function3) {
|
||||
/* JADX DEBUG: Multi-variable search result rejected for r1v0, resolved type: kotlin.jvm.functions.Function3<? super android.graphics.ImageDecoder, ? super android.graphics.ImageDecoder$ImageInfo, ? super android.graphics.ImageDecoder$Source, kotlin.Unit> */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public ImageDecoderKt$decodeBitmap$1(Function3<? super ImageDecoder, ? super ImageDecoder.ImageInfo, ? super ImageDecoder.Source, Unit> function3) {
|
||||
this.$action = function3;
|
||||
}
|
||||
|
||||
@Override // android.graphics.ImageDecoder.OnHeaderDecodedListener
|
||||
public final void onHeaderDecoded(ImageDecoder imageDecoder, ImageDecoder.ImageInfo imageInfo, ImageDecoder.Source source) {
|
||||
m.checkParameterIsNotNull(imageDecoder, "decoder");
|
||||
m.checkParameterIsNotNull(imageInfo, "info");
|
||||
m.checkParameterIsNotNull(source, "source");
|
||||
m.checkNotNullParameter(imageDecoder, "decoder");
|
||||
m.checkNotNullParameter(imageInfo, "info");
|
||||
m.checkNotNullParameter(source, "source");
|
||||
this.$action.invoke(imageDecoder, imageInfo, source);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,20 +2,23 @@ package androidx.core.graphics;
|
|||
|
||||
import android.graphics.ImageDecoder;
|
||||
import d0.z.d.m;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function3;
|
||||
/* compiled from: ImageDecoder.kt */
|
||||
public final class ImageDecoderKt$decodeDrawable$1 implements ImageDecoder.OnHeaderDecodedListener {
|
||||
public final /* synthetic */ Function3 $action;
|
||||
public final /* synthetic */ Function3<ImageDecoder, ImageDecoder.ImageInfo, ImageDecoder.Source, Unit> $action;
|
||||
|
||||
public ImageDecoderKt$decodeDrawable$1(Function3 function3) {
|
||||
/* JADX DEBUG: Multi-variable search result rejected for r1v0, resolved type: kotlin.jvm.functions.Function3<? super android.graphics.ImageDecoder, ? super android.graphics.ImageDecoder$ImageInfo, ? super android.graphics.ImageDecoder$Source, kotlin.Unit> */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public ImageDecoderKt$decodeDrawable$1(Function3<? super ImageDecoder, ? super ImageDecoder.ImageInfo, ? super ImageDecoder.Source, Unit> function3) {
|
||||
this.$action = function3;
|
||||
}
|
||||
|
||||
@Override // android.graphics.ImageDecoder.OnHeaderDecodedListener
|
||||
public final void onHeaderDecoded(ImageDecoder imageDecoder, ImageDecoder.ImageInfo imageInfo, ImageDecoder.Source source) {
|
||||
m.checkParameterIsNotNull(imageDecoder, "decoder");
|
||||
m.checkParameterIsNotNull(imageInfo, "info");
|
||||
m.checkParameterIsNotNull(source, "source");
|
||||
m.checkNotNullParameter(imageDecoder, "decoder");
|
||||
m.checkNotNullParameter(imageInfo, "info");
|
||||
m.checkNotNullParameter(source, "source");
|
||||
this.$action.invoke(imageDecoder, imageInfo, source);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,19 +11,19 @@ import kotlin.jvm.functions.Function3;
|
|||
public final class ImageDecoderKt {
|
||||
@RequiresApi(28)
|
||||
public static final Bitmap decodeBitmap(ImageDecoder.Source source, Function3<? super ImageDecoder, ? super ImageDecoder.ImageInfo, ? super ImageDecoder.Source, Unit> function3) {
|
||||
m.checkParameterIsNotNull(source, "$this$decodeBitmap");
|
||||
m.checkParameterIsNotNull(function3, "action");
|
||||
m.checkNotNullParameter(source, "<this>");
|
||||
m.checkNotNullParameter(function3, "action");
|
||||
Bitmap decodeBitmap = ImageDecoder.decodeBitmap(source, new ImageDecoderKt$decodeBitmap$1(function3));
|
||||
m.checkExpressionValueIsNotNull(decodeBitmap, "ImageDecoder.decodeBitma…ction(info, source)\n }");
|
||||
m.checkNotNullExpressionValue(decodeBitmap, "crossinline action: ImageDecoder.(info: ImageInfo, source: Source) -> Unit\n): Bitmap {\n return ImageDecoder.decodeBitmap(this) { decoder, info, source ->\n decoder.action(info, source)\n }");
|
||||
return decodeBitmap;
|
||||
}
|
||||
|
||||
@RequiresApi(28)
|
||||
public static final Drawable decodeDrawable(ImageDecoder.Source source, Function3<? super ImageDecoder, ? super ImageDecoder.ImageInfo, ? super ImageDecoder.Source, Unit> function3) {
|
||||
m.checkParameterIsNotNull(source, "$this$decodeDrawable");
|
||||
m.checkParameterIsNotNull(function3, "action");
|
||||
m.checkNotNullParameter(source, "<this>");
|
||||
m.checkNotNullParameter(function3, "action");
|
||||
Drawable decodeDrawable = ImageDecoder.decodeDrawable(source, new ImageDecoderKt$decodeDrawable$1(function3));
|
||||
m.checkExpressionValueIsNotNull(decodeDrawable, "ImageDecoder.decodeDrawa…ction(info, source)\n }");
|
||||
m.checkNotNullExpressionValue(decodeDrawable, "crossinline action: ImageDecoder.(info: ImageInfo, source: Source) -> Unit\n): Drawable {\n return ImageDecoder.decodeDrawable(this) { decoder, info, source ->\n decoder.action(info, source)\n }");
|
||||
return decodeDrawable;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,21 @@ public final class Insets {
|
|||
this.bottom = i4;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static Insets add(@NonNull Insets insets, @NonNull Insets insets2) {
|
||||
return of(insets.left + insets2.left, insets.top + insets2.top, insets.right + insets2.right, insets.bottom + insets2.bottom);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static Insets max(@NonNull Insets insets, @NonNull Insets insets2) {
|
||||
return of(Math.max(insets.left, insets2.left), Math.max(insets.top, insets2.top), Math.max(insets.right, insets2.right), Math.max(insets.bottom, insets2.bottom));
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static Insets min(@NonNull Insets insets, @NonNull Insets insets2) {
|
||||
return of(Math.min(insets.left, insets2.left), Math.min(insets.top, insets2.top), Math.min(insets.right, insets2.right), Math.min(insets.bottom, insets2.bottom));
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static Insets of(int i, int i2, int i3, int i4) {
|
||||
return (i == 0 && i2 == 0 && i3 == 0 && i4 == 0) ? NONE : new Insets(i, i2, i3, i4);
|
||||
|
@ -30,6 +45,11 @@ public final class Insets {
|
|||
return of(rect.left, rect.top, rect.right, rect.bottom);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static Insets subtract(@NonNull Insets insets, @NonNull Insets insets2) {
|
||||
return of(insets.left - insets2.left, insets.top - insets2.top, insets.right - insets2.right, insets.bottom - insets2.bottom);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@RequiresApi(api = 29)
|
||||
public static Insets toCompatInsets(@NonNull android.graphics.Insets insets) {
|
||||
|
|
|
@ -37,8 +37,8 @@ public final class MatrixKt {
|
|||
}
|
||||
|
||||
public static final Matrix times(Matrix matrix, Matrix matrix2) {
|
||||
m.checkParameterIsNotNull(matrix, "$this$times");
|
||||
m.checkParameterIsNotNull(matrix2, "m");
|
||||
m.checkNotNullParameter(matrix, "<this>");
|
||||
m.checkNotNullParameter(matrix2, "m");
|
||||
Matrix matrix3 = new Matrix(matrix);
|
||||
matrix3.preConcat(matrix2);
|
||||
return matrix3;
|
||||
|
@ -61,7 +61,7 @@ public final class MatrixKt {
|
|||
}
|
||||
|
||||
public static final float[] values(Matrix matrix) {
|
||||
m.checkParameterIsNotNull(matrix, "$this$values");
|
||||
m.checkNotNullParameter(matrix, "<this>");
|
||||
float[] fArr = new float[9];
|
||||
matrix.getValues(fArr);
|
||||
return fArr;
|
||||
|
|
|
@ -5,7 +5,7 @@ import d0.z.d.m;
|
|||
/* compiled from: Paint.kt */
|
||||
public final class PaintKt {
|
||||
public static final boolean setBlendMode(Paint paint, BlendModeCompat blendModeCompat) {
|
||||
m.checkParameterIsNotNull(paint, "$this$setBlendMode");
|
||||
m.checkNotNullParameter(paint, "<this>");
|
||||
return PaintCompat.setBlendMode(paint, blendModeCompat);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,8 +8,8 @@ import java.util.Collection;
|
|||
public final class PathKt {
|
||||
@RequiresApi(19)
|
||||
public static final Path and(Path path, Path path2) {
|
||||
m.checkParameterIsNotNull(path, "$this$and");
|
||||
m.checkParameterIsNotNull(path2, "p");
|
||||
m.checkNotNullParameter(path, "<this>");
|
||||
m.checkNotNullParameter(path2, "p");
|
||||
Path path3 = new Path();
|
||||
path3.op(path, path2, Path.Op.INTERSECT);
|
||||
return path3;
|
||||
|
@ -17,9 +17,9 @@ public final class PathKt {
|
|||
|
||||
@RequiresApi(26)
|
||||
public static final Iterable<PathSegment> flatten(Path path, float f) {
|
||||
m.checkParameterIsNotNull(path, "$this$flatten");
|
||||
m.checkNotNullParameter(path, "<this>");
|
||||
Collection<PathSegment> flatten = PathUtils.flatten(path, f);
|
||||
m.checkExpressionValueIsNotNull(flatten, "PathUtils.flatten(this, error)");
|
||||
m.checkNotNullExpressionValue(flatten, "flatten(this, error)");
|
||||
return flatten;
|
||||
}
|
||||
|
||||
|
@ -32,8 +32,8 @@ public final class PathKt {
|
|||
|
||||
@RequiresApi(19)
|
||||
public static final Path minus(Path path, Path path2) {
|
||||
m.checkParameterIsNotNull(path, "$this$minus");
|
||||
m.checkParameterIsNotNull(path2, "p");
|
||||
m.checkNotNullParameter(path, "<this>");
|
||||
m.checkNotNullParameter(path2, "p");
|
||||
Path path3 = new Path(path);
|
||||
path3.op(path2, Path.Op.DIFFERENCE);
|
||||
return path3;
|
||||
|
@ -41,8 +41,8 @@ public final class PathKt {
|
|||
|
||||
@RequiresApi(19)
|
||||
public static final Path or(Path path, Path path2) {
|
||||
m.checkParameterIsNotNull(path, "$this$or");
|
||||
m.checkParameterIsNotNull(path2, "p");
|
||||
m.checkNotNullParameter(path, "<this>");
|
||||
m.checkNotNullParameter(path2, "p");
|
||||
Path path3 = new Path(path);
|
||||
path3.op(path2, Path.Op.UNION);
|
||||
return path3;
|
||||
|
@ -50,8 +50,8 @@ public final class PathKt {
|
|||
|
||||
@RequiresApi(19)
|
||||
public static final Path plus(Path path, Path path2) {
|
||||
m.checkParameterIsNotNull(path, "$this$plus");
|
||||
m.checkParameterIsNotNull(path2, "p");
|
||||
m.checkNotNullParameter(path, "<this>");
|
||||
m.checkNotNullParameter(path2, "p");
|
||||
Path path3 = new Path(path);
|
||||
path3.op(path2, Path.Op.UNION);
|
||||
return path3;
|
||||
|
@ -59,8 +59,8 @@ public final class PathKt {
|
|||
|
||||
@RequiresApi(19)
|
||||
public static final Path xor(Path path, Path path2) {
|
||||
m.checkParameterIsNotNull(path, "$this$xor");
|
||||
m.checkParameterIsNotNull(path2, "p");
|
||||
m.checkNotNullParameter(path, "<this>");
|
||||
m.checkNotNullParameter(path2, "p");
|
||||
Path path3 = new Path(path);
|
||||
path3.op(path2, Path.Op.XOR);
|
||||
return path3;
|
||||
|
|
|
@ -9,12 +9,12 @@ import kotlin.jvm.functions.Function1;
|
|||
/* compiled from: Picture.kt */
|
||||
public final class PictureKt {
|
||||
public static final Picture record(Picture picture, int i, int i2, Function1<? super Canvas, Unit> function1) {
|
||||
m.checkParameterIsNotNull(picture, "$this$record");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(picture, "<this>");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
Canvas beginRecording = picture.beginRecording(i, i2);
|
||||
m.checkNotNullExpressionValue(beginRecording, "beginRecording(width, height)");
|
||||
int i3 = 1;
|
||||
try {
|
||||
m.checkExpressionValueIsNotNull(beginRecording, "c");
|
||||
function1.invoke(beginRecording);
|
||||
return picture;
|
||||
} finally {
|
||||
|
|
|
@ -6,27 +6,27 @@ import d0.z.d.m;
|
|||
/* compiled from: Point.kt */
|
||||
public final class PointKt {
|
||||
public static final float component1(PointF pointF) {
|
||||
m.checkParameterIsNotNull(pointF, "$this$component1");
|
||||
m.checkNotNullParameter(pointF, "<this>");
|
||||
return pointF.x;
|
||||
}
|
||||
|
||||
public static final int component1(Point point) {
|
||||
m.checkParameterIsNotNull(point, "$this$component1");
|
||||
m.checkNotNullParameter(point, "<this>");
|
||||
return point.x;
|
||||
}
|
||||
|
||||
public static final float component2(PointF pointF) {
|
||||
m.checkParameterIsNotNull(pointF, "$this$component2");
|
||||
m.checkNotNullParameter(pointF, "<this>");
|
||||
return pointF.y;
|
||||
}
|
||||
|
||||
public static final int component2(Point point) {
|
||||
m.checkParameterIsNotNull(point, "$this$component2");
|
||||
m.checkNotNullParameter(point, "<this>");
|
||||
return point.y;
|
||||
}
|
||||
|
||||
public static final Point minus(Point point, int i) {
|
||||
m.checkParameterIsNotNull(point, "$this$minus");
|
||||
m.checkNotNullParameter(point, "<this>");
|
||||
Point point2 = new Point(point.x, point.y);
|
||||
int i2 = -i;
|
||||
point2.offset(i2, i2);
|
||||
|
@ -34,15 +34,15 @@ public final class PointKt {
|
|||
}
|
||||
|
||||
public static final Point minus(Point point, Point point2) {
|
||||
m.checkParameterIsNotNull(point, "$this$minus");
|
||||
m.checkParameterIsNotNull(point2, "p");
|
||||
m.checkNotNullParameter(point, "<this>");
|
||||
m.checkNotNullParameter(point2, "p");
|
||||
Point point3 = new Point(point.x, point.y);
|
||||
point3.offset(-point2.x, -point2.y);
|
||||
return point3;
|
||||
}
|
||||
|
||||
public static final PointF minus(PointF pointF, float f) {
|
||||
m.checkParameterIsNotNull(pointF, "$this$minus");
|
||||
m.checkNotNullParameter(pointF, "<this>");
|
||||
PointF pointF2 = new PointF(pointF.x, pointF.y);
|
||||
float f2 = -f;
|
||||
pointF2.offset(f2, f2);
|
||||
|
@ -50,60 +50,60 @@ public final class PointKt {
|
|||
}
|
||||
|
||||
public static final PointF minus(PointF pointF, PointF pointF2) {
|
||||
m.checkParameterIsNotNull(pointF, "$this$minus");
|
||||
m.checkParameterIsNotNull(pointF2, "p");
|
||||
m.checkNotNullParameter(pointF, "<this>");
|
||||
m.checkNotNullParameter(pointF2, "p");
|
||||
PointF pointF3 = new PointF(pointF.x, pointF.y);
|
||||
pointF3.offset(-pointF2.x, -pointF2.y);
|
||||
return pointF3;
|
||||
}
|
||||
|
||||
public static final Point plus(Point point, int i) {
|
||||
m.checkParameterIsNotNull(point, "$this$plus");
|
||||
m.checkNotNullParameter(point, "<this>");
|
||||
Point point2 = new Point(point.x, point.y);
|
||||
point2.offset(i, i);
|
||||
return point2;
|
||||
}
|
||||
|
||||
public static final Point plus(Point point, Point point2) {
|
||||
m.checkParameterIsNotNull(point, "$this$plus");
|
||||
m.checkParameterIsNotNull(point2, "p");
|
||||
m.checkNotNullParameter(point, "<this>");
|
||||
m.checkNotNullParameter(point2, "p");
|
||||
Point point3 = new Point(point.x, point.y);
|
||||
point3.offset(point2.x, point2.y);
|
||||
return point3;
|
||||
}
|
||||
|
||||
public static final PointF plus(PointF pointF, float f) {
|
||||
m.checkParameterIsNotNull(pointF, "$this$plus");
|
||||
m.checkNotNullParameter(pointF, "<this>");
|
||||
PointF pointF2 = new PointF(pointF.x, pointF.y);
|
||||
pointF2.offset(f, f);
|
||||
return pointF2;
|
||||
}
|
||||
|
||||
public static final PointF plus(PointF pointF, PointF pointF2) {
|
||||
m.checkParameterIsNotNull(pointF, "$this$plus");
|
||||
m.checkParameterIsNotNull(pointF2, "p");
|
||||
m.checkNotNullParameter(pointF, "<this>");
|
||||
m.checkNotNullParameter(pointF2, "p");
|
||||
PointF pointF3 = new PointF(pointF.x, pointF.y);
|
||||
pointF3.offset(pointF2.x, pointF2.y);
|
||||
return pointF3;
|
||||
}
|
||||
|
||||
public static final Point toPoint(PointF pointF) {
|
||||
m.checkParameterIsNotNull(pointF, "$this$toPoint");
|
||||
m.checkNotNullParameter(pointF, "<this>");
|
||||
return new Point((int) pointF.x, (int) pointF.y);
|
||||
}
|
||||
|
||||
public static final PointF toPointF(Point point) {
|
||||
m.checkParameterIsNotNull(point, "$this$toPointF");
|
||||
m.checkNotNullParameter(point, "<this>");
|
||||
return new PointF(point);
|
||||
}
|
||||
|
||||
public static final Point unaryMinus(Point point) {
|
||||
m.checkParameterIsNotNull(point, "$this$unaryMinus");
|
||||
m.checkNotNullParameter(point, "<this>");
|
||||
return new Point(-point.x, -point.y);
|
||||
}
|
||||
|
||||
public static final PointF unaryMinus(PointF pointF) {
|
||||
m.checkParameterIsNotNull(pointF, "$this$unaryMinus");
|
||||
m.checkNotNullParameter(pointF, "<this>");
|
||||
return new PointF(-pointF.x, -pointF.y);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,12 +7,12 @@ import d0.z.d.m;
|
|||
/* compiled from: PorterDuff.kt */
|
||||
public final class PorterDuffKt {
|
||||
public static final PorterDuffColorFilter toColorFilter(PorterDuff.Mode mode, int i) {
|
||||
m.checkParameterIsNotNull(mode, "$this$toColorFilter");
|
||||
m.checkNotNullParameter(mode, "<this>");
|
||||
return new PorterDuffColorFilter(i, mode);
|
||||
}
|
||||
|
||||
public static final PorterDuffXfermode toXfermode(PorterDuff.Mode mode) {
|
||||
m.checkParameterIsNotNull(mode, "$this$toXfermode");
|
||||
m.checkNotNullParameter(mode, "<this>");
|
||||
return new PorterDuffXfermode(mode);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@ import d0.z.d.m;
|
|||
public final class RectKt {
|
||||
@SuppressLint({"CheckResult"})
|
||||
public static final Rect and(Rect rect, Rect rect2) {
|
||||
m.checkParameterIsNotNull(rect, "$this$and");
|
||||
m.checkParameterIsNotNull(rect2, "r");
|
||||
m.checkNotNullParameter(rect, "<this>");
|
||||
m.checkNotNullParameter(rect2, "r");
|
||||
Rect rect3 = new Rect(rect);
|
||||
rect3.intersect(rect2);
|
||||
return rect3;
|
||||
|
@ -21,67 +21,67 @@ public final class RectKt {
|
|||
|
||||
@SuppressLint({"CheckResult"})
|
||||
public static final RectF and(RectF rectF, RectF rectF2) {
|
||||
m.checkParameterIsNotNull(rectF, "$this$and");
|
||||
m.checkParameterIsNotNull(rectF2, "r");
|
||||
m.checkNotNullParameter(rectF, "<this>");
|
||||
m.checkNotNullParameter(rectF2, "r");
|
||||
RectF rectF3 = new RectF(rectF);
|
||||
rectF3.intersect(rectF2);
|
||||
return rectF3;
|
||||
}
|
||||
|
||||
public static final float component1(RectF rectF) {
|
||||
m.checkParameterIsNotNull(rectF, "$this$component1");
|
||||
m.checkNotNullParameter(rectF, "<this>");
|
||||
return rectF.left;
|
||||
}
|
||||
|
||||
public static final int component1(Rect rect) {
|
||||
m.checkParameterIsNotNull(rect, "$this$component1");
|
||||
m.checkNotNullParameter(rect, "<this>");
|
||||
return rect.left;
|
||||
}
|
||||
|
||||
public static final float component2(RectF rectF) {
|
||||
m.checkParameterIsNotNull(rectF, "$this$component2");
|
||||
m.checkNotNullParameter(rectF, "<this>");
|
||||
return rectF.top;
|
||||
}
|
||||
|
||||
public static final int component2(Rect rect) {
|
||||
m.checkParameterIsNotNull(rect, "$this$component2");
|
||||
m.checkNotNullParameter(rect, "<this>");
|
||||
return rect.top;
|
||||
}
|
||||
|
||||
public static final float component3(RectF rectF) {
|
||||
m.checkParameterIsNotNull(rectF, "$this$component3");
|
||||
m.checkNotNullParameter(rectF, "<this>");
|
||||
return rectF.right;
|
||||
}
|
||||
|
||||
public static final int component3(Rect rect) {
|
||||
m.checkParameterIsNotNull(rect, "$this$component3");
|
||||
m.checkNotNullParameter(rect, "<this>");
|
||||
return rect.right;
|
||||
}
|
||||
|
||||
public static final float component4(RectF rectF) {
|
||||
m.checkParameterIsNotNull(rectF, "$this$component4");
|
||||
m.checkNotNullParameter(rectF, "<this>");
|
||||
return rectF.bottom;
|
||||
}
|
||||
|
||||
public static final int component4(Rect rect) {
|
||||
m.checkParameterIsNotNull(rect, "$this$component4");
|
||||
m.checkNotNullParameter(rect, "<this>");
|
||||
return rect.bottom;
|
||||
}
|
||||
|
||||
public static final boolean contains(Rect rect, Point point) {
|
||||
m.checkParameterIsNotNull(rect, "$this$contains");
|
||||
m.checkParameterIsNotNull(point, "p");
|
||||
m.checkNotNullParameter(rect, "<this>");
|
||||
m.checkNotNullParameter(point, "p");
|
||||
return rect.contains(point.x, point.y);
|
||||
}
|
||||
|
||||
public static final boolean contains(RectF rectF, PointF pointF) {
|
||||
m.checkParameterIsNotNull(rectF, "$this$contains");
|
||||
m.checkParameterIsNotNull(pointF, "p");
|
||||
m.checkNotNullParameter(rectF, "<this>");
|
||||
m.checkNotNullParameter(pointF, "p");
|
||||
return rectF.contains(pointF.x, pointF.y);
|
||||
}
|
||||
|
||||
public static final Rect minus(Rect rect, int i) {
|
||||
m.checkParameterIsNotNull(rect, "$this$minus");
|
||||
m.checkNotNullParameter(rect, "<this>");
|
||||
Rect rect2 = new Rect(rect);
|
||||
int i2 = -i;
|
||||
rect2.offset(i2, i2);
|
||||
|
@ -89,15 +89,15 @@ public final class RectKt {
|
|||
}
|
||||
|
||||
public static final Rect minus(Rect rect, Point point) {
|
||||
m.checkParameterIsNotNull(rect, "$this$minus");
|
||||
m.checkParameterIsNotNull(point, "xy");
|
||||
m.checkNotNullParameter(rect, "<this>");
|
||||
m.checkNotNullParameter(point, "xy");
|
||||
Rect rect2 = new Rect(rect);
|
||||
rect2.offset(-point.x, -point.y);
|
||||
return rect2;
|
||||
}
|
||||
|
||||
public static final RectF minus(RectF rectF, float f) {
|
||||
m.checkParameterIsNotNull(rectF, "$this$minus");
|
||||
m.checkNotNullParameter(rectF, "<this>");
|
||||
RectF rectF2 = new RectF(rectF);
|
||||
float f2 = -f;
|
||||
rectF2.offset(f2, f2);
|
||||
|
@ -105,24 +105,24 @@ public final class RectKt {
|
|||
}
|
||||
|
||||
public static final RectF minus(RectF rectF, PointF pointF) {
|
||||
m.checkParameterIsNotNull(rectF, "$this$minus");
|
||||
m.checkParameterIsNotNull(pointF, "xy");
|
||||
m.checkNotNullParameter(rectF, "<this>");
|
||||
m.checkNotNullParameter(pointF, "xy");
|
||||
RectF rectF2 = new RectF(rectF);
|
||||
rectF2.offset(-pointF.x, -pointF.y);
|
||||
return rectF2;
|
||||
}
|
||||
|
||||
public static final Region minus(Rect rect, Rect rect2) {
|
||||
m.checkParameterIsNotNull(rect, "$this$minus");
|
||||
m.checkParameterIsNotNull(rect2, "r");
|
||||
m.checkNotNullParameter(rect, "<this>");
|
||||
m.checkNotNullParameter(rect2, "r");
|
||||
Region region = new Region(rect);
|
||||
region.op(rect2, Region.Op.DIFFERENCE);
|
||||
return region;
|
||||
}
|
||||
|
||||
public static final Region minus(RectF rectF, RectF rectF2) {
|
||||
m.checkParameterIsNotNull(rectF, "$this$minus");
|
||||
m.checkParameterIsNotNull(rectF2, "r");
|
||||
m.checkNotNullParameter(rectF, "<this>");
|
||||
m.checkNotNullParameter(rectF2, "r");
|
||||
Rect rect = new Rect();
|
||||
rectF.roundOut(rect);
|
||||
Region region = new Region(rect);
|
||||
|
@ -133,69 +133,69 @@ public final class RectKt {
|
|||
}
|
||||
|
||||
public static final Rect or(Rect rect, Rect rect2) {
|
||||
m.checkParameterIsNotNull(rect, "$this$or");
|
||||
m.checkParameterIsNotNull(rect2, "r");
|
||||
m.checkNotNullParameter(rect, "<this>");
|
||||
m.checkNotNullParameter(rect2, "r");
|
||||
Rect rect3 = new Rect(rect);
|
||||
rect3.union(rect2);
|
||||
return rect3;
|
||||
}
|
||||
|
||||
public static final RectF or(RectF rectF, RectF rectF2) {
|
||||
m.checkParameterIsNotNull(rectF, "$this$or");
|
||||
m.checkParameterIsNotNull(rectF2, "r");
|
||||
m.checkNotNullParameter(rectF, "<this>");
|
||||
m.checkNotNullParameter(rectF2, "r");
|
||||
RectF rectF3 = new RectF(rectF);
|
||||
rectF3.union(rectF2);
|
||||
return rectF3;
|
||||
}
|
||||
|
||||
public static final Rect plus(Rect rect, int i) {
|
||||
m.checkParameterIsNotNull(rect, "$this$plus");
|
||||
m.checkNotNullParameter(rect, "<this>");
|
||||
Rect rect2 = new Rect(rect);
|
||||
rect2.offset(i, i);
|
||||
return rect2;
|
||||
}
|
||||
|
||||
public static final Rect plus(Rect rect, Point point) {
|
||||
m.checkParameterIsNotNull(rect, "$this$plus");
|
||||
m.checkParameterIsNotNull(point, "xy");
|
||||
m.checkNotNullParameter(rect, "<this>");
|
||||
m.checkNotNullParameter(point, "xy");
|
||||
Rect rect2 = new Rect(rect);
|
||||
rect2.offset(point.x, point.y);
|
||||
return rect2;
|
||||
}
|
||||
|
||||
public static final Rect plus(Rect rect, Rect rect2) {
|
||||
m.checkParameterIsNotNull(rect, "$this$plus");
|
||||
m.checkParameterIsNotNull(rect2, "r");
|
||||
m.checkNotNullParameter(rect, "<this>");
|
||||
m.checkNotNullParameter(rect2, "r");
|
||||
Rect rect3 = new Rect(rect);
|
||||
rect3.union(rect2);
|
||||
return rect3;
|
||||
}
|
||||
|
||||
public static final RectF plus(RectF rectF, float f) {
|
||||
m.checkParameterIsNotNull(rectF, "$this$plus");
|
||||
m.checkNotNullParameter(rectF, "<this>");
|
||||
RectF rectF2 = new RectF(rectF);
|
||||
rectF2.offset(f, f);
|
||||
return rectF2;
|
||||
}
|
||||
|
||||
public static final RectF plus(RectF rectF, PointF pointF) {
|
||||
m.checkParameterIsNotNull(rectF, "$this$plus");
|
||||
m.checkParameterIsNotNull(pointF, "xy");
|
||||
m.checkNotNullParameter(rectF, "<this>");
|
||||
m.checkNotNullParameter(pointF, "xy");
|
||||
RectF rectF2 = new RectF(rectF);
|
||||
rectF2.offset(pointF.x, pointF.y);
|
||||
return rectF2;
|
||||
}
|
||||
|
||||
public static final RectF plus(RectF rectF, RectF rectF2) {
|
||||
m.checkParameterIsNotNull(rectF, "$this$plus");
|
||||
m.checkParameterIsNotNull(rectF2, "r");
|
||||
m.checkNotNullParameter(rectF, "<this>");
|
||||
m.checkNotNullParameter(rectF2, "r");
|
||||
RectF rectF3 = new RectF(rectF);
|
||||
rectF3.union(rectF2);
|
||||
return rectF3;
|
||||
}
|
||||
|
||||
public static final Rect times(Rect rect, int i) {
|
||||
m.checkParameterIsNotNull(rect, "$this$times");
|
||||
m.checkNotNullParameter(rect, "<this>");
|
||||
Rect rect2 = new Rect(rect);
|
||||
rect2.top *= i;
|
||||
rect2.left *= i;
|
||||
|
@ -205,7 +205,7 @@ public final class RectKt {
|
|||
}
|
||||
|
||||
public static final RectF times(RectF rectF, float f) {
|
||||
m.checkParameterIsNotNull(rectF, "$this$times");
|
||||
m.checkNotNullParameter(rectF, "<this>");
|
||||
RectF rectF2 = new RectF(rectF);
|
||||
rectF2.top *= f;
|
||||
rectF2.left *= f;
|
||||
|
@ -215,7 +215,7 @@ public final class RectKt {
|
|||
}
|
||||
|
||||
public static final RectF times(RectF rectF, int i) {
|
||||
m.checkParameterIsNotNull(rectF, "$this$times");
|
||||
m.checkNotNullParameter(rectF, "<this>");
|
||||
float f = (float) i;
|
||||
RectF rectF2 = new RectF(rectF);
|
||||
rectF2.top *= f;
|
||||
|
@ -226,47 +226,47 @@ public final class RectKt {
|
|||
}
|
||||
|
||||
public static final Rect toRect(RectF rectF) {
|
||||
m.checkParameterIsNotNull(rectF, "$this$toRect");
|
||||
m.checkNotNullParameter(rectF, "<this>");
|
||||
Rect rect = new Rect();
|
||||
rectF.roundOut(rect);
|
||||
return rect;
|
||||
}
|
||||
|
||||
public static final RectF toRectF(Rect rect) {
|
||||
m.checkParameterIsNotNull(rect, "$this$toRectF");
|
||||
m.checkNotNullParameter(rect, "<this>");
|
||||
return new RectF(rect);
|
||||
}
|
||||
|
||||
public static final Region toRegion(Rect rect) {
|
||||
m.checkParameterIsNotNull(rect, "$this$toRegion");
|
||||
m.checkNotNullParameter(rect, "<this>");
|
||||
return new Region(rect);
|
||||
}
|
||||
|
||||
public static final Region toRegion(RectF rectF) {
|
||||
m.checkParameterIsNotNull(rectF, "$this$toRegion");
|
||||
m.checkNotNullParameter(rectF, "<this>");
|
||||
Rect rect = new Rect();
|
||||
rectF.roundOut(rect);
|
||||
return new Region(rect);
|
||||
}
|
||||
|
||||
public static final RectF transform(RectF rectF, Matrix matrix) {
|
||||
m.checkParameterIsNotNull(rectF, "$this$transform");
|
||||
m.checkParameterIsNotNull(matrix, "m");
|
||||
m.checkNotNullParameter(rectF, "<this>");
|
||||
m.checkNotNullParameter(matrix, "m");
|
||||
matrix.mapRect(rectF);
|
||||
return rectF;
|
||||
}
|
||||
|
||||
public static final Region xor(Rect rect, Rect rect2) {
|
||||
m.checkParameterIsNotNull(rect, "$this$xor");
|
||||
m.checkParameterIsNotNull(rect2, "r");
|
||||
m.checkNotNullParameter(rect, "<this>");
|
||||
m.checkNotNullParameter(rect2, "r");
|
||||
Region region = new Region(rect);
|
||||
region.op(rect2, Region.Op.XOR);
|
||||
return region;
|
||||
}
|
||||
|
||||
public static final Region xor(RectF rectF, RectF rectF2) {
|
||||
m.checkParameterIsNotNull(rectF, "$this$xor");
|
||||
m.checkParameterIsNotNull(rectF2, "r");
|
||||
m.checkNotNullParameter(rectF, "<this>");
|
||||
m.checkNotNullParameter(rectF2, "r");
|
||||
Rect rect = new Rect();
|
||||
rectF.roundOut(rect);
|
||||
Region region = new Region(rect);
|
||||
|
|
|
@ -11,30 +11,30 @@ import kotlin.jvm.functions.Function1;
|
|||
/* compiled from: Region.kt */
|
||||
public final class RegionKt {
|
||||
public static final Region and(Region region, Rect rect) {
|
||||
m.checkParameterIsNotNull(region, "$this$and");
|
||||
m.checkParameterIsNotNull(rect, "r");
|
||||
m.checkNotNullParameter(region, "<this>");
|
||||
m.checkNotNullParameter(rect, "r");
|
||||
Region region2 = new Region(region);
|
||||
region2.op(rect, Region.Op.INTERSECT);
|
||||
return region2;
|
||||
}
|
||||
|
||||
public static final Region and(Region region, Region region2) {
|
||||
m.checkParameterIsNotNull(region, "$this$and");
|
||||
m.checkParameterIsNotNull(region2, "r");
|
||||
m.checkNotNullParameter(region, "<this>");
|
||||
m.checkNotNullParameter(region2, "r");
|
||||
Region region3 = new Region(region);
|
||||
region3.op(region2, Region.Op.INTERSECT);
|
||||
return region3;
|
||||
}
|
||||
|
||||
public static final boolean contains(Region region, Point point) {
|
||||
m.checkParameterIsNotNull(region, "$this$contains");
|
||||
m.checkParameterIsNotNull(point, "p");
|
||||
m.checkNotNullParameter(region, "<this>");
|
||||
m.checkNotNullParameter(point, "p");
|
||||
return region.contains(point.x, point.y);
|
||||
}
|
||||
|
||||
public static final void forEach(Region region, Function1<? super Rect, Unit> function1) {
|
||||
m.checkParameterIsNotNull(region, "$this$forEach");
|
||||
m.checkParameterIsNotNull(function1, "action");
|
||||
m.checkNotNullParameter(region, "<this>");
|
||||
m.checkNotNullParameter(function1, "action");
|
||||
RegionIterator regionIterator = new RegionIterator(region);
|
||||
while (true) {
|
||||
Rect rect = new Rect();
|
||||
|
@ -47,83 +47,83 @@ public final class RegionKt {
|
|||
}
|
||||
|
||||
public static final Iterator<Rect> iterator(Region region) {
|
||||
m.checkParameterIsNotNull(region, "$this$iterator");
|
||||
m.checkNotNullParameter(region, "<this>");
|
||||
return new RegionKt$iterator$1(region);
|
||||
}
|
||||
|
||||
public static final Region minus(Region region, Rect rect) {
|
||||
m.checkParameterIsNotNull(region, "$this$minus");
|
||||
m.checkParameterIsNotNull(rect, "r");
|
||||
m.checkNotNullParameter(region, "<this>");
|
||||
m.checkNotNullParameter(rect, "r");
|
||||
Region region2 = new Region(region);
|
||||
region2.op(rect, Region.Op.DIFFERENCE);
|
||||
return region2;
|
||||
}
|
||||
|
||||
public static final Region minus(Region region, Region region2) {
|
||||
m.checkParameterIsNotNull(region, "$this$minus");
|
||||
m.checkParameterIsNotNull(region2, "r");
|
||||
m.checkNotNullParameter(region, "<this>");
|
||||
m.checkNotNullParameter(region2, "r");
|
||||
Region region3 = new Region(region);
|
||||
region3.op(region2, Region.Op.DIFFERENCE);
|
||||
return region3;
|
||||
}
|
||||
|
||||
public static final Region not(Region region) {
|
||||
m.checkParameterIsNotNull(region, "$this$not");
|
||||
m.checkNotNullParameter(region, "<this>");
|
||||
Region region2 = new Region(region.getBounds());
|
||||
region2.op(region, Region.Op.DIFFERENCE);
|
||||
return region2;
|
||||
}
|
||||
|
||||
public static final Region or(Region region, Rect rect) {
|
||||
m.checkParameterIsNotNull(region, "$this$or");
|
||||
m.checkParameterIsNotNull(rect, "r");
|
||||
m.checkNotNullParameter(region, "<this>");
|
||||
m.checkNotNullParameter(rect, "r");
|
||||
Region region2 = new Region(region);
|
||||
region2.union(rect);
|
||||
return region2;
|
||||
}
|
||||
|
||||
public static final Region or(Region region, Region region2) {
|
||||
m.checkParameterIsNotNull(region, "$this$or");
|
||||
m.checkParameterIsNotNull(region2, "r");
|
||||
m.checkNotNullParameter(region, "<this>");
|
||||
m.checkNotNullParameter(region2, "r");
|
||||
Region region3 = new Region(region);
|
||||
region3.op(region2, Region.Op.UNION);
|
||||
return region3;
|
||||
}
|
||||
|
||||
public static final Region plus(Region region, Rect rect) {
|
||||
m.checkParameterIsNotNull(region, "$this$plus");
|
||||
m.checkParameterIsNotNull(rect, "r");
|
||||
m.checkNotNullParameter(region, "<this>");
|
||||
m.checkNotNullParameter(rect, "r");
|
||||
Region region2 = new Region(region);
|
||||
region2.union(rect);
|
||||
return region2;
|
||||
}
|
||||
|
||||
public static final Region plus(Region region, Region region2) {
|
||||
m.checkParameterIsNotNull(region, "$this$plus");
|
||||
m.checkParameterIsNotNull(region2, "r");
|
||||
m.checkNotNullParameter(region, "<this>");
|
||||
m.checkNotNullParameter(region2, "r");
|
||||
Region region3 = new Region(region);
|
||||
region3.op(region2, Region.Op.UNION);
|
||||
return region3;
|
||||
}
|
||||
|
||||
public static final Region unaryMinus(Region region) {
|
||||
m.checkParameterIsNotNull(region, "$this$unaryMinus");
|
||||
m.checkNotNullParameter(region, "<this>");
|
||||
Region region2 = new Region(region.getBounds());
|
||||
region2.op(region, Region.Op.DIFFERENCE);
|
||||
return region2;
|
||||
}
|
||||
|
||||
public static final Region xor(Region region, Rect rect) {
|
||||
m.checkParameterIsNotNull(region, "$this$xor");
|
||||
m.checkParameterIsNotNull(rect, "r");
|
||||
m.checkNotNullParameter(region, "<this>");
|
||||
m.checkNotNullParameter(rect, "r");
|
||||
Region region2 = new Region(region);
|
||||
region2.op(rect, Region.Op.XOR);
|
||||
return region2;
|
||||
}
|
||||
|
||||
public static final Region xor(Region region, Region region2) {
|
||||
m.checkParameterIsNotNull(region, "$this$xor");
|
||||
m.checkParameterIsNotNull(region2, "r");
|
||||
m.checkNotNullParameter(region, "<this>");
|
||||
m.checkNotNullParameter(region2, "r");
|
||||
Region region3 = new Region(region);
|
||||
region3.op(region2, Region.Op.XOR);
|
||||
return region3;
|
||||
|
|
|
@ -8,8 +8,8 @@ import kotlin.jvm.functions.Function1;
|
|||
/* compiled from: Shader.kt */
|
||||
public final class ShaderKt {
|
||||
public static final void transform(Shader shader, Function1<? super Matrix, Unit> function1) {
|
||||
m.checkParameterIsNotNull(shader, "$this$transform");
|
||||
m.checkParameterIsNotNull(function1, "block");
|
||||
m.checkNotNullParameter(shader, "<this>");
|
||||
m.checkNotNullParameter(function1, "block");
|
||||
Matrix matrix = new Matrix();
|
||||
shader.getLocalMatrix(matrix);
|
||||
function1.invoke(matrix);
|
||||
|
|
|
@ -10,6 +10,7 @@ import android.os.Handler;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RestrictTo;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.collection.LruCache;
|
||||
import androidx.core.content.res.FontResourcesParserCompat;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
|
@ -19,6 +20,32 @@ public class TypefaceCompat {
|
|||
private static final LruCache<String, Typeface> sTypefaceCache = new LruCache<>(16);
|
||||
private static final TypefaceCompatBaseImpl sTypefaceCompatImpl;
|
||||
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
||||
public static class ResourcesCallbackAdapter extends FontsContractCompat.FontRequestCallback {
|
||||
@Nullable
|
||||
private ResourcesCompat.FontCallback mFontCallback;
|
||||
|
||||
public ResourcesCallbackAdapter(@Nullable ResourcesCompat.FontCallback fontCallback) {
|
||||
this.mFontCallback = fontCallback;
|
||||
}
|
||||
|
||||
@Override // androidx.core.provider.FontsContractCompat.FontRequestCallback
|
||||
public void onTypefaceRequestFailed(int i) {
|
||||
ResourcesCompat.FontCallback fontCallback = this.mFontCallback;
|
||||
if (fontCallback != null) {
|
||||
fontCallback.onFontRetrievalFailed(i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.provider.FontsContractCompat.FontRequestCallback
|
||||
public void onTypefaceRetrieved(@NonNull Typeface typeface) {
|
||||
ResourcesCompat.FontCallback fontCallback = this.mFontCallback;
|
||||
if (fontCallback != null) {
|
||||
fontCallback.onFontRetrieved(typeface);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i >= 29) {
|
||||
|
@ -37,6 +64,12 @@ public class TypefaceCompat {
|
|||
private TypefaceCompat() {
|
||||
}
|
||||
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
||||
@VisibleForTesting
|
||||
public static void clearCache() {
|
||||
sTypefaceCache.evictAll();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static Typeface create(@NonNull Context context, @Nullable Typeface typeface, int i) {
|
||||
if (context != null) {
|
||||
|
@ -57,11 +90,14 @@ public class TypefaceCompat {
|
|||
Typeface typeface;
|
||||
if (familyResourceEntry instanceof FontResourcesParserCompat.ProviderResourceEntry) {
|
||||
FontResourcesParserCompat.ProviderResourceEntry providerResourceEntry = (FontResourcesParserCompat.ProviderResourceEntry) familyResourceEntry;
|
||||
boolean z3 = false;
|
||||
if (!z2 ? fontCallback == null : providerResourceEntry.getFetchStrategy() == 0) {
|
||||
z3 = true;
|
||||
Typeface systemFontFamily = getSystemFontFamily(providerResourceEntry.getSystemFontFamilyName());
|
||||
if (systemFontFamily != null) {
|
||||
if (fontCallback != null) {
|
||||
fontCallback.callbackSuccessAsync(systemFontFamily, handler);
|
||||
}
|
||||
return systemFontFamily;
|
||||
}
|
||||
typeface = FontsContractCompat.getFontSync(context, providerResourceEntry.getRequest(), fontCallback, handler, z3, z2 ? providerResourceEntry.getTimeout() : -1, i2);
|
||||
typeface = FontsContractCompat.requestFont(context, providerResourceEntry.getRequest(), i2, !z2 ? fontCallback == null : providerResourceEntry.getFetchStrategy() == 0, z2 ? providerResourceEntry.getTimeout() : -1, ResourcesCompat.FontCallback.getHandler(handler), new ResourcesCallbackAdapter(fontCallback));
|
||||
} else {
|
||||
typeface = sTypefaceCompatImpl.createFromFontFamilyFilesResourceEntry(context, (FontResourcesParserCompat.FontFamilyFilesResourceEntry) familyResourceEntry, resources, i2);
|
||||
if (fontCallback != null) {
|
||||
|
@ -107,4 +143,16 @@ public class TypefaceCompat {
|
|||
}
|
||||
return typefaceCompatBaseImpl.createFromFontFamilyFilesResourceEntry(context, fontFamily, context.getResources(), i);
|
||||
}
|
||||
|
||||
private static Typeface getSystemFontFamily(@Nullable String str) {
|
||||
if (str == null || str.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
Typeface create = Typeface.create(str, 0);
|
||||
Typeface create2 = Typeface.create(Typeface.DEFAULT, 0);
|
||||
if (create == null || create.equals(create2)) {
|
||||
return null;
|
||||
}
|
||||
return create;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -188,14 +188,14 @@ public class TypefaceCompatApi26Impl extends TypefaceCompatApi21Impl {
|
|||
return null;
|
||||
}
|
||||
} else {
|
||||
Map<Uri, ByteBuffer> prepareFontData = FontsContractCompat.prepareFontData(context, fontInfoArr, cancellationSignal);
|
||||
Map<Uri, ByteBuffer> readFontInfoIntoByteBuffer = TypefaceCompatUtil.readFontInfoIntoByteBuffer(context, fontInfoArr, cancellationSignal);
|
||||
Object newFamily = newFamily();
|
||||
if (newFamily == null) {
|
||||
return null;
|
||||
}
|
||||
boolean z2 = false;
|
||||
for (FontsContractCompat.FontInfo fontInfo : fontInfoArr) {
|
||||
ByteBuffer byteBuffer = prepareFontData.get(fontInfo.getUri());
|
||||
ByteBuffer byteBuffer = readFontInfoIntoByteBuffer.get(fontInfo.getUri());
|
||||
if (byteBuffer != null) {
|
||||
if (!addFontFromBuffer(newFamily, byteBuffer, fontInfo.getTtcIndex(), fontInfo.getWeight(), fontInfo.isItalic() ? 1 : 0)) {
|
||||
abortCreation(newFamily);
|
||||
|
|
|
@ -23,90 +23,98 @@ public class TypefaceCompatApi29Impl extends TypefaceCompatBaseImpl {
|
|||
@Override // androidx.core.graphics.TypefaceCompatBaseImpl
|
||||
@Nullable
|
||||
public Typeface createFromFontFamilyFilesResourceEntry(Context context, FontResourcesParserCompat.FontFamilyFilesResourceEntry fontFamilyFilesResourceEntry, Resources resources, int i) {
|
||||
FontResourcesParserCompat.FontFileResourceEntry[] entries = fontFamilyFilesResourceEntry.getEntries();
|
||||
int length = entries.length;
|
||||
int i2 = 0;
|
||||
FontFamily.Builder builder = null;
|
||||
int i3 = 0;
|
||||
while (true) {
|
||||
int i4 = 1;
|
||||
if (i3 >= length) {
|
||||
break;
|
||||
}
|
||||
FontResourcesParserCompat.FontFileResourceEntry fontFileResourceEntry = entries[i3];
|
||||
try {
|
||||
Font.Builder weight = new Font.Builder(resources, fontFileResourceEntry.getResourceId()).setWeight(fontFileResourceEntry.getWeight());
|
||||
if (!fontFileResourceEntry.isItalic()) {
|
||||
i4 = 0;
|
||||
try {
|
||||
FontResourcesParserCompat.FontFileResourceEntry[] entries = fontFamilyFilesResourceEntry.getEntries();
|
||||
int length = entries.length;
|
||||
int i2 = 0;
|
||||
FontFamily.Builder builder = null;
|
||||
int i3 = 0;
|
||||
while (true) {
|
||||
int i4 = 1;
|
||||
if (i3 >= length) {
|
||||
break;
|
||||
}
|
||||
Font build = weight.setSlant(i4).setTtcIndex(fontFileResourceEntry.getTtcIndex()).setFontVariationSettings(fontFileResourceEntry.getVariationSettings()).build();
|
||||
if (builder == null) {
|
||||
builder = new FontFamily.Builder(build);
|
||||
} else {
|
||||
builder.addFont(build);
|
||||
FontResourcesParserCompat.FontFileResourceEntry fontFileResourceEntry = entries[i3];
|
||||
try {
|
||||
Font.Builder weight = new Font.Builder(resources, fontFileResourceEntry.getResourceId()).setWeight(fontFileResourceEntry.getWeight());
|
||||
if (!fontFileResourceEntry.isItalic()) {
|
||||
i4 = 0;
|
||||
}
|
||||
Font build = weight.setSlant(i4).setTtcIndex(fontFileResourceEntry.getTtcIndex()).setFontVariationSettings(fontFileResourceEntry.getVariationSettings()).build();
|
||||
if (builder == null) {
|
||||
builder = new FontFamily.Builder(build);
|
||||
} else {
|
||||
builder.addFont(build);
|
||||
}
|
||||
} catch (IOException unused) {
|
||||
}
|
||||
} catch (IOException unused) {
|
||||
i3++;
|
||||
}
|
||||
i3++;
|
||||
}
|
||||
if (builder == null) {
|
||||
if (builder == null) {
|
||||
return null;
|
||||
}
|
||||
int i5 = (i & 1) != 0 ? 700 : 400;
|
||||
if ((i & 2) != 0) {
|
||||
i2 = 1;
|
||||
}
|
||||
return new Typeface.CustomFallbackBuilder(builder.build()).setStyle(new FontStyle(i5, i2)).build();
|
||||
} catch (Exception unused2) {
|
||||
return null;
|
||||
}
|
||||
int i5 = (i & 1) != 0 ? 700 : 400;
|
||||
if ((i & 2) != 0) {
|
||||
i2 = 1;
|
||||
}
|
||||
return new Typeface.CustomFallbackBuilder(builder.build()).setStyle(new FontStyle(i5, i2)).build();
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.TypefaceCompatBaseImpl
|
||||
@Nullable
|
||||
public Typeface createFromFontInfo(Context context, @Nullable CancellationSignal cancellationSignal, @NonNull FontsContractCompat.FontInfo[] fontInfoArr, int i) {
|
||||
ContentResolver contentResolver = context.getContentResolver();
|
||||
int length = fontInfoArr.length;
|
||||
int i2 = 0;
|
||||
FontFamily.Builder builder = null;
|
||||
int i3 = 0;
|
||||
while (true) {
|
||||
int i4 = 1;
|
||||
if (i3 >= length) {
|
||||
break;
|
||||
}
|
||||
FontsContractCompat.FontInfo fontInfo = fontInfoArr[i3];
|
||||
try {
|
||||
ParcelFileDescriptor openFileDescriptor = contentResolver.openFileDescriptor(fontInfo.getUri(), "r", cancellationSignal);
|
||||
if (openFileDescriptor != null) {
|
||||
try {
|
||||
Font.Builder weight = new Font.Builder(openFileDescriptor).setWeight(fontInfo.getWeight());
|
||||
if (!fontInfo.isItalic()) {
|
||||
i4 = 0;
|
||||
}
|
||||
Font build = weight.setSlant(i4).setTtcIndex(fontInfo.getTtcIndex()).build();
|
||||
if (builder == null) {
|
||||
builder = new FontFamily.Builder(build);
|
||||
} else {
|
||||
builder.addFont(build);
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
th.addSuppressed(th);
|
||||
}
|
||||
} else if (openFileDescriptor == null) {
|
||||
i3++;
|
||||
try {
|
||||
int length = fontInfoArr.length;
|
||||
int i2 = 0;
|
||||
FontFamily.Builder builder = null;
|
||||
int i3 = 0;
|
||||
while (true) {
|
||||
int i4 = 1;
|
||||
if (i3 >= length) {
|
||||
break;
|
||||
}
|
||||
openFileDescriptor.close();
|
||||
} catch (IOException unused) {
|
||||
FontsContractCompat.FontInfo fontInfo = fontInfoArr[i3];
|
||||
try {
|
||||
ParcelFileDescriptor openFileDescriptor = contentResolver.openFileDescriptor(fontInfo.getUri(), "r", cancellationSignal);
|
||||
if (openFileDescriptor != null) {
|
||||
try {
|
||||
Font.Builder weight = new Font.Builder(openFileDescriptor).setWeight(fontInfo.getWeight());
|
||||
if (!fontInfo.isItalic()) {
|
||||
i4 = 0;
|
||||
}
|
||||
Font build = weight.setSlant(i4).setTtcIndex(fontInfo.getTtcIndex()).build();
|
||||
if (builder == null) {
|
||||
builder = new FontFamily.Builder(build);
|
||||
} else {
|
||||
builder.addFont(build);
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
th.addSuppressed(th);
|
||||
}
|
||||
} else if (openFileDescriptor == null) {
|
||||
i3++;
|
||||
}
|
||||
openFileDescriptor.close();
|
||||
} catch (IOException unused) {
|
||||
}
|
||||
i3++;
|
||||
}
|
||||
i3++;
|
||||
}
|
||||
if (builder == null) {
|
||||
if (builder == null) {
|
||||
return null;
|
||||
}
|
||||
int i5 = (i & 1) != 0 ? 700 : 400;
|
||||
if ((i & 2) != 0) {
|
||||
i2 = 1;
|
||||
}
|
||||
return new Typeface.CustomFallbackBuilder(builder.build()).setStyle(new FontStyle(i5, i2)).build();
|
||||
throw th;
|
||||
} catch (Exception unused2) {
|
||||
return null;
|
||||
}
|
||||
int i5 = (i & 1) != 0 ? 700 : 400;
|
||||
if ((i & 2) != 0) {
|
||||
i2 = 1;
|
||||
}
|
||||
return new Typeface.CustomFallbackBuilder(builder.build()).setStyle(new FontStyle(i5, i2)).build();
|
||||
throw th;
|
||||
}
|
||||
|
||||
@Override // androidx.core.graphics.TypefaceCompatBaseImpl
|
||||
|
@ -120,7 +128,7 @@ public class TypefaceCompatApi29Impl extends TypefaceCompatBaseImpl {
|
|||
try {
|
||||
Font build = new Font.Builder(resources, i).build();
|
||||
return new Typeface.CustomFallbackBuilder(new FontFamily.Builder(build).build()).setStyle(build.getStyle()).build();
|
||||
} catch (IOException unused) {
|
||||
} catch (Exception unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package androidx.core.graphics;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Typeface;
|
||||
|
@ -19,6 +20,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
public class TypefaceCompatBaseImpl {
|
||||
private static final int INVALID_KEY = 0;
|
||||
private static final String TAG = "TypefaceCompatBaseImpl";
|
||||
@SuppressLint({"BanConcurrentHashMap"})
|
||||
private ConcurrentHashMap<Long, FontResourcesParserCompat.FontFamilyFilesResourceEntry> mFontFamilies = new ConcurrentHashMap<>();
|
||||
|
||||
/* renamed from: androidx.core.graphics.TypefaceCompatBaseImpl$1 reason: invalid class name */
|
||||
|
|
|
@ -8,9 +8,11 @@ import android.os.ParcelFileDescriptor;
|
|||
import android.os.Process;
|
||||
import android.os.StrictMode;
|
||||
import android.util.Log;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.annotation.RestrictTo;
|
||||
import androidx.core.provider.FontsContractCompat;
|
||||
import c.d.b.a.a;
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
|
@ -21,6 +23,9 @@ import java.io.InputStream;
|
|||
import java.nio.ByteBuffer;
|
||||
import java.nio.MappedByteBuffer;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
||||
public class TypefaceCompatUtil {
|
||||
private static final String CACHE_FILE_PREFIX = ".font";
|
||||
|
@ -202,4 +207,20 @@ public class TypefaceCompatUtil {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@RequiresApi(19)
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
||||
public static Map<Uri, ByteBuffer> readFontInfoIntoByteBuffer(@NonNull Context context, @NonNull FontsContractCompat.FontInfo[] fontInfoArr, @Nullable CancellationSignal cancellationSignal) {
|
||||
HashMap hashMap = new HashMap();
|
||||
for (FontsContractCompat.FontInfo fontInfo : fontInfoArr) {
|
||||
if (fontInfo.getResultCode() == 0) {
|
||||
Uri uri = fontInfo.getUri();
|
||||
if (!hashMap.containsKey(uri)) {
|
||||
hashMap.put(uri, mmap(context, cancellationSignal, uri));
|
||||
}
|
||||
}
|
||||
}
|
||||
return Collections.unmodifiableMap(hashMap);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@ import d0.z.d.m;
|
|||
/* compiled from: BitmapDrawable.kt */
|
||||
public final class BitmapDrawableKt {
|
||||
public static final BitmapDrawable toDrawable(Bitmap bitmap, Resources resources) {
|
||||
m.checkParameterIsNotNull(bitmap, "$this$toDrawable");
|
||||
m.checkParameterIsNotNull(resources, "resources");
|
||||
m.checkNotNullParameter(bitmap, "<this>");
|
||||
m.checkNotNullParameter(resources, "resources");
|
||||
return new BitmapDrawable(resources, bitmap);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ public final class ColorDrawableKt {
|
|||
|
||||
@RequiresApi(26)
|
||||
public static final ColorDrawable toDrawable(Color color) {
|
||||
m.checkParameterIsNotNull(color, "$this$toDrawable");
|
||||
m.checkNotNullParameter(color, "<this>");
|
||||
return new ColorDrawable(color.toArgb());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,40 +9,34 @@ import androidx.annotation.Px;
|
|||
import d0.z.d.m;
|
||||
/* compiled from: Drawable.kt */
|
||||
public final class DrawableKt {
|
||||
/* JADX WARNING: Code restructure failed: missing block: B:4:0x001b, code lost:
|
||||
if (r0.getConfig() == r9) goto L_0x001d;
|
||||
*/
|
||||
public static final Bitmap toBitmap(Drawable drawable, @Px int i, @Px int i2, Bitmap.Config config) {
|
||||
m.checkParameterIsNotNull(drawable, "$this$toBitmap");
|
||||
if (drawable instanceof BitmapDrawable) {
|
||||
if (config != null) {
|
||||
Bitmap bitmap = ((BitmapDrawable) drawable).getBitmap();
|
||||
m.checkExpressionValueIsNotNull(bitmap, "bitmap");
|
||||
m.checkNotNullParameter(drawable, "<this>");
|
||||
if (!(drawable instanceof BitmapDrawable) || !(config == null || ((BitmapDrawable) drawable).getBitmap().getConfig() == config)) {
|
||||
Rect bounds = drawable.getBounds();
|
||||
m.checkNotNullExpressionValue(bounds, "bounds");
|
||||
int i3 = bounds.left;
|
||||
int i4 = bounds.top;
|
||||
int i5 = bounds.right;
|
||||
int i6 = bounds.bottom;
|
||||
if (config == null) {
|
||||
config = Bitmap.Config.ARGB_8888;
|
||||
}
|
||||
BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
|
||||
if (i == bitmapDrawable.getIntrinsicWidth() && i2 == bitmapDrawable.getIntrinsicHeight()) {
|
||||
Bitmap bitmap2 = bitmapDrawable.getBitmap();
|
||||
m.checkExpressionValueIsNotNull(bitmap2, "bitmap");
|
||||
return bitmap2;
|
||||
}
|
||||
Bitmap createScaledBitmap = Bitmap.createScaledBitmap(bitmapDrawable.getBitmap(), i, i2, true);
|
||||
m.checkExpressionValueIsNotNull(createScaledBitmap, "Bitmap.createScaledBitma…map, width, height, true)");
|
||||
return createScaledBitmap;
|
||||
Bitmap createBitmap = Bitmap.createBitmap(i, i2, config);
|
||||
drawable.setBounds(0, 0, i, i2);
|
||||
drawable.draw(new Canvas(createBitmap));
|
||||
drawable.setBounds(i3, i4, i5, i6);
|
||||
m.checkNotNullExpressionValue(createBitmap, "bitmap");
|
||||
return createBitmap;
|
||||
}
|
||||
Rect bounds = drawable.getBounds();
|
||||
int i3 = bounds.left;
|
||||
int i4 = bounds.top;
|
||||
int i5 = bounds.right;
|
||||
int i6 = bounds.bottom;
|
||||
if (config == null) {
|
||||
config = Bitmap.Config.ARGB_8888;
|
||||
BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
|
||||
if (i == bitmapDrawable.getIntrinsicWidth() && i2 == bitmapDrawable.getIntrinsicHeight()) {
|
||||
Bitmap bitmap = bitmapDrawable.getBitmap();
|
||||
m.checkNotNullExpressionValue(bitmap, "bitmap");
|
||||
return bitmap;
|
||||
}
|
||||
Bitmap createBitmap = Bitmap.createBitmap(i, i2, config);
|
||||
drawable.setBounds(0, 0, i, i2);
|
||||
drawable.draw(new Canvas(createBitmap));
|
||||
drawable.setBounds(i3, i4, i5, i6);
|
||||
m.checkExpressionValueIsNotNull(createBitmap, "bitmap");
|
||||
return createBitmap;
|
||||
Bitmap createScaledBitmap = Bitmap.createScaledBitmap(bitmapDrawable.getBitmap(), i, i2, true);
|
||||
m.checkNotNullExpressionValue(createScaledBitmap, "createScaledBitmap(bitmap, width, height, true)");
|
||||
return createScaledBitmap;
|
||||
}
|
||||
|
||||
public static /* synthetic */ Bitmap toBitmap$default(Drawable drawable, int i, int i2, Bitmap.Config config, int i3, Object obj) {
|
||||
|
@ -59,7 +53,7 @@ public final class DrawableKt {
|
|||
}
|
||||
|
||||
public static final void updateBounds(Drawable drawable, @Px int i, @Px int i2, @Px int i3, @Px int i4) {
|
||||
m.checkParameterIsNotNull(drawable, "$this$updateBounds");
|
||||
m.checkNotNullParameter(drawable, "<this>");
|
||||
drawable.setBounds(i, i2, i3, i4);
|
||||
}
|
||||
|
||||
|
|
|
@ -56,12 +56,20 @@ public class IconCompat extends CustomVersionedParcelable {
|
|||
private static final float BLUR_FACTOR = 0.010416667f;
|
||||
public static final PorterDuff.Mode DEFAULT_TINT_MODE = PorterDuff.Mode.SRC_IN;
|
||||
private static final float DEFAULT_VIEW_PORT_SCALE = 0.6666667f;
|
||||
private static final String EXTRA_INT1 = "int1";
|
||||
private static final String EXTRA_INT2 = "int2";
|
||||
private static final String EXTRA_OBJ = "obj";
|
||||
private static final String EXTRA_TINT_LIST = "tint_list";
|
||||
private static final String EXTRA_TINT_MODE = "tint_mode";
|
||||
private static final String EXTRA_TYPE = "type";
|
||||
@VisibleForTesting
|
||||
public static final String EXTRA_INT1 = "int1";
|
||||
@VisibleForTesting
|
||||
public static final String EXTRA_INT2 = "int2";
|
||||
@VisibleForTesting
|
||||
public static final String EXTRA_OBJ = "obj";
|
||||
@VisibleForTesting
|
||||
public static final String EXTRA_STRING1 = "string1";
|
||||
@VisibleForTesting
|
||||
public static final String EXTRA_TINT_LIST = "tint_list";
|
||||
@VisibleForTesting
|
||||
public static final String EXTRA_TINT_MODE = "tint_mode";
|
||||
@VisibleForTesting
|
||||
public static final String EXTRA_TYPE = "type";
|
||||
private static final float ICON_DIAMETER_FACTOR = 0.9166667f;
|
||||
private static final int KEY_SHADOW_ALPHA = 61;
|
||||
private static final float KEY_SHADOW_OFFSET_FACTOR = 0.020833334f;
|
||||
|
@ -83,6 +91,8 @@ public class IconCompat extends CustomVersionedParcelable {
|
|||
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
||||
public Parcelable mParcelable = null;
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
||||
public String mString1;
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
||||
public ColorStateList mTintList = null;
|
||||
public PorterDuff.Mode mTintMode = DEFAULT_TINT_MODE;
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
||||
|
@ -109,6 +119,7 @@ public class IconCompat extends CustomVersionedParcelable {
|
|||
IconCompat iconCompat = new IconCompat(i);
|
||||
iconCompat.mInt1 = bundle.getInt(EXTRA_INT1);
|
||||
iconCompat.mInt2 = bundle.getInt(EXTRA_INT2);
|
||||
iconCompat.mString1 = bundle.getString(EXTRA_STRING1);
|
||||
if (bundle.containsKey(EXTRA_TINT_LIST)) {
|
||||
iconCompat.mTintList = (ColorStateList) bundle.getParcelable(EXTRA_TINT_LIST);
|
||||
}
|
||||
|
@ -307,6 +318,7 @@ public class IconCompat extends CustomVersionedParcelable {
|
|||
} else {
|
||||
iconCompat.mObj1 = str;
|
||||
}
|
||||
iconCompat.mString1 = str;
|
||||
return iconCompat;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Drawable resource ID must not be 0");
|
||||
|
@ -410,26 +422,6 @@ public class IconCompat extends CustomVersionedParcelable {
|
|||
}
|
||||
}
|
||||
|
||||
private InputStream getUriInputStream(Context context) {
|
||||
Uri uri = getUri();
|
||||
String scheme = uri.getScheme();
|
||||
if ("content".equals(scheme) || "file".equals(scheme)) {
|
||||
try {
|
||||
return context.getContentResolver().openInputStream(uri);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Unable to load image from URI: " + uri, e);
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
return new FileInputStream(new File((String) this.mObj1));
|
||||
} catch (FileNotFoundException e2) {
|
||||
Log.w(TAG, "Unable to load image from path: " + uri, e2);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Drawable loadDrawableInner(Context context) {
|
||||
switch (this.mType) {
|
||||
case 1:
|
||||
|
@ -534,16 +526,22 @@ public class IconCompat extends CustomVersionedParcelable {
|
|||
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
||||
public void checkResource(@NonNull Context context) {
|
||||
if (this.mType == 2) {
|
||||
String str = (String) this.mObj1;
|
||||
Object obj;
|
||||
if (this.mType == 2 && (obj = this.mObj1) != null) {
|
||||
String str = (String) obj;
|
||||
if (str.contains(":")) {
|
||||
String str2 = str.split(":", -1)[1];
|
||||
String str3 = str2.split(AutocompleteViewModel.COMMAND_DISCOVER_TOKEN, -1)[0];
|
||||
String str4 = str2.split(AutocompleteViewModel.COMMAND_DISCOVER_TOKEN, -1)[1];
|
||||
String str5 = str.split(":", -1)[0];
|
||||
int identifier = getResources(context, str5).getIdentifier(str4, str3, str5);
|
||||
if ("0_resource_name_obfuscated".equals(str4)) {
|
||||
Log.i(TAG, "Found obfuscated resource, not trying to update resource id for it");
|
||||
return;
|
||||
}
|
||||
String resPackage = getResPackage();
|
||||
int identifier = getResources(context, resPackage).getIdentifier(str4, str3, str5);
|
||||
if (this.mInt1 != identifier) {
|
||||
Log.i(TAG, "Id has changed for " + str5 + AutocompleteViewModel.COMMAND_DISCOVER_TOKEN + str4);
|
||||
Log.i(TAG, "Id has changed for " + resPackage + " " + str);
|
||||
this.mInt1 = identifier;
|
||||
}
|
||||
}
|
||||
|
@ -589,7 +587,7 @@ public class IconCompat extends CustomVersionedParcelable {
|
|||
return getResPackage((Icon) this.mObj1);
|
||||
}
|
||||
if (i == 2) {
|
||||
return ((String) this.mObj1).split(":", -1)[0];
|
||||
return TextUtils.isEmpty(this.mString1) ? ((String) this.mObj1).split(":", -1)[0] : this.mString1;
|
||||
}
|
||||
throw new IllegalStateException("called getResPackage() on " + this);
|
||||
}
|
||||
|
@ -611,6 +609,28 @@ public class IconCompat extends CustomVersionedParcelable {
|
|||
throw new IllegalStateException("called getUri() on " + this);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
|
||||
public InputStream getUriInputStream(@NonNull Context context) {
|
||||
Uri uri = getUri();
|
||||
String scheme = uri.getScheme();
|
||||
if ("content".equals(scheme) || "file".equals(scheme)) {
|
||||
try {
|
||||
return context.getContentResolver().openInputStream(uri);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Unable to load image from URI: " + uri, e);
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
return new FileInputStream(new File((String) this.mObj1));
|
||||
} catch (FileNotFoundException e2) {
|
||||
Log.w(TAG, "Unable to load image from path: " + uri, e2);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Drawable loadDrawable(@NonNull Context context) {
|
||||
checkResource(context);
|
||||
|
@ -656,7 +676,12 @@ public class IconCompat extends CustomVersionedParcelable {
|
|||
case 2:
|
||||
case 4:
|
||||
case 6:
|
||||
this.mObj1 = new String(this.mData, Charset.forName("UTF-16"));
|
||||
String str = new String(this.mData, Charset.forName("UTF-16"));
|
||||
this.mObj1 = str;
|
||||
if (this.mType == 2 && this.mString1 == null) {
|
||||
this.mString1 = str.split(":", -1)[0];
|
||||
return;
|
||||
}
|
||||
return;
|
||||
case 3:
|
||||
this.mObj1 = this.mData;
|
||||
|
@ -714,6 +739,7 @@ public class IconCompat extends CustomVersionedParcelable {
|
|||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Bundle toBundle() {
|
||||
Bundle bundle = new Bundle();
|
||||
switch (this.mType) {
|
||||
|
@ -739,6 +765,7 @@ public class IconCompat extends CustomVersionedParcelable {
|
|||
bundle.putInt("type", this.mType);
|
||||
bundle.putInt(EXTRA_INT1, this.mInt1);
|
||||
bundle.putInt(EXTRA_INT2, this.mInt2);
|
||||
bundle.putString(EXTRA_STRING1, this.mString1);
|
||||
ColorStateList colorStateList = this.mTintList;
|
||||
if (colorStateList != null) {
|
||||
bundle.putParcelable(EXTRA_TINT_LIST, colorStateList);
|
||||
|
@ -788,10 +815,14 @@ public class IconCompat extends CustomVersionedParcelable {
|
|||
break;
|
||||
}
|
||||
case 6:
|
||||
if (context != null) {
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i >= 30) {
|
||||
icon = Icon.createWithAdaptiveBitmapContentUri(getUri());
|
||||
break;
|
||||
} else if (context != null) {
|
||||
InputStream uriInputStream = getUriInputStream(context);
|
||||
if (uriInputStream != null) {
|
||||
if (Build.VERSION.SDK_INT < 26) {
|
||||
if (i < 26) {
|
||||
icon = Icon.createWithBitmap(createLegacyIconFromAdaptiveIcon(BitmapFactory.decodeStream(uriInputStream), false));
|
||||
break;
|
||||
} else {
|
||||
|
@ -837,7 +868,7 @@ public class IconCompat extends CustomVersionedParcelable {
|
|||
break;
|
||||
case 2:
|
||||
sb.append(" pkg=");
|
||||
sb.append(getResPackage());
|
||||
sb.append(this.mString1);
|
||||
sb.append(" id=");
|
||||
sb.append(String.format("0x%08x", Integer.valueOf(getResId())));
|
||||
break;
|
||||
|
|
|
@ -15,6 +15,7 @@ public class IconCompatParcelizer {
|
|||
iconCompat.mInt2 = versionedParcel.readInt(iconCompat.mInt2, 5);
|
||||
iconCompat.mTintList = (ColorStateList) versionedParcel.readParcelable(iconCompat.mTintList, 6);
|
||||
iconCompat.mTintModeStr = versionedParcel.readString(iconCompat.mTintModeStr, 7);
|
||||
iconCompat.mString1 = versionedParcel.readString(iconCompat.mString1, 8);
|
||||
iconCompat.onPostParceling();
|
||||
return iconCompat;
|
||||
}
|
||||
|
@ -50,5 +51,9 @@ public class IconCompatParcelizer {
|
|||
if (str != null) {
|
||||
versionedParcel.writeString(str, 7);
|
||||
}
|
||||
String str2 = iconCompat.mString1;
|
||||
if (str2 != null) {
|
||||
versionedParcel.writeString(str2, 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,33 +9,33 @@ import d0.z.d.m;
|
|||
public final class IconKt {
|
||||
@RequiresApi(26)
|
||||
public static final Icon toAdaptiveIcon(Bitmap bitmap) {
|
||||
m.checkParameterIsNotNull(bitmap, "$this$toAdaptiveIcon");
|
||||
m.checkNotNullParameter(bitmap, "<this>");
|
||||
Icon createWithAdaptiveBitmap = Icon.createWithAdaptiveBitmap(bitmap);
|
||||
m.checkExpressionValueIsNotNull(createWithAdaptiveBitmap, "Icon.createWithAdaptiveBitmap(this)");
|
||||
m.checkNotNullExpressionValue(createWithAdaptiveBitmap, "createWithAdaptiveBitmap(this)");
|
||||
return createWithAdaptiveBitmap;
|
||||
}
|
||||
|
||||
@RequiresApi(26)
|
||||
public static final Icon toIcon(Bitmap bitmap) {
|
||||
m.checkParameterIsNotNull(bitmap, "$this$toIcon");
|
||||
m.checkNotNullParameter(bitmap, "<this>");
|
||||
Icon createWithBitmap = Icon.createWithBitmap(bitmap);
|
||||
m.checkExpressionValueIsNotNull(createWithBitmap, "Icon.createWithBitmap(this)");
|
||||
m.checkNotNullExpressionValue(createWithBitmap, "createWithBitmap(this)");
|
||||
return createWithBitmap;
|
||||
}
|
||||
|
||||
@RequiresApi(26)
|
||||
public static final Icon toIcon(Uri uri) {
|
||||
m.checkParameterIsNotNull(uri, "$this$toIcon");
|
||||
m.checkNotNullParameter(uri, "<this>");
|
||||
Icon createWithContentUri = Icon.createWithContentUri(uri);
|
||||
m.checkExpressionValueIsNotNull(createWithContentUri, "Icon.createWithContentUri(this)");
|
||||
m.checkNotNullExpressionValue(createWithContentUri, "createWithContentUri(this)");
|
||||
return createWithContentUri;
|
||||
}
|
||||
|
||||
@RequiresApi(26)
|
||||
public static final Icon toIcon(byte[] bArr) {
|
||||
m.checkParameterIsNotNull(bArr, "$this$toIcon");
|
||||
m.checkNotNullParameter(bArr, "<this>");
|
||||
Icon createWithData = Icon.createWithData(bArr, 0, bArr.length);
|
||||
m.checkExpressionValueIsNotNull(createWithData, "Icon.createWithData(this, 0, size)");
|
||||
m.checkNotNullExpressionValue(createWithData, "createWithData(this, 0, size)");
|
||||
return createWithData;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,6 +105,12 @@ public class WrappedDrawableApi14 extends Drawable implements Drawable.Callback,
|
|||
return this.mDrawable.getIntrinsicWidth();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
@RequiresApi(23)
|
||||
public int getLayoutDirection() {
|
||||
return DrawableCompat.getLayoutDirection(this.mDrawable);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public int getMinimumHeight() {
|
||||
return this.mDrawable.getMinimumHeight();
|
||||
|
@ -149,7 +155,7 @@ public class WrappedDrawableApi14 extends Drawable implements Drawable.Callback,
|
|||
@Override // android.graphics.drawable.Drawable
|
||||
@RequiresApi(19)
|
||||
public boolean isAutoMirrored() {
|
||||
return this.mDrawable.isAutoMirrored();
|
||||
return DrawableCompat.isAutoMirrored(this.mDrawable);
|
||||
}
|
||||
|
||||
public boolean isCompatTintEnabled() {
|
||||
|
@ -195,6 +201,12 @@ public class WrappedDrawableApi14 extends Drawable implements Drawable.Callback,
|
|||
}
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
@RequiresApi(23)
|
||||
public boolean onLayoutDirectionChanged(int i) {
|
||||
return DrawableCompat.setLayoutDirection(this.mDrawable, i);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public boolean onLevelChange(int i) {
|
||||
return this.mDrawable.setLevel(i);
|
||||
|
@ -213,7 +225,7 @@ public class WrappedDrawableApi14 extends Drawable implements Drawable.Callback,
|
|||
@Override // android.graphics.drawable.Drawable
|
||||
@RequiresApi(19)
|
||||
public void setAutoMirrored(boolean z2) {
|
||||
this.mDrawable.setAutoMirrored(z2);
|
||||
DrawableCompat.setAutoMirrored(this.mDrawable, z2);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
|
|
|
@ -59,6 +59,9 @@ public interface SupportMenuItem extends MenuItem {
|
|||
@Override // android.view.MenuItem
|
||||
MenuItem setAlphabeticShortcut(char c2, int i);
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
/* bridge */ /* synthetic */ MenuItem setContentDescription(CharSequence charSequence);
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
SupportMenuItem setContentDescription(CharSequence charSequence);
|
||||
|
||||
|
@ -82,6 +85,9 @@ public interface SupportMenuItem extends MenuItem {
|
|||
|
||||
SupportMenuItem setSupportActionProvider(ActionProvider actionProvider);
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
/* bridge */ /* synthetic */ MenuItem setTooltipText(CharSequence charSequence);
|
||||
|
||||
@Override // android.view.MenuItem
|
||||
SupportMenuItem setTooltipText(CharSequence charSequence);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
package androidx.core.location;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.location.GnssStatus;
|
||||
import android.location.GpsStatus;
|
||||
import androidx.annotation.FloatRange;
|
||||
import androidx.annotation.IntRange;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.annotation.RestrictTo;
|
||||
import com.google.android.material.shadow.ShadowDrawableWrapper;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
public abstract class GnssStatusCompat {
|
||||
@SuppressLint({"InlinedApi"})
|
||||
public static final int CONSTELLATION_BEIDOU = 5;
|
||||
@SuppressLint({"InlinedApi"})
|
||||
public static final int CONSTELLATION_GALILEO = 6;
|
||||
@SuppressLint({"InlinedApi"})
|
||||
public static final int CONSTELLATION_GLONASS = 3;
|
||||
@SuppressLint({"InlinedApi"})
|
||||
public static final int CONSTELLATION_GPS = 1;
|
||||
@SuppressLint({"InlinedApi"})
|
||||
public static final int CONSTELLATION_IRNSS = 7;
|
||||
@SuppressLint({"InlinedApi"})
|
||||
public static final int CONSTELLATION_QZSS = 4;
|
||||
@SuppressLint({"InlinedApi"})
|
||||
public static final int CONSTELLATION_SBAS = 2;
|
||||
@SuppressLint({"InlinedApi"})
|
||||
public static final int CONSTELLATION_UNKNOWN = 0;
|
||||
|
||||
public static abstract class Callback {
|
||||
public void onFirstFix(@IntRange(from = 0) int i) {
|
||||
}
|
||||
|
||||
public void onSatelliteStatusChanged(@NonNull GnssStatusCompat gnssStatusCompat) {
|
||||
}
|
||||
|
||||
public void onStarted() {
|
||||
}
|
||||
|
||||
public void onStopped() {
|
||||
}
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
||||
public @interface ConstellationType {
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@RequiresApi(24)
|
||||
public static GnssStatusCompat wrap(@NonNull GnssStatus gnssStatus) {
|
||||
return new GnssStatusWrapper(gnssStatus);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@SuppressLint({"ReferencesDeprecated"})
|
||||
public static GnssStatusCompat wrap(@NonNull GpsStatus gpsStatus) {
|
||||
return new GpsStatusWrapper(gpsStatus);
|
||||
}
|
||||
|
||||
@FloatRange(from = ShadowDrawableWrapper.COS_45, to = 360.0d)
|
||||
public abstract float getAzimuthDegrees(@IntRange(from = 0) int i);
|
||||
|
||||
@FloatRange(from = ShadowDrawableWrapper.COS_45, to = 63.0d)
|
||||
public abstract float getBasebandCn0DbHz(@IntRange(from = 0) int i);
|
||||
|
||||
@FloatRange(from = ShadowDrawableWrapper.COS_45)
|
||||
public abstract float getCarrierFrequencyHz(@IntRange(from = 0) int i);
|
||||
|
||||
@FloatRange(from = ShadowDrawableWrapper.COS_45, to = 63.0d)
|
||||
public abstract float getCn0DbHz(@IntRange(from = 0) int i);
|
||||
|
||||
public abstract int getConstellationType(@IntRange(from = 0) int i);
|
||||
|
||||
@FloatRange(from = -90.0d, to = 90.0d)
|
||||
public abstract float getElevationDegrees(@IntRange(from = 0) int i);
|
||||
|
||||
@IntRange(from = 0)
|
||||
public abstract int getSatelliteCount();
|
||||
|
||||
@IntRange(from = 1, to = 200)
|
||||
public abstract int getSvid(@IntRange(from = 0) int i);
|
||||
|
||||
public abstract boolean hasAlmanacData(@IntRange(from = 0) int i);
|
||||
|
||||
public abstract boolean hasBasebandCn0DbHz(@IntRange(from = 0) int i);
|
||||
|
||||
public abstract boolean hasCarrierFrequencyHz(@IntRange(from = 0) int i);
|
||||
|
||||
public abstract boolean hasEphemerisData(@IntRange(from = 0) int i);
|
||||
|
||||
public abstract boolean usedInFix(@IntRange(from = 0) int i);
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
package androidx.core.location;
|
||||
|
||||
import android.location.GnssStatus;
|
||||
import android.os.Build;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.annotation.RestrictTo;
|
||||
import androidx.core.util.Preconditions;
|
||||
@RequiresApi(24)
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
||||
public class GnssStatusWrapper extends GnssStatusCompat {
|
||||
private final GnssStatus mWrapped;
|
||||
|
||||
public GnssStatusWrapper(GnssStatus gnssStatus) {
|
||||
this.mWrapped = (GnssStatus) Preconditions.checkNotNull(gnssStatus);
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof GnssStatusWrapper)) {
|
||||
return false;
|
||||
}
|
||||
return this.mWrapped.equals(((GnssStatusWrapper) obj).mWrapped);
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public float getAzimuthDegrees(int i) {
|
||||
return this.mWrapped.getAzimuthDegrees(i);
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public float getBasebandCn0DbHz(int i) {
|
||||
if (Build.VERSION.SDK_INT >= 30) {
|
||||
return this.mWrapped.getBasebandCn0DbHz(i);
|
||||
}
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public float getCarrierFrequencyHz(int i) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
return this.mWrapped.getCarrierFrequencyHz(i);
|
||||
}
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public float getCn0DbHz(int i) {
|
||||
return this.mWrapped.getCn0DbHz(i);
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public int getConstellationType(int i) {
|
||||
return this.mWrapped.getConstellationType(i);
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public float getElevationDegrees(int i) {
|
||||
return this.mWrapped.getElevationDegrees(i);
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public int getSatelliteCount() {
|
||||
return this.mWrapped.getSatelliteCount();
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public int getSvid(int i) {
|
||||
return this.mWrapped.getSvid(i);
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public boolean hasAlmanacData(int i) {
|
||||
return this.mWrapped.hasAlmanacData(i);
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public boolean hasBasebandCn0DbHz(int i) {
|
||||
if (Build.VERSION.SDK_INT >= 30) {
|
||||
return this.mWrapped.hasBasebandCn0DbHz(i);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public boolean hasCarrierFrequencyHz(int i) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
return this.mWrapped.hasCarrierFrequencyHz(i);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public boolean hasEphemerisData(int i) {
|
||||
return this.mWrapped.hasEphemerisData(i);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.mWrapped.hashCode();
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public boolean usedInFix(int i) {
|
||||
return this.mWrapped.usedInFix(i);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,177 @@
|
|||
package androidx.core.location;
|
||||
|
||||
import android.location.GpsSatellite;
|
||||
import android.location.GpsStatus;
|
||||
import android.os.Build;
|
||||
import androidx.annotation.GuardedBy;
|
||||
import androidx.annotation.RestrictTo;
|
||||
import androidx.core.util.Preconditions;
|
||||
import java.util.Iterator;
|
||||
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
||||
public class GpsStatusWrapper extends GnssStatusCompat {
|
||||
private static final int BEIDOU_PRN_COUNT = 35;
|
||||
private static final int BEIDOU_PRN_OFFSET = 200;
|
||||
private static final int GLONASS_PRN_COUNT = 24;
|
||||
private static final int GLONASS_PRN_OFFSET = 64;
|
||||
private static final int GPS_PRN_COUNT = 32;
|
||||
private static final int GPS_PRN_OFFSET = 0;
|
||||
private static final int QZSS_SVID_MAX = 200;
|
||||
private static final int QZSS_SVID_MIN = 193;
|
||||
private static final int SBAS_PRN_MAX = 64;
|
||||
private static final int SBAS_PRN_MIN = 33;
|
||||
private static final int SBAS_PRN_OFFSET = -87;
|
||||
@GuardedBy("mWrapped")
|
||||
private Iterator<GpsSatellite> mCachedIterator;
|
||||
@GuardedBy("mWrapped")
|
||||
private int mCachedIteratorPosition;
|
||||
@GuardedBy("mWrapped")
|
||||
private GpsSatellite mCachedSatellite;
|
||||
@GuardedBy("mWrapped")
|
||||
private int mCachedSatelliteCount = -1;
|
||||
private final GpsStatus mWrapped;
|
||||
|
||||
public GpsStatusWrapper(GpsStatus gpsStatus) {
|
||||
GpsStatus gpsStatus2 = (GpsStatus) Preconditions.checkNotNull(gpsStatus);
|
||||
this.mWrapped = gpsStatus2;
|
||||
this.mCachedIterator = gpsStatus2.getSatellites().iterator();
|
||||
this.mCachedIteratorPosition = -1;
|
||||
this.mCachedSatellite = null;
|
||||
}
|
||||
|
||||
private static int getConstellationFromPrn(int i) {
|
||||
if (i > 0 && i <= 32) {
|
||||
return 1;
|
||||
}
|
||||
if (i >= 33 && i <= 64) {
|
||||
return 2;
|
||||
}
|
||||
if (i > 64 && i <= 88) {
|
||||
return 3;
|
||||
}
|
||||
if (i <= 200 || i > 235) {
|
||||
return (i < QZSS_SVID_MIN || i > 200) ? 0 : 4;
|
||||
}
|
||||
return 5;
|
||||
}
|
||||
|
||||
private GpsSatellite getSatellite(int i) {
|
||||
GpsSatellite gpsSatellite;
|
||||
synchronized (this.mWrapped) {
|
||||
if (i < this.mCachedIteratorPosition) {
|
||||
this.mCachedIterator = this.mWrapped.getSatellites().iterator();
|
||||
this.mCachedIteratorPosition = -1;
|
||||
}
|
||||
while (true) {
|
||||
int i2 = this.mCachedIteratorPosition;
|
||||
if (i2 >= i) {
|
||||
break;
|
||||
}
|
||||
this.mCachedIteratorPosition = i2 + 1;
|
||||
if (!this.mCachedIterator.hasNext()) {
|
||||
this.mCachedSatellite = null;
|
||||
break;
|
||||
}
|
||||
this.mCachedSatellite = this.mCachedIterator.next();
|
||||
}
|
||||
gpsSatellite = this.mCachedSatellite;
|
||||
}
|
||||
return (GpsSatellite) Preconditions.checkNotNull(gpsSatellite);
|
||||
}
|
||||
|
||||
private static int getSvidFromPrn(int i) {
|
||||
int constellationFromPrn = getConstellationFromPrn(i);
|
||||
return constellationFromPrn != 2 ? constellationFromPrn != 3 ? constellationFromPrn != 5 ? i : i - 200 : i - 64 : i + 87;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof GpsStatusWrapper)) {
|
||||
return false;
|
||||
}
|
||||
return this.mWrapped.equals(((GpsStatusWrapper) obj).mWrapped);
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public float getAzimuthDegrees(int i) {
|
||||
return getSatellite(i).getAzimuth();
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public float getBasebandCn0DbHz(int i) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public float getCarrierFrequencyHz(int i) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public float getCn0DbHz(int i) {
|
||||
return getSatellite(i).getSnr();
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public int getConstellationType(int i) {
|
||||
if (Build.VERSION.SDK_INT < 24) {
|
||||
return 1;
|
||||
}
|
||||
return getConstellationFromPrn(getSatellite(i).getPrn());
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public float getElevationDegrees(int i) {
|
||||
return getSatellite(i).getElevation();
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public int getSatelliteCount() {
|
||||
int i;
|
||||
synchronized (this.mWrapped) {
|
||||
if (this.mCachedSatelliteCount == -1) {
|
||||
for (GpsSatellite gpsSatellite : this.mWrapped.getSatellites()) {
|
||||
this.mCachedSatelliteCount++;
|
||||
}
|
||||
this.mCachedSatelliteCount++;
|
||||
}
|
||||
i = this.mCachedSatelliteCount;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public int getSvid(int i) {
|
||||
return Build.VERSION.SDK_INT < 24 ? getSatellite(i).getPrn() : getSvidFromPrn(getSatellite(i).getPrn());
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public boolean hasAlmanacData(int i) {
|
||||
return getSatellite(i).hasAlmanac();
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public boolean hasBasebandCn0DbHz(int i) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public boolean hasCarrierFrequencyHz(int i) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public boolean hasEphemerisData(int i) {
|
||||
return getSatellite(i).hasEphemeris();
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.mWrapped.hashCode();
|
||||
}
|
||||
|
||||
@Override // androidx.core.location.GnssStatusCompat
|
||||
public boolean usedInFix(int i) {
|
||||
return getSatellite(i).usedInFix();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
package androidx.core.location;
|
||||
|
||||
import android.location.Location;
|
||||
import androidx.annotation.DoNotInline;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
public final class LocationCompat {
|
||||
private static final String EXTRA_IS_MOCK = "mockLocation";
|
||||
@Nullable
|
||||
private static Method sSetIsFromMockProviderMethod;
|
||||
|
||||
@RequiresApi(17)
|
||||
public static class Api17Impl {
|
||||
private Api17Impl() {
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static long getElapsedRealtimeNanos(Location location) {
|
||||
return location.getElapsedRealtimeNanos();
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(18)
|
||||
public static class Api18Impl {
|
||||
private Api18Impl() {
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static boolean isMock(Location location) {
|
||||
return location.isFromMockProvider();
|
||||
}
|
||||
}
|
||||
|
||||
private LocationCompat() {
|
||||
}
|
||||
|
||||
public static long getElapsedRealtimeMillis(@NonNull Location location) {
|
||||
return TimeUnit.NANOSECONDS.toMillis(Api17Impl.getElapsedRealtimeNanos(location));
|
||||
}
|
||||
|
||||
public static long getElapsedRealtimeNanos(@NonNull Location location) {
|
||||
return Api17Impl.getElapsedRealtimeNanos(location);
|
||||
}
|
||||
|
||||
private static Method getSetIsFromMockProviderMethod() throws NoSuchMethodException {
|
||||
if (sSetIsFromMockProviderMethod == null) {
|
||||
Method declaredMethod = Location.class.getDeclaredMethod("setIsFromMockProvider", Boolean.TYPE);
|
||||
sSetIsFromMockProviderMethod = declaredMethod;
|
||||
declaredMethod.setAccessible(true);
|
||||
}
|
||||
return sSetIsFromMockProviderMethod;
|
||||
}
|
||||
|
||||
public static boolean isMock(@NonNull Location location) {
|
||||
return Api18Impl.isMock(location);
|
||||
}
|
||||
|
||||
public static void setMock(@NonNull Location location, boolean z2) {
|
||||
try {
|
||||
getSetIsFromMockProviderMethod().invoke(location, Boolean.valueOf(z2));
|
||||
} catch (NoSuchMethodException e) {
|
||||
NoSuchMethodError noSuchMethodError = new NoSuchMethodError();
|
||||
noSuchMethodError.initCause(e);
|
||||
throw noSuchMethodError;
|
||||
} catch (IllegalAccessException e2) {
|
||||
IllegalAccessError illegalAccessError = new IllegalAccessError();
|
||||
illegalAccessError.initCause(e2);
|
||||
throw illegalAccessError;
|
||||
} catch (InvocationTargetException e3) {
|
||||
throw new RuntimeException(e3);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,12 +5,12 @@ import d0.z.d.m;
|
|||
/* compiled from: Location.kt */
|
||||
public final class LocationKt {
|
||||
public static final double component1(Location location) {
|
||||
m.checkParameterIsNotNull(location, "$this$component1");
|
||||
m.checkNotNullParameter(location, "<this>");
|
||||
return location.getLatitude();
|
||||
}
|
||||
|
||||
public static final double component2(Location location) {
|
||||
m.checkParameterIsNotNull(location, "$this$component2");
|
||||
m.checkNotNullParameter(location, "<this>");
|
||||
return location.getLongitude();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,740 @@
|
|||
package androidx.core.location;
|
||||
|
||||
import android.location.GnssStatus;
|
||||
import android.location.GpsStatus;
|
||||
import android.location.Location;
|
||||
import android.location.LocationListener;
|
||||
import android.location.LocationManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.SystemClock;
|
||||
import androidx.annotation.DoNotInline;
|
||||
import androidx.annotation.GuardedBy;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.annotation.RequiresPermission;
|
||||
import androidx.collection.SimpleArrayMap;
|
||||
import androidx.core.location.GnssStatusCompat;
|
||||
import androidx.core.os.CancellationSignal;
|
||||
import androidx.core.os.ExecutorCompat;
|
||||
import androidx.core.util.Consumer;
|
||||
import androidx.core.util.Preconditions;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.FutureTask;
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
public final class LocationManagerCompat {
|
||||
private static final long GET_CURRENT_LOCATION_TIMEOUT_MS = 30000;
|
||||
private static final long MAX_CURRENT_LOCATION_AGE_MS = 10000;
|
||||
private static final long PRE_N_LOOPER_TIMEOUT_S = 5;
|
||||
private static Field sContextField;
|
||||
@GuardedBy("sGnssStatusListeners")
|
||||
private static final SimpleArrayMap<Object, Object> sGnssStatusListeners = new SimpleArrayMap<>();
|
||||
|
||||
/* renamed from: androidx.core.location.LocationManagerCompat$1 reason: invalid class name */
|
||||
public class AnonymousClass1 implements Runnable {
|
||||
public final /* synthetic */ Consumer val$consumer;
|
||||
public final /* synthetic */ Location val$location;
|
||||
|
||||
public AnonymousClass1(Consumer consumer, Location location) {
|
||||
this.val$consumer = consumer;
|
||||
this.val$location = location;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
this.val$consumer.accept(this.val$location);
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.core.location.LocationManagerCompat$2 reason: invalid class name */
|
||||
public class AnonymousClass2 implements CancellationSignal.OnCancelListener {
|
||||
public final /* synthetic */ CancellableLocationListener val$listener;
|
||||
|
||||
public AnonymousClass2(CancellableLocationListener cancellableLocationListener) {
|
||||
this.val$listener = cancellableLocationListener;
|
||||
}
|
||||
|
||||
@Override // androidx.core.os.CancellationSignal.OnCancelListener
|
||||
@RequiresPermission(anyOf = {"android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"})
|
||||
public void onCancel() {
|
||||
this.val$listener.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.core.location.LocationManagerCompat$3 reason: invalid class name */
|
||||
public class AnonymousClass3 implements Callable<Boolean> {
|
||||
public final /* synthetic */ LocationManager val$locationManager;
|
||||
public final /* synthetic */ GpsStatusTransport val$myTransport;
|
||||
|
||||
public AnonymousClass3(LocationManager locationManager, GpsStatusTransport gpsStatusTransport) {
|
||||
this.val$locationManager = locationManager;
|
||||
this.val$myTransport = gpsStatusTransport;
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Callable
|
||||
@RequiresPermission("android.permission.ACCESS_FINE_LOCATION")
|
||||
public Boolean call() {
|
||||
return Boolean.valueOf(this.val$locationManager.addGpsStatusListener(this.val$myTransport));
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(28)
|
||||
public static class Api28Impl {
|
||||
private Api28Impl() {
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static String getGnssHardwareModelName(LocationManager locationManager) {
|
||||
return locationManager.getGnssHardwareModelName();
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static int getGnssYearOfHardware(LocationManager locationManager) {
|
||||
return locationManager.getGnssYearOfHardware();
|
||||
}
|
||||
|
||||
@DoNotInline
|
||||
public static boolean isLocationEnabled(LocationManager locationManager) {
|
||||
return locationManager.isLocationEnabled();
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(30)
|
||||
public static class Api30Impl {
|
||||
|
||||
/* renamed from: androidx.core.location.LocationManagerCompat$Api30Impl$1 reason: invalid class name */
|
||||
public class AnonymousClass1 implements java.util.function.Consumer<Location> {
|
||||
public final /* synthetic */ Consumer val$consumer;
|
||||
|
||||
public AnonymousClass1(Consumer consumer) {
|
||||
this.val$consumer = consumer;
|
||||
}
|
||||
|
||||
public void accept(Location location) {
|
||||
this.val$consumer.accept(location);
|
||||
}
|
||||
}
|
||||
|
||||
private Api30Impl() {
|
||||
}
|
||||
|
||||
@RequiresPermission(anyOf = {"android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"})
|
||||
@DoNotInline
|
||||
public static void getCurrentLocation(LocationManager locationManager, @NonNull String str, @Nullable CancellationSignal cancellationSignal, @NonNull Executor executor, @NonNull Consumer<Location> consumer) {
|
||||
locationManager.getCurrentLocation(str, cancellationSignal != null ? (android.os.CancellationSignal) cancellationSignal.getCancellationSignalObject() : null, executor, new AnonymousClass1(consumer));
|
||||
}
|
||||
}
|
||||
|
||||
public static final class CancellableLocationListener implements LocationListener {
|
||||
private Consumer<Location> mConsumer;
|
||||
private final Executor mExecutor;
|
||||
private final LocationManager mLocationManager;
|
||||
private final Handler mTimeoutHandler = new Handler(Looper.getMainLooper());
|
||||
@Nullable
|
||||
public Runnable mTimeoutRunnable;
|
||||
@GuardedBy("this")
|
||||
private boolean mTriggered;
|
||||
|
||||
/* renamed from: androidx.core.location.LocationManagerCompat$CancellableLocationListener$1 reason: invalid class name */
|
||||
public class AnonymousClass1 implements Runnable {
|
||||
public AnonymousClass1() {
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
@RequiresPermission(anyOf = {"android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"})
|
||||
public void run() {
|
||||
CancellableLocationListener cancellableLocationListener = CancellableLocationListener.this;
|
||||
cancellableLocationListener.mTimeoutRunnable = null;
|
||||
cancellableLocationListener.onLocationChanged(null);
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.core.location.LocationManagerCompat$CancellableLocationListener$2 reason: invalid class name */
|
||||
public class AnonymousClass2 implements Runnable {
|
||||
public final /* synthetic */ Consumer val$consumer;
|
||||
public final /* synthetic */ Location val$location;
|
||||
|
||||
public AnonymousClass2(Consumer consumer, Location location) {
|
||||
this.val$consumer = consumer;
|
||||
this.val$location = location;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
this.val$consumer.accept(this.val$location);
|
||||
}
|
||||
}
|
||||
|
||||
public CancellableLocationListener(LocationManager locationManager, Executor executor, Consumer<Location> consumer) {
|
||||
this.mLocationManager = locationManager;
|
||||
this.mExecutor = executor;
|
||||
this.mConsumer = consumer;
|
||||
}
|
||||
|
||||
@RequiresPermission(anyOf = {"android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"})
|
||||
private void cleanup() {
|
||||
this.mConsumer = null;
|
||||
this.mLocationManager.removeUpdates(this);
|
||||
Runnable runnable = this.mTimeoutRunnable;
|
||||
if (runnable != null) {
|
||||
this.mTimeoutHandler.removeCallbacks(runnable);
|
||||
this.mTimeoutRunnable = null;
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresPermission(anyOf = {"android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"})
|
||||
public void cancel() {
|
||||
synchronized (this) {
|
||||
if (!this.mTriggered) {
|
||||
this.mTriggered = true;
|
||||
cleanup();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.location.LocationListener
|
||||
@RequiresPermission(anyOf = {"android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"})
|
||||
public void onLocationChanged(@Nullable Location location) {
|
||||
synchronized (this) {
|
||||
if (!this.mTriggered) {
|
||||
this.mTriggered = true;
|
||||
this.mExecutor.execute(new AnonymousClass2(this.mConsumer, location));
|
||||
cleanup();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.location.LocationListener
|
||||
@RequiresPermission(anyOf = {"android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"})
|
||||
public void onProviderDisabled(@NonNull String str) {
|
||||
onLocationChanged(null);
|
||||
}
|
||||
|
||||
@Override // android.location.LocationListener
|
||||
public void onProviderEnabled(@NonNull String str) {
|
||||
}
|
||||
|
||||
@Override // android.location.LocationListener
|
||||
public void onStatusChanged(String str, int i, Bundle bundle) {
|
||||
}
|
||||
|
||||
public void startTimeout(long j) {
|
||||
synchronized (this) {
|
||||
if (!this.mTriggered) {
|
||||
AnonymousClass1 r0 = new AnonymousClass1();
|
||||
this.mTimeoutRunnable = r0;
|
||||
this.mTimeoutHandler.postDelayed(r0, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(30)
|
||||
public static class GnssStatusTransport extends GnssStatus.Callback {
|
||||
public final GnssStatusCompat.Callback mCallback;
|
||||
|
||||
public GnssStatusTransport(GnssStatusCompat.Callback callback) {
|
||||
Preconditions.checkArgument(callback != null, "invalid null callback");
|
||||
this.mCallback = callback;
|
||||
}
|
||||
|
||||
@Override // android.location.GnssStatus.Callback
|
||||
public void onFirstFix(int i) {
|
||||
this.mCallback.onFirstFix(i);
|
||||
}
|
||||
|
||||
@Override // android.location.GnssStatus.Callback
|
||||
public void onSatelliteStatusChanged(GnssStatus gnssStatus) {
|
||||
this.mCallback.onSatelliteStatusChanged(GnssStatusCompat.wrap(gnssStatus));
|
||||
}
|
||||
|
||||
@Override // android.location.GnssStatus.Callback
|
||||
public void onStarted() {
|
||||
this.mCallback.onStarted();
|
||||
}
|
||||
|
||||
@Override // android.location.GnssStatus.Callback
|
||||
public void onStopped() {
|
||||
this.mCallback.onStopped();
|
||||
}
|
||||
}
|
||||
|
||||
public static class GpsStatusTransport implements GpsStatus.Listener {
|
||||
public final GnssStatusCompat.Callback mCallback;
|
||||
@Nullable
|
||||
public volatile Executor mExecutor;
|
||||
private final LocationManager mLocationManager;
|
||||
|
||||
/* renamed from: androidx.core.location.LocationManagerCompat$GpsStatusTransport$1 reason: invalid class name */
|
||||
public class AnonymousClass1 implements Runnable {
|
||||
public final /* synthetic */ Executor val$executor;
|
||||
|
||||
public AnonymousClass1(Executor executor) {
|
||||
this.val$executor = executor;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (GpsStatusTransport.this.mExecutor == this.val$executor) {
|
||||
GpsStatusTransport.this.mCallback.onStarted();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.core.location.LocationManagerCompat$GpsStatusTransport$2 reason: invalid class name */
|
||||
public class AnonymousClass2 implements Runnable {
|
||||
public final /* synthetic */ Executor val$executor;
|
||||
|
||||
public AnonymousClass2(Executor executor) {
|
||||
this.val$executor = executor;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (GpsStatusTransport.this.mExecutor == this.val$executor) {
|
||||
GpsStatusTransport.this.mCallback.onStopped();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.core.location.LocationManagerCompat$GpsStatusTransport$3 reason: invalid class name */
|
||||
public class AnonymousClass3 implements Runnable {
|
||||
public final /* synthetic */ Executor val$executor;
|
||||
public final /* synthetic */ int val$ttff;
|
||||
|
||||
public AnonymousClass3(Executor executor, int i) {
|
||||
this.val$executor = executor;
|
||||
this.val$ttff = i;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (GpsStatusTransport.this.mExecutor == this.val$executor) {
|
||||
GpsStatusTransport.this.mCallback.onFirstFix(this.val$ttff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.core.location.LocationManagerCompat$GpsStatusTransport$4 reason: invalid class name */
|
||||
public class AnonymousClass4 implements Runnable {
|
||||
public final /* synthetic */ Executor val$executor;
|
||||
public final /* synthetic */ GnssStatusCompat val$gnssStatus;
|
||||
|
||||
public AnonymousClass4(Executor executor, GnssStatusCompat gnssStatusCompat) {
|
||||
this.val$executor = executor;
|
||||
this.val$gnssStatus = gnssStatusCompat;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (GpsStatusTransport.this.mExecutor == this.val$executor) {
|
||||
GpsStatusTransport.this.mCallback.onSatelliteStatusChanged(this.val$gnssStatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public GpsStatusTransport(LocationManager locationManager, GnssStatusCompat.Callback callback) {
|
||||
Preconditions.checkArgument(callback != null, "invalid null callback");
|
||||
this.mLocationManager = locationManager;
|
||||
this.mCallback = callback;
|
||||
}
|
||||
|
||||
@Override // android.location.GpsStatus.Listener
|
||||
@RequiresPermission("android.permission.ACCESS_FINE_LOCATION")
|
||||
public void onGpsStatusChanged(int i) {
|
||||
GpsStatus gpsStatus;
|
||||
Executor executor = this.mExecutor;
|
||||
if (executor != null) {
|
||||
if (i == 1) {
|
||||
executor.execute(new AnonymousClass1(executor));
|
||||
} else if (i == 2) {
|
||||
executor.execute(new AnonymousClass2(executor));
|
||||
} else if (i == 3) {
|
||||
GpsStatus gpsStatus2 = this.mLocationManager.getGpsStatus(null);
|
||||
if (gpsStatus2 != null) {
|
||||
executor.execute(new AnonymousClass3(executor, gpsStatus2.getTimeToFirstFix()));
|
||||
}
|
||||
} else if (i == 4 && (gpsStatus = this.mLocationManager.getGpsStatus(null)) != null) {
|
||||
executor.execute(new AnonymousClass4(executor, GnssStatusCompat.wrap(gpsStatus)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void register(Executor executor) {
|
||||
Preconditions.checkState(this.mExecutor == null);
|
||||
this.mExecutor = executor;
|
||||
}
|
||||
|
||||
public void unregister() {
|
||||
this.mExecutor = null;
|
||||
}
|
||||
}
|
||||
|
||||
public static final class InlineHandlerExecutor implements Executor {
|
||||
private final Handler mHandler;
|
||||
|
||||
public InlineHandlerExecutor(@NonNull Handler handler) {
|
||||
this.mHandler = (Handler) Preconditions.checkNotNull(handler);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Executor
|
||||
public void execute(@NonNull Runnable runnable) {
|
||||
if (Looper.myLooper() == this.mHandler.getLooper()) {
|
||||
runnable.run();
|
||||
} else if (!this.mHandler.post((Runnable) Preconditions.checkNotNull(runnable))) {
|
||||
throw new RejectedExecutionException(this.mHandler + " is shutting down");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(24)
|
||||
public static class PreRGnssStatusTransport extends GnssStatus.Callback {
|
||||
public final GnssStatusCompat.Callback mCallback;
|
||||
@Nullable
|
||||
public volatile Executor mExecutor;
|
||||
|
||||
/* renamed from: androidx.core.location.LocationManagerCompat$PreRGnssStatusTransport$1 reason: invalid class name */
|
||||
public class AnonymousClass1 implements Runnable {
|
||||
public final /* synthetic */ Executor val$executor;
|
||||
|
||||
public AnonymousClass1(Executor executor) {
|
||||
this.val$executor = executor;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (PreRGnssStatusTransport.this.mExecutor == this.val$executor) {
|
||||
PreRGnssStatusTransport.this.mCallback.onStarted();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.core.location.LocationManagerCompat$PreRGnssStatusTransport$2 reason: invalid class name */
|
||||
public class AnonymousClass2 implements Runnable {
|
||||
public final /* synthetic */ Executor val$executor;
|
||||
|
||||
public AnonymousClass2(Executor executor) {
|
||||
this.val$executor = executor;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (PreRGnssStatusTransport.this.mExecutor == this.val$executor) {
|
||||
PreRGnssStatusTransport.this.mCallback.onStopped();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.core.location.LocationManagerCompat$PreRGnssStatusTransport$3 reason: invalid class name */
|
||||
public class AnonymousClass3 implements Runnable {
|
||||
public final /* synthetic */ Executor val$executor;
|
||||
public final /* synthetic */ int val$ttffMillis;
|
||||
|
||||
public AnonymousClass3(Executor executor, int i) {
|
||||
this.val$executor = executor;
|
||||
this.val$ttffMillis = i;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (PreRGnssStatusTransport.this.mExecutor == this.val$executor) {
|
||||
PreRGnssStatusTransport.this.mCallback.onFirstFix(this.val$ttffMillis);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.core.location.LocationManagerCompat$PreRGnssStatusTransport$4 reason: invalid class name */
|
||||
public class AnonymousClass4 implements Runnable {
|
||||
public final /* synthetic */ Executor val$executor;
|
||||
public final /* synthetic */ GnssStatus val$status;
|
||||
|
||||
public AnonymousClass4(Executor executor, GnssStatus gnssStatus) {
|
||||
this.val$executor = executor;
|
||||
this.val$status = gnssStatus;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (PreRGnssStatusTransport.this.mExecutor == this.val$executor) {
|
||||
PreRGnssStatusTransport.this.mCallback.onSatelliteStatusChanged(GnssStatusCompat.wrap(this.val$status));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public PreRGnssStatusTransport(GnssStatusCompat.Callback callback) {
|
||||
Preconditions.checkArgument(callback != null, "invalid null callback");
|
||||
this.mCallback = callback;
|
||||
}
|
||||
|
||||
@Override // android.location.GnssStatus.Callback
|
||||
public void onFirstFix(int i) {
|
||||
Executor executor = this.mExecutor;
|
||||
if (executor != null) {
|
||||
executor.execute(new AnonymousClass3(executor, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.location.GnssStatus.Callback
|
||||
public void onSatelliteStatusChanged(GnssStatus gnssStatus) {
|
||||
Executor executor = this.mExecutor;
|
||||
if (executor != null) {
|
||||
executor.execute(new AnonymousClass4(executor, gnssStatus));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.location.GnssStatus.Callback
|
||||
public void onStarted() {
|
||||
Executor executor = this.mExecutor;
|
||||
if (executor != null) {
|
||||
executor.execute(new AnonymousClass1(executor));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.location.GnssStatus.Callback
|
||||
public void onStopped() {
|
||||
Executor executor = this.mExecutor;
|
||||
if (executor != null) {
|
||||
executor.execute(new AnonymousClass2(executor));
|
||||
}
|
||||
}
|
||||
|
||||
public void register(Executor executor) {
|
||||
boolean z2 = true;
|
||||
Preconditions.checkArgument(executor != null, "invalid null executor");
|
||||
if (this.mExecutor != null) {
|
||||
z2 = false;
|
||||
}
|
||||
Preconditions.checkState(z2);
|
||||
this.mExecutor = executor;
|
||||
}
|
||||
|
||||
public void unregister() {
|
||||
this.mExecutor = null;
|
||||
}
|
||||
}
|
||||
|
||||
private LocationManagerCompat() {
|
||||
}
|
||||
|
||||
@RequiresPermission(anyOf = {"android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"})
|
||||
public static void getCurrentLocation(@NonNull LocationManager locationManager, @NonNull String str, @Nullable CancellationSignal cancellationSignal, @NonNull Executor executor, @NonNull Consumer<Location> consumer) {
|
||||
if (Build.VERSION.SDK_INT >= 30) {
|
||||
Api30Impl.getCurrentLocation(locationManager, str, cancellationSignal, executor, consumer);
|
||||
return;
|
||||
}
|
||||
if (cancellationSignal != null) {
|
||||
cancellationSignal.throwIfCanceled();
|
||||
}
|
||||
Location lastKnownLocation = locationManager.getLastKnownLocation(str);
|
||||
if (lastKnownLocation == null || SystemClock.elapsedRealtime() - LocationCompat.getElapsedRealtimeMillis(lastKnownLocation) >= 10000) {
|
||||
CancellableLocationListener cancellableLocationListener = new CancellableLocationListener(locationManager, executor, consumer);
|
||||
locationManager.requestLocationUpdates(str, 0, 0.0f, cancellableLocationListener, Looper.getMainLooper());
|
||||
if (cancellationSignal != null) {
|
||||
cancellationSignal.setOnCancelListener(new AnonymousClass2(cancellableLocationListener));
|
||||
}
|
||||
cancellableLocationListener.startTimeout(30000);
|
||||
return;
|
||||
}
|
||||
executor.execute(new AnonymousClass1(consumer, lastKnownLocation));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static String getGnssHardwareModelName(@NonNull LocationManager locationManager) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
return Api28Impl.getGnssHardwareModelName(locationManager);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int getGnssYearOfHardware(@NonNull LocationManager locationManager) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
return Api28Impl.getGnssYearOfHardware(locationManager);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static boolean isLocationEnabled(@NonNull LocationManager locationManager) {
|
||||
return Build.VERSION.SDK_INT >= 28 ? locationManager.isLocationEnabled() : locationManager.isProviderEnabled("network") || locationManager.isProviderEnabled("gps");
|
||||
return Build.VERSION.SDK_INT >= 28 ? Api28Impl.isLocationEnabled(locationManager) : locationManager.isProviderEnabled("network") || locationManager.isProviderEnabled("gps");
|
||||
}
|
||||
|
||||
/* JADX WARNING: Removed duplicated region for block: B:103:0x0129 */
|
||||
/* JADX WARNING: Removed duplicated region for block: B:93:0x010a A[Catch:{ ExecutionException -> 0x0100, TimeoutException -> 0x00e7, all -> 0x00e4, all -> 0x0126 }] */
|
||||
/* JADX WARNING: Removed duplicated region for block: B:99:0x011f A[Catch:{ ExecutionException -> 0x0100, TimeoutException -> 0x00e7, all -> 0x00e4, all -> 0x0126 }] */
|
||||
@RequiresPermission("android.permission.ACCESS_FINE_LOCATION")
|
||||
private static boolean registerGnssStatusCallback(LocationManager locationManager, Handler handler, Executor executor, GnssStatusCompat.Callback callback) {
|
||||
Throwable th;
|
||||
ExecutionException e;
|
||||
TimeoutException e2;
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
boolean z2 = true;
|
||||
if (i >= 30) {
|
||||
SimpleArrayMap<Object, Object> simpleArrayMap = sGnssStatusListeners;
|
||||
synchronized (simpleArrayMap) {
|
||||
GnssStatus.Callback callback2 = (GnssStatusTransport) simpleArrayMap.get(callback);
|
||||
if (callback2 == null) {
|
||||
callback2 = new GnssStatusTransport(callback);
|
||||
}
|
||||
if (!locationManager.registerGnssStatusCallback(executor, callback2)) {
|
||||
return false;
|
||||
}
|
||||
simpleArrayMap.put(callback, callback2);
|
||||
return true;
|
||||
}
|
||||
} else if (i >= 24) {
|
||||
Preconditions.checkArgument(handler != null);
|
||||
SimpleArrayMap<Object, Object> simpleArrayMap2 = sGnssStatusListeners;
|
||||
synchronized (simpleArrayMap2) {
|
||||
PreRGnssStatusTransport preRGnssStatusTransport = (PreRGnssStatusTransport) simpleArrayMap2.get(callback);
|
||||
if (preRGnssStatusTransport == null) {
|
||||
preRGnssStatusTransport = new PreRGnssStatusTransport(callback);
|
||||
} else {
|
||||
preRGnssStatusTransport.unregister();
|
||||
}
|
||||
preRGnssStatusTransport.register(executor);
|
||||
if (!locationManager.registerGnssStatusCallback(preRGnssStatusTransport, handler)) {
|
||||
return false;
|
||||
}
|
||||
simpleArrayMap2.put(callback, preRGnssStatusTransport);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
Preconditions.checkArgument(handler != null);
|
||||
SimpleArrayMap<Object, Object> simpleArrayMap3 = sGnssStatusListeners;
|
||||
synchronized (simpleArrayMap3) {
|
||||
GpsStatusTransport gpsStatusTransport = (GpsStatusTransport) simpleArrayMap3.get(callback);
|
||||
if (gpsStatusTransport == null) {
|
||||
gpsStatusTransport = new GpsStatusTransport(locationManager, callback);
|
||||
} else {
|
||||
gpsStatusTransport.unregister();
|
||||
}
|
||||
gpsStatusTransport.register(executor);
|
||||
FutureTask futureTask = new FutureTask(new AnonymousClass3(locationManager, gpsStatusTransport));
|
||||
if (Looper.myLooper() == handler.getLooper()) {
|
||||
futureTask.run();
|
||||
} else if (!handler.post(futureTask)) {
|
||||
throw new IllegalStateException(handler + " is shutting down");
|
||||
}
|
||||
try {
|
||||
long nanos = TimeUnit.SECONDS.toNanos(PRE_N_LOOPER_TIMEOUT_S);
|
||||
boolean z3 = false;
|
||||
while (true) {
|
||||
try {
|
||||
break;
|
||||
} catch (InterruptedException unused) {
|
||||
try {
|
||||
nanos = (System.nanoTime() + nanos) - System.nanoTime();
|
||||
z3 = true;
|
||||
} catch (ExecutionException e3) {
|
||||
e = e3;
|
||||
if (e.getCause() instanceof RuntimeException) {
|
||||
}
|
||||
} catch (TimeoutException e4) {
|
||||
e2 = e4;
|
||||
throw new IllegalStateException(handler + " appears to be blocked, please run registerGnssStatusCallback() directly on a Looper thread or ensure the main Looper is not blocked by this thread", e2);
|
||||
}
|
||||
} catch (ExecutionException e5) {
|
||||
e = e5;
|
||||
if (e.getCause() instanceof RuntimeException) {
|
||||
}
|
||||
} catch (TimeoutException e6) {
|
||||
e2 = e6;
|
||||
z2 = z3;
|
||||
throw new IllegalStateException(handler + " appears to be blocked, please run registerGnssStatusCallback() directly on a Looper thread or ensure the main Looper is not blocked by this thread", e2);
|
||||
} catch (Throwable th2) {
|
||||
th = th2;
|
||||
z2 = z3;
|
||||
if (z2) {
|
||||
}
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
if (((Boolean) futureTask.get(nanos, TimeUnit.NANOSECONDS)).booleanValue()) {
|
||||
sGnssStatusListeners.put(callback, gpsStatusTransport);
|
||||
if (z3) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (z3) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
return false;
|
||||
} catch (ExecutionException e7) {
|
||||
e = e7;
|
||||
if (e.getCause() instanceof RuntimeException) {
|
||||
throw ((RuntimeException) e.getCause());
|
||||
} else if (e.getCause() instanceof Error) {
|
||||
throw ((Error) e.getCause());
|
||||
} else {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
} catch (TimeoutException e8) {
|
||||
e2 = e8;
|
||||
z2 = false;
|
||||
throw new IllegalStateException(handler + " appears to be blocked, please run registerGnssStatusCallback() directly on a Looper thread or ensure the main Looper is not blocked by this thread", e2);
|
||||
} catch (Throwable th3) {
|
||||
th = th3;
|
||||
if (z2) {
|
||||
}
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresPermission("android.permission.ACCESS_FINE_LOCATION")
|
||||
public static boolean registerGnssStatusCallback(@NonNull LocationManager locationManager, @NonNull GnssStatusCompat.Callback callback, @NonNull Handler handler) {
|
||||
return Build.VERSION.SDK_INT >= 30 ? registerGnssStatusCallback(locationManager, ExecutorCompat.create(handler), callback) : registerGnssStatusCallback(locationManager, new InlineHandlerExecutor(handler), callback);
|
||||
}
|
||||
|
||||
@RequiresPermission("android.permission.ACCESS_FINE_LOCATION")
|
||||
public static boolean registerGnssStatusCallback(@NonNull LocationManager locationManager, @NonNull Executor executor, @NonNull GnssStatusCompat.Callback callback) {
|
||||
if (Build.VERSION.SDK_INT >= 30) {
|
||||
return registerGnssStatusCallback(locationManager, null, executor, callback);
|
||||
}
|
||||
Looper myLooper = Looper.myLooper();
|
||||
if (myLooper == null) {
|
||||
myLooper = Looper.getMainLooper();
|
||||
}
|
||||
return registerGnssStatusCallback(locationManager, new Handler(myLooper), executor, callback);
|
||||
}
|
||||
|
||||
public static void unregisterGnssStatusCallback(@NonNull LocationManager locationManager, @NonNull GnssStatusCompat.Callback callback) {
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i >= 30) {
|
||||
SimpleArrayMap<Object, Object> simpleArrayMap = sGnssStatusListeners;
|
||||
synchronized (simpleArrayMap) {
|
||||
GnssStatus.Callback callback2 = (GnssStatusTransport) simpleArrayMap.remove(callback);
|
||||
if (callback2 != null) {
|
||||
locationManager.unregisterGnssStatusCallback(callback2);
|
||||
}
|
||||
}
|
||||
} else if (i >= 24) {
|
||||
SimpleArrayMap<Object, Object> simpleArrayMap2 = sGnssStatusListeners;
|
||||
synchronized (simpleArrayMap2) {
|
||||
PreRGnssStatusTransport preRGnssStatusTransport = (PreRGnssStatusTransport) simpleArrayMap2.remove(callback);
|
||||
if (preRGnssStatusTransport != null) {
|
||||
preRGnssStatusTransport.unregister();
|
||||
locationManager.unregisterGnssStatusCallback(preRGnssStatusTransport);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
SimpleArrayMap<Object, Object> simpleArrayMap3 = sGnssStatusListeners;
|
||||
synchronized (simpleArrayMap3) {
|
||||
GpsStatusTransport gpsStatusTransport = (GpsStatusTransport) simpleArrayMap3.remove(callback);
|
||||
if (gpsStatusTransport != null) {
|
||||
gpsStatusTransport.unregister();
|
||||
locationManager.removeGpsStatusListener(gpsStatusTransport);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,116 @@
|
|||
package androidx.core.net;
|
||||
|
||||
import android.net.Uri;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.util.Preconditions;
|
||||
import c.d.b.a.a;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
public final class MailTo {
|
||||
private static final String BCC = "bcc";
|
||||
private static final String BODY = "body";
|
||||
private static final String CC = "cc";
|
||||
private static final String MAILTO = "mailto";
|
||||
public static final String MAILTO_SCHEME = "mailto:";
|
||||
private static final String SUBJECT = "subject";
|
||||
private static final String TO = "to";
|
||||
private HashMap<String, String> mHeaders = new HashMap<>();
|
||||
|
||||
private MailTo() {
|
||||
}
|
||||
|
||||
public static boolean isMailTo(@Nullable Uri uri) {
|
||||
return uri != null && MAILTO.equals(uri.getScheme());
|
||||
}
|
||||
|
||||
public static boolean isMailTo(@Nullable String str) {
|
||||
return str != null && str.startsWith(MAILTO_SCHEME);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static MailTo parse(@NonNull Uri uri) throws ParseException {
|
||||
return parse(uri.toString());
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static MailTo parse(@NonNull String str) throws ParseException {
|
||||
String str2;
|
||||
String str3;
|
||||
Preconditions.checkNotNull(str);
|
||||
if (isMailTo(str)) {
|
||||
int indexOf = str.indexOf(35);
|
||||
if (indexOf != -1) {
|
||||
str = str.substring(0, indexOf);
|
||||
}
|
||||
int indexOf2 = str.indexOf(63);
|
||||
if (indexOf2 == -1) {
|
||||
str3 = Uri.decode(str.substring(7));
|
||||
str2 = null;
|
||||
} else {
|
||||
str3 = Uri.decode(str.substring(7, indexOf2));
|
||||
str2 = str.substring(indexOf2 + 1);
|
||||
}
|
||||
MailTo mailTo = new MailTo();
|
||||
if (str2 != null) {
|
||||
for (String str4 : str2.split("&")) {
|
||||
String[] split = str4.split("=", 2);
|
||||
if (split.length != 0) {
|
||||
mailTo.mHeaders.put(Uri.decode(split[0]).toLowerCase(Locale.ROOT), split.length > 1 ? Uri.decode(split[1]) : null);
|
||||
}
|
||||
}
|
||||
}
|
||||
String to = mailTo.getTo();
|
||||
if (to != null) {
|
||||
str3 = a.v(str3, ", ", to);
|
||||
}
|
||||
mailTo.mHeaders.put(TO, str3);
|
||||
return mailTo;
|
||||
}
|
||||
throw new ParseException("Not a mailto scheme");
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getBcc() {
|
||||
return this.mHeaders.get(BCC);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getBody() {
|
||||
return this.mHeaders.get(BODY);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getCc() {
|
||||
return this.mHeaders.get(CC);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Map<String, String> getHeaders() {
|
||||
return this.mHeaders;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getSubject() {
|
||||
return this.mHeaders.get(SUBJECT);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getTo() {
|
||||
return this.mHeaders.get(TO);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder(MAILTO_SCHEME);
|
||||
sb.append('?');
|
||||
for (Map.Entry<String, String> entry : this.mHeaders.entrySet()) {
|
||||
sb.append(Uri.encode(entry.getKey()));
|
||||
sb.append('=');
|
||||
sb.append(Uri.encode(entry.getValue()));
|
||||
sb.append('&');
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package androidx.core.net;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
public class ParseException extends RuntimeException {
|
||||
@NonNull
|
||||
public final String response;
|
||||
|
||||
public ParseException(@NonNull String str) {
|
||||
super(str);
|
||||
this.response = str;
|
||||
}
|
||||
}
|
|
@ -6,28 +6,28 @@ import java.io.File;
|
|||
/* compiled from: Uri.kt */
|
||||
public final class UriKt {
|
||||
public static final File toFile(Uri uri) {
|
||||
m.checkParameterIsNotNull(uri, "$this$toFile");
|
||||
m.checkNotNullParameter(uri, "<this>");
|
||||
if (m.areEqual(uri.getScheme(), "file")) {
|
||||
String path = uri.getPath();
|
||||
if (path != null) {
|
||||
return new File(path);
|
||||
}
|
||||
throw new IllegalArgumentException(("Uri path is null: " + uri).toString());
|
||||
throw new IllegalArgumentException(m.stringPlus("Uri path is null: ", uri).toString());
|
||||
}
|
||||
throw new IllegalArgumentException(("Uri lacks 'file' scheme: " + uri).toString());
|
||||
throw new IllegalArgumentException(m.stringPlus("Uri lacks 'file' scheme: ", uri).toString());
|
||||
}
|
||||
|
||||
public static final Uri toUri(File file) {
|
||||
m.checkParameterIsNotNull(file, "$this$toUri");
|
||||
m.checkNotNullParameter(file, "<this>");
|
||||
Uri fromFile = Uri.fromFile(file);
|
||||
m.checkExpressionValueIsNotNull(fromFile, "Uri.fromFile(this)");
|
||||
m.checkNotNullExpressionValue(fromFile, "fromFile(this)");
|
||||
return fromFile;
|
||||
}
|
||||
|
||||
public static final Uri toUri(String str) {
|
||||
m.checkParameterIsNotNull(str, "$this$toUri");
|
||||
m.checkNotNullParameter(str, "<this>");
|
||||
Uri parse = Uri.parse(str);
|
||||
m.checkExpressionValueIsNotNull(parse, "Uri.parse(this)");
|
||||
m.checkNotNullExpressionValue(parse, "parse(this)");
|
||||
return parse;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,41 +1,75 @@
|
|||
package androidx.core.os;
|
||||
|
||||
import android.os.Build;
|
||||
import androidx.annotation.ChecksSdkIntAtLeast;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresOptIn;
|
||||
import androidx.annotation.RestrictTo;
|
||||
import androidx.exifinterface.media.ExifInterface;
|
||||
public class BuildCompat {
|
||||
|
||||
@RequiresOptIn
|
||||
public @interface PrereleaseSdkCheck {
|
||||
}
|
||||
|
||||
private BuildCompat() {
|
||||
}
|
||||
|
||||
@ChecksSdkIntAtLeast(api = 24)
|
||||
@Deprecated
|
||||
public static boolean isAtLeastN() {
|
||||
return Build.VERSION.SDK_INT >= 24;
|
||||
}
|
||||
|
||||
@ChecksSdkIntAtLeast(api = 25)
|
||||
@Deprecated
|
||||
public static boolean isAtLeastNMR1() {
|
||||
return Build.VERSION.SDK_INT >= 25;
|
||||
}
|
||||
|
||||
@ChecksSdkIntAtLeast(api = 26)
|
||||
@Deprecated
|
||||
public static boolean isAtLeastO() {
|
||||
return Build.VERSION.SDK_INT >= 26;
|
||||
}
|
||||
|
||||
@ChecksSdkIntAtLeast(api = 27)
|
||||
@Deprecated
|
||||
public static boolean isAtLeastOMR1() {
|
||||
return Build.VERSION.SDK_INT >= 27;
|
||||
}
|
||||
|
||||
@ChecksSdkIntAtLeast(api = 28)
|
||||
@Deprecated
|
||||
public static boolean isAtLeastP() {
|
||||
return Build.VERSION.SDK_INT >= 28;
|
||||
}
|
||||
|
||||
@RestrictTo({RestrictTo.Scope.TESTS})
|
||||
public static boolean isAtLeastPreReleaseCodename(@NonNull String str, @NonNull String str2) {
|
||||
return !"REL".equals(str2) && str2.compareTo(str) >= 0;
|
||||
}
|
||||
|
||||
@ChecksSdkIntAtLeast(api = 29)
|
||||
@Deprecated
|
||||
public static boolean isAtLeastQ() {
|
||||
return Build.VERSION.SDK_INT >= 29;
|
||||
}
|
||||
|
||||
@ChecksSdkIntAtLeast(api = 30)
|
||||
@Deprecated
|
||||
public static boolean isAtLeastR() {
|
||||
return Build.VERSION.SDK_INT >= 30 || Build.VERSION.CODENAME.equals("R");
|
||||
return Build.VERSION.SDK_INT >= 30;
|
||||
}
|
||||
|
||||
@ChecksSdkIntAtLeast(api = 31, codename = ExifInterface.LATITUDE_SOUTH)
|
||||
public static boolean isAtLeastS() {
|
||||
return Build.VERSION.SDK_INT >= 31 || isAtLeastPreReleaseCodename(ExifInterface.LATITUDE_SOUTH, Build.VERSION.CODENAME);
|
||||
}
|
||||
|
||||
@ChecksSdkIntAtLeast(codename = ExifInterface.GPS_DIRECTION_TRUE)
|
||||
@PrereleaseSdkCheck
|
||||
public static boolean isAtLeastT() {
|
||||
return isAtLeastPreReleaseCodename(ExifInterface.GPS_DIRECTION_TRUE, Build.VERSION.CODENAME);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,9 +11,13 @@ import kotlin.Pair;
|
|||
/* compiled from: Bundle.kt */
|
||||
public final class BundleKt {
|
||||
public static final Bundle bundleOf(Pair<String, ? extends Object>... pairArr) {
|
||||
m.checkParameterIsNotNull(pairArr, "pairs");
|
||||
m.checkNotNullParameter(pairArr, "pairs");
|
||||
Bundle bundle = new Bundle(pairArr.length);
|
||||
for (Pair<String, ? extends Object> pair : pairArr) {
|
||||
int length = pairArr.length;
|
||||
int i = 0;
|
||||
while (i < length) {
|
||||
Pair<String, ? extends Object> pair = pairArr[i];
|
||||
i++;
|
||||
String component1 = pair.component1();
|
||||
Object component2 = pair.component2();
|
||||
if (component2 == null) {
|
||||
|
@ -58,10 +62,7 @@ public final class BundleKt {
|
|||
bundle.putShortArray(component1, (short[]) component2);
|
||||
} else if (component2 instanceof Object[]) {
|
||||
Class<?> componentType = component2.getClass().getComponentType();
|
||||
if (componentType == null) {
|
||||
m.throwNpe();
|
||||
}
|
||||
m.checkExpressionValueIsNotNull(componentType, "value::class.java.componentType!!");
|
||||
m.checkNotNull(componentType);
|
||||
if (Parcelable.class.isAssignableFrom(componentType)) {
|
||||
bundle.putParcelableArray(component1, (Parcelable[]) component2);
|
||||
} else if (String.class.isAssignableFrom(componentType)) {
|
||||
|
@ -71,7 +72,8 @@ public final class BundleKt {
|
|||
} else if (Serializable.class.isAssignableFrom(componentType)) {
|
||||
bundle.putSerializable(component1, (Serializable) component2);
|
||||
} else {
|
||||
throw new IllegalArgumentException("Illegal value array type " + componentType.getCanonicalName() + " for key \"" + component1 + '\"');
|
||||
String canonicalName = componentType.getCanonicalName();
|
||||
throw new IllegalArgumentException("Illegal value array type " + ((Object) canonicalName) + " for key \"" + component1 + '\"');
|
||||
}
|
||||
} else if (component2 instanceof Serializable) {
|
||||
bundle.putSerializable(component1, (Serializable) component2);
|
||||
|
@ -82,7 +84,8 @@ public final class BundleKt {
|
|||
} else if (component2 instanceof SizeF) {
|
||||
bundle.putSizeF(component1, (SizeF) component2);
|
||||
} else {
|
||||
throw new IllegalArgumentException("Illegal value type " + component2.getClass().getCanonicalName() + " for key \"" + component1 + '\"');
|
||||
String canonicalName2 = component2.getClass().getCanonicalName();
|
||||
throw new IllegalArgumentException("Illegal value type " + ((Object) canonicalName2) + " for key \"" + component1 + '\"');
|
||||
}
|
||||
}
|
||||
return bundle;
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
package androidx.core.os;
|
||||
|
||||
import android.os.Handler;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.util.Preconditions;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
public final class ExecutorCompat {
|
||||
|
||||
public static class HandlerExecutor implements Executor {
|
||||
private final Handler mHandler;
|
||||
|
||||
public HandlerExecutor(@NonNull Handler handler) {
|
||||
this.mHandler = (Handler) Preconditions.checkNotNull(handler);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Executor
|
||||
public void execute(@NonNull Runnable runnable) {
|
||||
if (!this.mHandler.post((Runnable) Preconditions.checkNotNull(runnable))) {
|
||||
throw new RejectedExecutionException(this.mHandler + " is shutting down");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ExecutorCompat() {
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static Executor create(@NonNull Handler handler) {
|
||||
return new HandlerExecutor(handler);
|
||||
}
|
||||
}
|
|
@ -7,25 +7,54 @@ import android.os.Message;
|
|||
import android.util.Log;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
public final class HandlerCompat {
|
||||
private static final String TAG = "HandlerCompat";
|
||||
|
||||
@RequiresApi(28)
|
||||
public static class Api28Impl {
|
||||
private Api28Impl() {
|
||||
}
|
||||
|
||||
public static Handler createAsync(Looper looper) {
|
||||
return Handler.createAsync(looper);
|
||||
}
|
||||
|
||||
public static Handler createAsync(Looper looper, Handler.Callback callback) {
|
||||
return Handler.createAsync(looper, callback);
|
||||
}
|
||||
|
||||
public static boolean postDelayed(Handler handler, Runnable runnable, Object obj, long j) {
|
||||
return handler.postDelayed(runnable, obj, j);
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(29)
|
||||
public static class Api29Impl {
|
||||
private Api29Impl() {
|
||||
}
|
||||
|
||||
public static boolean hasCallbacks(Handler handler, Runnable runnable) {
|
||||
return handler.hasCallbacks(runnable);
|
||||
}
|
||||
}
|
||||
|
||||
private HandlerCompat() {
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static Handler createAsync(@NonNull Looper looper) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
return Handler.createAsync(looper);
|
||||
return Api28Impl.createAsync(looper);
|
||||
}
|
||||
try {
|
||||
return (Handler) Handler.class.getDeclaredConstructor(Looper.class, Handler.Callback.class, Boolean.TYPE).newInstance(looper, null, Boolean.TRUE);
|
||||
} catch (IllegalAccessException | InstantiationException | NoSuchMethodException unused) {
|
||||
Log.v(TAG, "Unable to invoke Handler(Looper, Callback, boolean) constructor");
|
||||
} catch (IllegalAccessException | InstantiationException | NoSuchMethodException e) {
|
||||
Log.w(TAG, "Unable to invoke Handler(Looper, Callback, boolean) constructor", e);
|
||||
return new Handler(looper);
|
||||
} catch (InvocationTargetException e) {
|
||||
Throwable cause = e.getCause();
|
||||
} catch (InvocationTargetException e2) {
|
||||
Throwable cause = e2.getCause();
|
||||
if (cause instanceof RuntimeException) {
|
||||
throw ((RuntimeException) cause);
|
||||
} else if (cause instanceof Error) {
|
||||
|
@ -39,15 +68,15 @@ public final class HandlerCompat {
|
|||
@NonNull
|
||||
public static Handler createAsync(@NonNull Looper looper, @NonNull Handler.Callback callback) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
return Handler.createAsync(looper, callback);
|
||||
return Api28Impl.createAsync(looper, callback);
|
||||
}
|
||||
try {
|
||||
return (Handler) Handler.class.getDeclaredConstructor(Looper.class, Handler.Callback.class, Boolean.TYPE).newInstance(looper, callback, Boolean.TRUE);
|
||||
} catch (IllegalAccessException | InstantiationException | NoSuchMethodException unused) {
|
||||
Log.v(TAG, "Unable to invoke Handler(Looper, Callback, boolean) constructor");
|
||||
} catch (IllegalAccessException | InstantiationException | NoSuchMethodException e) {
|
||||
Log.w(TAG, "Unable to invoke Handler(Looper, Callback, boolean) constructor", e);
|
||||
return new Handler(looper, callback);
|
||||
} catch (InvocationTargetException e) {
|
||||
Throwable cause = e.getCause();
|
||||
} catch (InvocationTargetException e2) {
|
||||
Throwable cause = e2.getCause();
|
||||
if (cause instanceof RuntimeException) {
|
||||
throw ((RuntimeException) cause);
|
||||
} else if (cause instanceof Error) {
|
||||
|
@ -58,9 +87,30 @@ public final class HandlerCompat {
|
|||
}
|
||||
}
|
||||
|
||||
@RequiresApi(16)
|
||||
public static boolean hasCallbacks(@NonNull Handler handler, @NonNull Runnable runnable) {
|
||||
if (Build.VERSION.SDK_INT >= 29) {
|
||||
return Api29Impl.hasCallbacks(handler, runnable);
|
||||
}
|
||||
try {
|
||||
return ((Boolean) Handler.class.getMethod("hasCallbacks", Runnable.class).invoke(handler, runnable)).booleanValue();
|
||||
} catch (InvocationTargetException e) {
|
||||
Throwable cause = e.getCause();
|
||||
if (cause instanceof RuntimeException) {
|
||||
throw ((RuntimeException) cause);
|
||||
} else if (cause instanceof Error) {
|
||||
throw ((Error) cause);
|
||||
} else {
|
||||
throw new RuntimeException(cause);
|
||||
}
|
||||
} catch (IllegalAccessException | NoSuchMethodException | NullPointerException e2) {
|
||||
throw new UnsupportedOperationException("Failed to call Handler.hasCallbacks(), but there is no safe failure mode for this method. Raising exception.", e2);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean postDelayed(@NonNull Handler handler, @NonNull Runnable runnable, @Nullable Object obj, long j) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
return handler.postDelayed(runnable, obj, j);
|
||||
return Api28Impl.postDelayed(handler, runnable, obj, j);
|
||||
}
|
||||
Message obtain = Message.obtain(handler, runnable);
|
||||
obtain.obj = obj;
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package androidx.core.os;
|
||||
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
/* compiled from: Handler.kt */
|
||||
public final class HandlerKt$postAtTime$runnable$1 implements Runnable {
|
||||
public final /* synthetic */ Function0 $action;
|
||||
public final /* synthetic */ Function0<Unit> $action;
|
||||
|
||||
public HandlerKt$postAtTime$runnable$1(Function0 function0) {
|
||||
public HandlerKt$postAtTime$runnable$1(Function0<Unit> function0) {
|
||||
this.$action = function0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package androidx.core.os;
|
||||
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
/* compiled from: Handler.kt */
|
||||
public final class HandlerKt$postDelayed$runnable$1 implements Runnable {
|
||||
public final /* synthetic */ Function0 $action;
|
||||
public final /* synthetic */ Function0<Unit> $action;
|
||||
|
||||
public HandlerKt$postDelayed$runnable$1(Function0 function0) {
|
||||
public HandlerKt$postDelayed$runnable$1(Function0<Unit> function0) {
|
||||
this.$action = function0;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ import kotlin.jvm.functions.Function0;
|
|||
/* compiled from: Handler.kt */
|
||||
public final class HandlerKt {
|
||||
public static final Runnable postAtTime(Handler handler, long j, Object obj, Function0<Unit> function0) {
|
||||
m.checkParameterIsNotNull(handler, "$this$postAtTime");
|
||||
m.checkParameterIsNotNull(function0, "action");
|
||||
m.checkNotNullParameter(handler, "<this>");
|
||||
m.checkNotNullParameter(function0, "action");
|
||||
HandlerKt$postAtTime$runnable$1 handlerKt$postAtTime$runnable$1 = new HandlerKt$postAtTime$runnable$1(function0);
|
||||
handler.postAtTime(handlerKt$postAtTime$runnable$1, obj, j);
|
||||
return handlerKt$postAtTime$runnable$1;
|
||||
|
@ -18,16 +18,16 @@ public final class HandlerKt {
|
|||
if ((i & 2) != 0) {
|
||||
obj = null;
|
||||
}
|
||||
m.checkParameterIsNotNull(handler, "$this$postAtTime");
|
||||
m.checkParameterIsNotNull(function0, "action");
|
||||
m.checkNotNullParameter(handler, "<this>");
|
||||
m.checkNotNullParameter(function0, "action");
|
||||
HandlerKt$postAtTime$runnable$1 handlerKt$postAtTime$runnable$1 = new HandlerKt$postAtTime$runnable$1(function0);
|
||||
handler.postAtTime(handlerKt$postAtTime$runnable$1, obj, j);
|
||||
return handlerKt$postAtTime$runnable$1;
|
||||
}
|
||||
|
||||
public static final Runnable postDelayed(Handler handler, long j, Object obj, Function0<Unit> function0) {
|
||||
m.checkParameterIsNotNull(handler, "$this$postDelayed");
|
||||
m.checkParameterIsNotNull(function0, "action");
|
||||
m.checkNotNullParameter(handler, "<this>");
|
||||
m.checkNotNullParameter(function0, "action");
|
||||
HandlerKt$postDelayed$runnable$1 handlerKt$postDelayed$runnable$1 = new HandlerKt$postDelayed$runnable$1(function0);
|
||||
if (obj == null) {
|
||||
handler.postDelayed(handlerKt$postDelayed$runnable$1, j);
|
||||
|
@ -41,8 +41,8 @@ public final class HandlerKt {
|
|||
if ((i & 2) != 0) {
|
||||
obj = null;
|
||||
}
|
||||
m.checkParameterIsNotNull(handler, "$this$postDelayed");
|
||||
m.checkParameterIsNotNull(function0, "action");
|
||||
m.checkNotNullParameter(handler, "<this>");
|
||||
m.checkNotNullParameter(function0, "action");
|
||||
HandlerKt$postDelayed$runnable$1 handlerKt$postDelayed$runnable$1 = new HandlerKt$postDelayed$runnable$1(function0);
|
||||
if (obj == null) {
|
||||
handler.postDelayed(handlerKt$postDelayed$runnable$1, j);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue