ADD week 5
This commit is contained in:
368
02-Easy5/E5/sources/androidx/core/app/ActivityCompat.java
Normal file
368
02-Easy5/E5/sources/androidx/core/app/ActivityCompat.java
Normal file
@ -0,0 +1,368 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.SharedElementCallback;
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentSender;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.RectF;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Display;
|
||||
import android.view.DragEvent;
|
||||
import android.view.View;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.app.SharedElementCallback;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.LocusIdCompat;
|
||||
import androidx.core.os.BuildCompat;
|
||||
import androidx.core.view.DragAndDropPermissionsCompat;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ActivityCompat extends ContextCompat {
|
||||
private static PermissionCompatDelegate sDelegate;
|
||||
|
||||
public interface OnRequestPermissionsResultCallback {
|
||||
void onRequestPermissionsResult(int i, String[] strArr, int[] iArr);
|
||||
}
|
||||
|
||||
public interface PermissionCompatDelegate {
|
||||
boolean onActivityResult(Activity activity, int i, int i2, Intent intent);
|
||||
|
||||
boolean requestPermissions(Activity activity, String[] strArr, int i);
|
||||
}
|
||||
|
||||
public interface RequestPermissionsRequestCodeValidator {
|
||||
void validateRequestPermissionsRequestCode(int i);
|
||||
}
|
||||
|
||||
public static PermissionCompatDelegate getPermissionCompatDelegate() {
|
||||
return sDelegate;
|
||||
}
|
||||
|
||||
public static void setPermissionCompatDelegate(PermissionCompatDelegate permissionCompatDelegate) {
|
||||
sDelegate = permissionCompatDelegate;
|
||||
}
|
||||
|
||||
protected ActivityCompat() {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean invalidateOptionsMenu(Activity activity) {
|
||||
activity.invalidateOptionsMenu();
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void startActivityForResult(Activity activity, Intent intent, int i, Bundle bundle) {
|
||||
Api16Impl.startActivityForResult(activity, intent, i, bundle);
|
||||
}
|
||||
|
||||
public static void startIntentSenderForResult(Activity activity, IntentSender intentSender, int i, Intent intent, int i2, int i3, int i4, Bundle bundle) throws IntentSender.SendIntentException {
|
||||
Api16Impl.startIntentSenderForResult(activity, intentSender, i, intent, i2, i3, i4, bundle);
|
||||
}
|
||||
|
||||
public static void finishAffinity(Activity activity) {
|
||||
Api16Impl.finishAffinity(activity);
|
||||
}
|
||||
|
||||
public static void finishAfterTransition(Activity activity) {
|
||||
Api21Impl.finishAfterTransition(activity);
|
||||
}
|
||||
|
||||
public static Uri getReferrer(Activity activity) {
|
||||
if (Build.VERSION.SDK_INT >= 22) {
|
||||
return Api22Impl.getReferrer(activity);
|
||||
}
|
||||
Intent intent = activity.getIntent();
|
||||
Uri uri = (Uri) intent.getParcelableExtra("android.intent.extra.REFERRER");
|
||||
if (uri != null) {
|
||||
return uri;
|
||||
}
|
||||
String stringExtra = intent.getStringExtra("android.intent.extra.REFERRER_NAME");
|
||||
if (stringExtra != null) {
|
||||
return Uri.parse(stringExtra);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static <T extends View> T requireViewById(Activity activity, int i) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
return (T) Api28Impl.requireViewById(activity, i);
|
||||
}
|
||||
T t = (T) activity.findViewById(i);
|
||||
if (t != null) {
|
||||
return t;
|
||||
}
|
||||
throw new IllegalArgumentException("ID does not reference a View inside this Activity");
|
||||
}
|
||||
|
||||
public static void setEnterSharedElementCallback(Activity activity, SharedElementCallback sharedElementCallback) {
|
||||
Api21Impl.setEnterSharedElementCallback(activity, sharedElementCallback != null ? new SharedElementCallback21Impl(sharedElementCallback) : null);
|
||||
}
|
||||
|
||||
public static void setExitSharedElementCallback(Activity activity, SharedElementCallback sharedElementCallback) {
|
||||
Api21Impl.setExitSharedElementCallback(activity, sharedElementCallback != null ? new SharedElementCallback21Impl(sharedElementCallback) : null);
|
||||
}
|
||||
|
||||
public static void postponeEnterTransition(Activity activity) {
|
||||
Api21Impl.postponeEnterTransition(activity);
|
||||
}
|
||||
|
||||
public static void startPostponedEnterTransition(Activity activity) {
|
||||
Api21Impl.startPostponedEnterTransition(activity);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static void requestPermissions(final Activity activity, String[] strArr, final int i) {
|
||||
PermissionCompatDelegate permissionCompatDelegate = sDelegate;
|
||||
if (permissionCompatDelegate == null || !permissionCompatDelegate.requestPermissions(activity, strArr, i)) {
|
||||
HashSet hashSet = new HashSet();
|
||||
for (int i2 = 0; i2 < strArr.length; i2++) {
|
||||
if (TextUtils.isEmpty(strArr[i2])) {
|
||||
throw new IllegalArgumentException("Permission request for permissions " + Arrays.toString(strArr) + " must not contain null or empty values");
|
||||
}
|
||||
if (!BuildCompat.isAtLeastT() && TextUtils.equals(strArr[i2], "android.permission.POST_NOTIFICATIONS")) {
|
||||
hashSet.add(Integer.valueOf(i2));
|
||||
}
|
||||
}
|
||||
int size = hashSet.size();
|
||||
final String[] strArr2 = size > 0 ? new String[strArr.length - size] : strArr;
|
||||
if (size > 0) {
|
||||
if (size == strArr.length) {
|
||||
return;
|
||||
}
|
||||
int i3 = 0;
|
||||
for (int i4 = 0; i4 < strArr.length; i4++) {
|
||||
if (!hashSet.contains(Integer.valueOf(i4))) {
|
||||
strArr2[i3] = strArr[i4];
|
||||
i3++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
if (activity instanceof RequestPermissionsRequestCodeValidator) {
|
||||
((RequestPermissionsRequestCodeValidator) activity).validateRequestPermissionsRequestCode(i);
|
||||
}
|
||||
Api23Impl.requestPermissions(activity, strArr, i);
|
||||
} else if (activity instanceof OnRequestPermissionsResultCallback) {
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() { // from class: androidx.core.app.ActivityCompat.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
int[] iArr = new int[strArr2.length];
|
||||
PackageManager packageManager = activity.getPackageManager();
|
||||
String packageName = activity.getPackageName();
|
||||
int length = strArr2.length;
|
||||
for (int i5 = 0; i5 < length; i5++) {
|
||||
iArr[i5] = packageManager.checkPermission(strArr2[i5], packageName);
|
||||
}
|
||||
((OnRequestPermissionsResultCallback) activity).onRequestPermissionsResult(i, strArr2, iArr);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean shouldShowRequestPermissionRationale(Activity activity, String str) {
|
||||
if ((BuildCompat.isAtLeastT() || !TextUtils.equals("android.permission.POST_NOTIFICATIONS", str)) && Build.VERSION.SDK_INT >= 23) {
|
||||
return Api23Impl.shouldShowRequestPermissionRationale(activity, str);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isLaunchedFromBubble(Activity activity) {
|
||||
if (Build.VERSION.SDK_INT >= 31) {
|
||||
return Api31Impl.isLaunchedFromBubble(activity);
|
||||
}
|
||||
return Build.VERSION.SDK_INT == 30 ? (Api30Impl.getDisplay(activity) == null || Api30Impl.getDisplay(activity).getDisplayId() == 0) ? false : true : (Build.VERSION.SDK_INT != 29 || activity.getWindowManager().getDefaultDisplay() == null || activity.getWindowManager().getDefaultDisplay().getDisplayId() == 0) ? false : true;
|
||||
}
|
||||
|
||||
public static DragAndDropPermissionsCompat requestDragAndDropPermissions(Activity activity, DragEvent dragEvent) {
|
||||
return DragAndDropPermissionsCompat.request(activity, dragEvent);
|
||||
}
|
||||
|
||||
public static void recreate(final Activity activity) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
activity.recreate();
|
||||
} else {
|
||||
new Handler(activity.getMainLooper()).post(new Runnable() { // from class: androidx.core.app.ActivityCompat$$ExternalSyntheticLambda0
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
ActivityCompat.lambda$recreate$0(activity);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
static /* synthetic */ void lambda$recreate$0(Activity activity) {
|
||||
if (activity.isFinishing() || ActivityRecreator.recreate(activity)) {
|
||||
return;
|
||||
}
|
||||
activity.recreate();
|
||||
}
|
||||
|
||||
public static void setLocusContext(Activity activity, LocusIdCompat locusIdCompat, Bundle bundle) {
|
||||
if (Build.VERSION.SDK_INT >= 30) {
|
||||
Api30Impl.setLocusContext(activity, locusIdCompat, bundle);
|
||||
}
|
||||
}
|
||||
|
||||
static class SharedElementCallback21Impl extends android.app.SharedElementCallback {
|
||||
private final SharedElementCallback mCallback;
|
||||
|
||||
SharedElementCallback21Impl(SharedElementCallback sharedElementCallback) {
|
||||
this.mCallback = sharedElementCallback;
|
||||
}
|
||||
|
||||
@Override // android.app.SharedElementCallback
|
||||
public void onSharedElementStart(List<String> list, List<View> list2, List<View> list3) {
|
||||
this.mCallback.onSharedElementStart(list, list2, list3);
|
||||
}
|
||||
|
||||
@Override // android.app.SharedElementCallback
|
||||
public void onSharedElementEnd(List<String> list, List<View> list2, List<View> list3) {
|
||||
this.mCallback.onSharedElementEnd(list, list2, list3);
|
||||
}
|
||||
|
||||
@Override // android.app.SharedElementCallback
|
||||
public void onRejectSharedElements(List<View> list) {
|
||||
this.mCallback.onRejectSharedElements(list);
|
||||
}
|
||||
|
||||
@Override // android.app.SharedElementCallback
|
||||
public void onMapSharedElements(List<String> list, Map<String, View> map) {
|
||||
this.mCallback.onMapSharedElements(list, map);
|
||||
}
|
||||
|
||||
@Override // android.app.SharedElementCallback
|
||||
public Parcelable onCaptureSharedElementSnapshot(View view, Matrix matrix, RectF rectF) {
|
||||
return this.mCallback.onCaptureSharedElementSnapshot(view, matrix, rectF);
|
||||
}
|
||||
|
||||
@Override // android.app.SharedElementCallback
|
||||
public View onCreateSnapshotView(Context context, Parcelable parcelable) {
|
||||
return this.mCallback.onCreateSnapshotView(context, parcelable);
|
||||
}
|
||||
|
||||
@Override // android.app.SharedElementCallback
|
||||
public void onSharedElementsArrived(List<String> list, List<View> list2, final SharedElementCallback.OnSharedElementsReadyListener onSharedElementsReadyListener) {
|
||||
this.mCallback.onSharedElementsArrived(list, list2, new SharedElementCallback.OnSharedElementsReadyListener() { // from class: androidx.core.app.ActivityCompat$SharedElementCallback21Impl$$ExternalSyntheticLambda0
|
||||
@Override // androidx.core.app.SharedElementCallback.OnSharedElementsReadyListener
|
||||
public final void onSharedElementsReady() {
|
||||
ActivityCompat.Api23Impl.onSharedElementsReady(onSharedElementsReadyListener);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
static class Api30Impl {
|
||||
private Api30Impl() {
|
||||
}
|
||||
|
||||
static void setLocusContext(Activity activity, LocusIdCompat locusIdCompat, Bundle bundle) {
|
||||
activity.setLocusContext(locusIdCompat == null ? null : locusIdCompat.toLocusId(), bundle);
|
||||
}
|
||||
|
||||
static Display getDisplay(ContextWrapper contextWrapper) {
|
||||
return contextWrapper.getDisplay();
|
||||
}
|
||||
}
|
||||
|
||||
static class Api31Impl {
|
||||
private Api31Impl() {
|
||||
}
|
||||
|
||||
static boolean isLaunchedFromBubble(Activity activity) {
|
||||
return activity.isLaunchedFromBubble();
|
||||
}
|
||||
}
|
||||
|
||||
static class Api16Impl {
|
||||
private Api16Impl() {
|
||||
}
|
||||
|
||||
static void startActivityForResult(Activity activity, Intent intent, int i, Bundle bundle) {
|
||||
activity.startActivityForResult(intent, i, bundle);
|
||||
}
|
||||
|
||||
static void startIntentSenderForResult(Activity activity, IntentSender intentSender, int i, Intent intent, int i2, int i3, int i4, Bundle bundle) throws IntentSender.SendIntentException {
|
||||
activity.startIntentSenderForResult(intentSender, i, intent, i2, i3, i4, bundle);
|
||||
}
|
||||
|
||||
static void finishAffinity(Activity activity) {
|
||||
activity.finishAffinity();
|
||||
}
|
||||
}
|
||||
|
||||
static class Api21Impl {
|
||||
private Api21Impl() {
|
||||
}
|
||||
|
||||
static void finishAfterTransition(Activity activity) {
|
||||
activity.finishAfterTransition();
|
||||
}
|
||||
|
||||
static void setEnterSharedElementCallback(Activity activity, android.app.SharedElementCallback sharedElementCallback) {
|
||||
activity.setEnterSharedElementCallback(sharedElementCallback);
|
||||
}
|
||||
|
||||
static void setExitSharedElementCallback(Activity activity, android.app.SharedElementCallback sharedElementCallback) {
|
||||
activity.setExitSharedElementCallback(sharedElementCallback);
|
||||
}
|
||||
|
||||
static void postponeEnterTransition(Activity activity) {
|
||||
activity.postponeEnterTransition();
|
||||
}
|
||||
|
||||
static void startPostponedEnterTransition(Activity activity) {
|
||||
activity.startPostponedEnterTransition();
|
||||
}
|
||||
}
|
||||
|
||||
static class Api22Impl {
|
||||
private Api22Impl() {
|
||||
}
|
||||
|
||||
static Uri getReferrer(Activity activity) {
|
||||
return activity.getReferrer();
|
||||
}
|
||||
}
|
||||
|
||||
static class Api28Impl {
|
||||
private Api28Impl() {
|
||||
}
|
||||
|
||||
static <T> T requireViewById(Activity activity, int i) {
|
||||
return (T) activity.requireViewById(i);
|
||||
}
|
||||
}
|
||||
|
||||
static class Api23Impl {
|
||||
private Api23Impl() {
|
||||
}
|
||||
|
||||
static void requestPermissions(Activity activity, String[] strArr, int i) {
|
||||
activity.requestPermissions(strArr, i);
|
||||
}
|
||||
|
||||
static boolean shouldShowRequestPermissionRationale(Activity activity, String str) {
|
||||
return activity.shouldShowRequestPermissionRationale(str);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
public static void onSharedElementsReady(Object obj) {
|
||||
((SharedElementCallback.OnSharedElementsReadyListener) obj).onSharedElementsReady();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ActivityManagerCompat {
|
||||
private ActivityManagerCompat() {
|
||||
}
|
||||
|
||||
public static boolean isLowRamDevice(ActivityManager activityManager) {
|
||||
return activityManager.isLowRamDevice();
|
||||
}
|
||||
}
|
191
02-Easy5/E5/sources/androidx/core/app/ActivityOptionsCompat.java
Normal file
191
02-Easy5/E5/sources/androidx/core/app/ActivityOptionsCompat.java
Normal file
@ -0,0 +1,191 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityOptions;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import androidx.core.util.Pair;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ActivityOptionsCompat {
|
||||
public static final String EXTRA_USAGE_TIME_REPORT = "android.activity.usage_time";
|
||||
public static final String EXTRA_USAGE_TIME_REPORT_PACKAGES = "android.usage_time_packages";
|
||||
|
||||
public Rect getLaunchBounds() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void requestUsageTimeReport(PendingIntent pendingIntent) {
|
||||
}
|
||||
|
||||
public ActivityOptionsCompat setLaunchBounds(Rect rect) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Bundle toBundle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void update(ActivityOptionsCompat activityOptionsCompat) {
|
||||
}
|
||||
|
||||
public static ActivityOptionsCompat makeCustomAnimation(Context context, int i, int i2) {
|
||||
return new ActivityOptionsCompatImpl(Api16Impl.makeCustomAnimation(context, i, i2));
|
||||
}
|
||||
|
||||
public static ActivityOptionsCompat makeScaleUpAnimation(View view, int i, int i2, int i3, int i4) {
|
||||
return new ActivityOptionsCompatImpl(Api16Impl.makeScaleUpAnimation(view, i, i2, i3, i4));
|
||||
}
|
||||
|
||||
public static ActivityOptionsCompat makeClipRevealAnimation(View view, int i, int i2, int i3, int i4) {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
return new ActivityOptionsCompatImpl(Api23Impl.makeClipRevealAnimation(view, i, i2, i3, i4));
|
||||
}
|
||||
return new ActivityOptionsCompat();
|
||||
}
|
||||
|
||||
public static ActivityOptionsCompat makeThumbnailScaleUpAnimation(View view, Bitmap bitmap, int i, int i2) {
|
||||
return new ActivityOptionsCompatImpl(Api16Impl.makeThumbnailScaleUpAnimation(view, bitmap, i, i2));
|
||||
}
|
||||
|
||||
public static ActivityOptionsCompat makeSceneTransitionAnimation(Activity activity, View view, String str) {
|
||||
return new ActivityOptionsCompatImpl(Api21Impl.makeSceneTransitionAnimation(activity, view, str));
|
||||
}
|
||||
|
||||
public static ActivityOptionsCompat makeSceneTransitionAnimation(Activity activity, Pair<View, String>... pairArr) {
|
||||
android.util.Pair[] pairArr2;
|
||||
if (pairArr != null) {
|
||||
pairArr2 = new android.util.Pair[pairArr.length];
|
||||
for (int i = 0; i < pairArr.length; i++) {
|
||||
pairArr2[i] = android.util.Pair.create(pairArr[i].first, pairArr[i].second);
|
||||
}
|
||||
} else {
|
||||
pairArr2 = null;
|
||||
}
|
||||
return new ActivityOptionsCompatImpl(Api21Impl.makeSceneTransitionAnimation(activity, pairArr2));
|
||||
}
|
||||
|
||||
public static ActivityOptionsCompat makeTaskLaunchBehind() {
|
||||
return new ActivityOptionsCompatImpl(Api21Impl.makeTaskLaunchBehind());
|
||||
}
|
||||
|
||||
public static ActivityOptionsCompat makeBasic() {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
return new ActivityOptionsCompatImpl(Api23Impl.makeBasic());
|
||||
}
|
||||
return new ActivityOptionsCompat();
|
||||
}
|
||||
|
||||
private static class ActivityOptionsCompatImpl extends ActivityOptionsCompat {
|
||||
private final ActivityOptions mActivityOptions;
|
||||
|
||||
ActivityOptionsCompatImpl(ActivityOptions activityOptions) {
|
||||
this.mActivityOptions = activityOptions;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.ActivityOptionsCompat
|
||||
public Bundle toBundle() {
|
||||
return this.mActivityOptions.toBundle();
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.ActivityOptionsCompat
|
||||
public void update(ActivityOptionsCompat activityOptionsCompat) {
|
||||
if (activityOptionsCompat instanceof ActivityOptionsCompatImpl) {
|
||||
this.mActivityOptions.update(((ActivityOptionsCompatImpl) activityOptionsCompat).mActivityOptions);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.ActivityOptionsCompat
|
||||
public void requestUsageTimeReport(PendingIntent pendingIntent) {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
Api23Impl.requestUsageTimeReport(this.mActivityOptions, pendingIntent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.ActivityOptionsCompat
|
||||
public ActivityOptionsCompat setLaunchBounds(Rect rect) {
|
||||
return Build.VERSION.SDK_INT < 24 ? this : new ActivityOptionsCompatImpl(Api24Impl.setLaunchBounds(this.mActivityOptions, rect));
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.ActivityOptionsCompat
|
||||
public Rect getLaunchBounds() {
|
||||
if (Build.VERSION.SDK_INT < 24) {
|
||||
return null;
|
||||
}
|
||||
return Api24Impl.getLaunchBounds(this.mActivityOptions);
|
||||
}
|
||||
}
|
||||
|
||||
protected ActivityOptionsCompat() {
|
||||
}
|
||||
|
||||
static class Api16Impl {
|
||||
private Api16Impl() {
|
||||
}
|
||||
|
||||
static ActivityOptions makeCustomAnimation(Context context, int i, int i2) {
|
||||
return ActivityOptions.makeCustomAnimation(context, i, i2);
|
||||
}
|
||||
|
||||
static ActivityOptions makeScaleUpAnimation(View view, int i, int i2, int i3, int i4) {
|
||||
return ActivityOptions.makeScaleUpAnimation(view, i, i2, i3, i4);
|
||||
}
|
||||
|
||||
static ActivityOptions makeThumbnailScaleUpAnimation(View view, Bitmap bitmap, int i, int i2) {
|
||||
return ActivityOptions.makeThumbnailScaleUpAnimation(view, bitmap, i, i2);
|
||||
}
|
||||
}
|
||||
|
||||
static class Api23Impl {
|
||||
private Api23Impl() {
|
||||
}
|
||||
|
||||
static ActivityOptions makeClipRevealAnimation(View view, int i, int i2, int i3, int i4) {
|
||||
return ActivityOptions.makeClipRevealAnimation(view, i, i2, i3, i4);
|
||||
}
|
||||
|
||||
static ActivityOptions makeBasic() {
|
||||
return ActivityOptions.makeBasic();
|
||||
}
|
||||
|
||||
static void requestUsageTimeReport(ActivityOptions activityOptions, PendingIntent pendingIntent) {
|
||||
activityOptions.requestUsageTimeReport(pendingIntent);
|
||||
}
|
||||
}
|
||||
|
||||
static class Api21Impl {
|
||||
private Api21Impl() {
|
||||
}
|
||||
|
||||
static ActivityOptions makeSceneTransitionAnimation(Activity activity, View view, String str) {
|
||||
return ActivityOptions.makeSceneTransitionAnimation(activity, view, str);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
static ActivityOptions makeSceneTransitionAnimation(Activity activity, android.util.Pair<View, String>... pairArr) {
|
||||
return ActivityOptions.makeSceneTransitionAnimation(activity, pairArr);
|
||||
}
|
||||
|
||||
static ActivityOptions makeTaskLaunchBehind() {
|
||||
return ActivityOptions.makeTaskLaunchBehind();
|
||||
}
|
||||
}
|
||||
|
||||
static class Api24Impl {
|
||||
private Api24Impl() {
|
||||
}
|
||||
|
||||
static ActivityOptions setLaunchBounds(ActivityOptions activityOptions, Rect rect) {
|
||||
return activityOptions.setLaunchBounds(rect);
|
||||
}
|
||||
|
||||
static Rect getLaunchBounds(ActivityOptions activityOptions) {
|
||||
return activityOptions.getLaunchBounds();
|
||||
}
|
||||
}
|
||||
}
|
249
02-Easy5/E5/sources/androidx/core/app/ActivityRecreator.java
Normal file
249
02-Easy5/E5/sources/androidx/core/app/ActivityRecreator.java
Normal file
@ -0,0 +1,249 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class ActivityRecreator {
|
||||
private static final String LOG_TAG = "ActivityRecreator";
|
||||
protected static final Class<?> activityThreadClass;
|
||||
private static final Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||
protected static final Field mainThreadField;
|
||||
protected static final Method performStopActivity2ParamsMethod;
|
||||
protected static final Method performStopActivity3ParamsMethod;
|
||||
protected static final Method requestRelaunchActivityMethod;
|
||||
protected static final Field tokenField;
|
||||
|
||||
private static boolean needsRelaunchCall() {
|
||||
return Build.VERSION.SDK_INT == 26 || Build.VERSION.SDK_INT == 27;
|
||||
}
|
||||
|
||||
private ActivityRecreator() {
|
||||
}
|
||||
|
||||
static {
|
||||
Class<?> activityThreadClass2 = getActivityThreadClass();
|
||||
activityThreadClass = activityThreadClass2;
|
||||
mainThreadField = getMainThreadField();
|
||||
tokenField = getTokenField();
|
||||
performStopActivity3ParamsMethod = getPerformStopActivity3Params(activityThreadClass2);
|
||||
performStopActivity2ParamsMethod = getPerformStopActivity2Params(activityThreadClass2);
|
||||
requestRelaunchActivityMethod = getRequestRelaunchActivityMethod(activityThreadClass2);
|
||||
}
|
||||
|
||||
static boolean recreate(Activity activity) {
|
||||
Object obj;
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
activity.recreate();
|
||||
return true;
|
||||
}
|
||||
if (needsRelaunchCall() && requestRelaunchActivityMethod == null) {
|
||||
return false;
|
||||
}
|
||||
if (performStopActivity2ParamsMethod == null && performStopActivity3ParamsMethod == null) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
final Object obj2 = tokenField.get(activity);
|
||||
if (obj2 == null || (obj = mainThreadField.get(activity)) == null) {
|
||||
return false;
|
||||
}
|
||||
final Application application = activity.getApplication();
|
||||
final LifecycleCheckCallbacks lifecycleCheckCallbacks = new LifecycleCheckCallbacks(activity);
|
||||
application.registerActivityLifecycleCallbacks(lifecycleCheckCallbacks);
|
||||
Handler handler = mainHandler;
|
||||
handler.post(new Runnable() { // from class: androidx.core.app.ActivityRecreator.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
LifecycleCheckCallbacks.this.currentlyRecreatingToken = obj2;
|
||||
}
|
||||
});
|
||||
try {
|
||||
if (needsRelaunchCall()) {
|
||||
requestRelaunchActivityMethod.invoke(obj, obj2, null, null, 0, false, null, null, false, false);
|
||||
} else {
|
||||
activity.recreate();
|
||||
}
|
||||
handler.post(new Runnable() { // from class: androidx.core.app.ActivityRecreator.2
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
application.unregisterActivityLifecycleCallbacks(lifecycleCheckCallbacks);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
} catch (Throwable th) {
|
||||
mainHandler.post(new Runnable() { // from class: androidx.core.app.ActivityRecreator.2
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
application.unregisterActivityLifecycleCallbacks(lifecycleCheckCallbacks);
|
||||
}
|
||||
});
|
||||
throw th;
|
||||
}
|
||||
} catch (Throwable unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class LifecycleCheckCallbacks implements Application.ActivityLifecycleCallbacks {
|
||||
Object currentlyRecreatingToken;
|
||||
private Activity mActivity;
|
||||
private final int mRecreatingHashCode;
|
||||
private boolean mStarted = false;
|
||||
private boolean mDestroyed = false;
|
||||
private boolean mStopQueued = false;
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityCreated(Activity activity, Bundle bundle) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityDestroyed(Activity activity) {
|
||||
if (this.mActivity == activity) {
|
||||
this.mActivity = null;
|
||||
this.mDestroyed = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityResumed(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityStarted(Activity activity) {
|
||||
if (this.mActivity == activity) {
|
||||
this.mStarted = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityStopped(Activity activity) {
|
||||
}
|
||||
|
||||
LifecycleCheckCallbacks(Activity activity) {
|
||||
this.mActivity = activity;
|
||||
this.mRecreatingHashCode = activity.hashCode();
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityPaused(Activity activity) {
|
||||
if (!this.mDestroyed || this.mStopQueued || this.mStarted || !ActivityRecreator.queueOnStopIfNecessary(this.currentlyRecreatingToken, this.mRecreatingHashCode, activity)) {
|
||||
return;
|
||||
}
|
||||
this.mStopQueued = true;
|
||||
this.currentlyRecreatingToken = null;
|
||||
}
|
||||
}
|
||||
|
||||
protected static boolean queueOnStopIfNecessary(Object obj, int i, Activity activity) {
|
||||
try {
|
||||
final Object obj2 = tokenField.get(activity);
|
||||
if (obj2 == obj && activity.hashCode() == i) {
|
||||
final Object obj3 = mainThreadField.get(activity);
|
||||
mainHandler.postAtFrontOfQueue(new Runnable() { // from class: androidx.core.app.ActivityRecreator.3
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
try {
|
||||
if (ActivityRecreator.performStopActivity3ParamsMethod != null) {
|
||||
ActivityRecreator.performStopActivity3ParamsMethod.invoke(obj3, obj2, false, "AppCompat recreation");
|
||||
} else {
|
||||
ActivityRecreator.performStopActivity2ParamsMethod.invoke(obj3, obj2, false);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
if (e.getClass() == RuntimeException.class && e.getMessage() != null && e.getMessage().startsWith("Unable to stop")) {
|
||||
throw e;
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
Log.e(ActivityRecreator.LOG_TAG, "Exception while invoking performStopActivity", th);
|
||||
}
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} catch (Throwable th) {
|
||||
Log.e(LOG_TAG, "Exception while fetching field values", th);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static Method getPerformStopActivity3Params(Class<?> cls) {
|
||||
if (cls == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
Method declaredMethod = cls.getDeclaredMethod("performStopActivity", IBinder.class, Boolean.TYPE, String.class);
|
||||
declaredMethod.setAccessible(true);
|
||||
return declaredMethod;
|
||||
} catch (Throwable unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static Method getPerformStopActivity2Params(Class<?> cls) {
|
||||
if (cls == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
Method declaredMethod = cls.getDeclaredMethod("performStopActivity", IBinder.class, Boolean.TYPE);
|
||||
declaredMethod.setAccessible(true);
|
||||
return declaredMethod;
|
||||
} catch (Throwable unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static Method getRequestRelaunchActivityMethod(Class<?> cls) {
|
||||
if (needsRelaunchCall() && cls != null) {
|
||||
try {
|
||||
Method declaredMethod = cls.getDeclaredMethod("requestRelaunchActivity", IBinder.class, List.class, List.class, Integer.TYPE, Boolean.TYPE, Configuration.class, Configuration.class, Boolean.TYPE, Boolean.TYPE);
|
||||
declaredMethod.setAccessible(true);
|
||||
return declaredMethod;
|
||||
} catch (Throwable unused) {
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static Field getMainThreadField() {
|
||||
try {
|
||||
Field declaredField = Activity.class.getDeclaredField("mMainThread");
|
||||
declaredField.setAccessible(true);
|
||||
return declaredField;
|
||||
} catch (Throwable unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static Field getTokenField() {
|
||||
try {
|
||||
Field declaredField = Activity.class.getDeclaredField("mToken");
|
||||
declaredField.setAccessible(true);
|
||||
return declaredField;
|
||||
} catch (Throwable unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static Class<?> getActivityThreadClass() {
|
||||
try {
|
||||
return Class.forName("android.app.ActivityThread");
|
||||
} catch (Throwable unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.AlarmManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.os.Build;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class AlarmManagerCompat {
|
||||
public static void setAlarmClock(AlarmManager alarmManager, long j, PendingIntent pendingIntent, PendingIntent pendingIntent2) {
|
||||
Api21Impl.setAlarmClock(alarmManager, Api21Impl.createAlarmClockInfo(j, pendingIntent), pendingIntent2);
|
||||
}
|
||||
|
||||
public static void setAndAllowWhileIdle(AlarmManager alarmManager, int i, long j, PendingIntent pendingIntent) {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
Api23Impl.setAndAllowWhileIdle(alarmManager, i, j, pendingIntent);
|
||||
} else {
|
||||
alarmManager.set(i, j, pendingIntent);
|
||||
}
|
||||
}
|
||||
|
||||
public static void setExact(AlarmManager alarmManager, int i, long j, PendingIntent pendingIntent) {
|
||||
Api19Impl.setExact(alarmManager, i, j, pendingIntent);
|
||||
}
|
||||
|
||||
public static void setExactAndAllowWhileIdle(AlarmManager alarmManager, int i, long j, PendingIntent pendingIntent) {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
Api23Impl.setExactAndAllowWhileIdle(alarmManager, i, j, pendingIntent);
|
||||
} else {
|
||||
setExact(alarmManager, i, j, pendingIntent);
|
||||
}
|
||||
}
|
||||
|
||||
private AlarmManagerCompat() {
|
||||
}
|
||||
|
||||
static class Api21Impl {
|
||||
private Api21Impl() {
|
||||
}
|
||||
|
||||
static void setAlarmClock(AlarmManager alarmManager, Object obj, PendingIntent pendingIntent) {
|
||||
alarmManager.setAlarmClock((AlarmManager.AlarmClockInfo) obj, pendingIntent);
|
||||
}
|
||||
|
||||
static AlarmManager.AlarmClockInfo createAlarmClockInfo(long j, PendingIntent pendingIntent) {
|
||||
return new AlarmManager.AlarmClockInfo(j, pendingIntent);
|
||||
}
|
||||
}
|
||||
|
||||
static class Api23Impl {
|
||||
private Api23Impl() {
|
||||
}
|
||||
|
||||
static void setAndAllowWhileIdle(AlarmManager alarmManager, int i, long j, PendingIntent pendingIntent) {
|
||||
alarmManager.setAndAllowWhileIdle(i, j, pendingIntent);
|
||||
}
|
||||
|
||||
static void setExactAndAllowWhileIdle(AlarmManager alarmManager, int i, long j, PendingIntent pendingIntent) {
|
||||
alarmManager.setExactAndAllowWhileIdle(i, j, pendingIntent);
|
||||
}
|
||||
}
|
||||
|
||||
static class Api19Impl {
|
||||
private Api19Impl() {
|
||||
}
|
||||
|
||||
static void setExact(AlarmManager alarmManager, int i, long j, PendingIntent pendingIntent) {
|
||||
alarmManager.setExact(i, j, pendingIntent);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.app.Service;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ContentProvider;
|
||||
import android.content.Intent;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppComponentFactory extends android.app.AppComponentFactory {
|
||||
@Override // android.app.AppComponentFactory
|
||||
public final Activity instantiateActivity(ClassLoader classLoader, String str, Intent intent) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
return (Activity) CoreComponentFactory.checkCompatWrapper(instantiateActivityCompat(classLoader, str, intent));
|
||||
}
|
||||
|
||||
@Override // android.app.AppComponentFactory
|
||||
public final Application instantiateApplication(ClassLoader classLoader, String str) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
return (Application) CoreComponentFactory.checkCompatWrapper(instantiateApplicationCompat(classLoader, str));
|
||||
}
|
||||
|
||||
@Override // android.app.AppComponentFactory
|
||||
public final BroadcastReceiver instantiateReceiver(ClassLoader classLoader, String str, Intent intent) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
return (BroadcastReceiver) CoreComponentFactory.checkCompatWrapper(instantiateReceiverCompat(classLoader, str, intent));
|
||||
}
|
||||
|
||||
@Override // android.app.AppComponentFactory
|
||||
public final ContentProvider instantiateProvider(ClassLoader classLoader, String str) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
return (ContentProvider) CoreComponentFactory.checkCompatWrapper(instantiateProviderCompat(classLoader, str));
|
||||
}
|
||||
|
||||
@Override // android.app.AppComponentFactory
|
||||
public final Service instantiateService(ClassLoader classLoader, String str, Intent intent) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
return (Service) CoreComponentFactory.checkCompatWrapper(instantiateServiceCompat(classLoader, str, intent));
|
||||
}
|
||||
|
||||
public Application instantiateApplicationCompat(ClassLoader classLoader, String str) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
try {
|
||||
return (Application) Class.forName(str, false, classLoader).asSubclass(Application.class).getDeclaredConstructor(new Class[0]).newInstance(new Object[0]);
|
||||
} catch (NoSuchMethodException | InvocationTargetException e) {
|
||||
throw new RuntimeException("Couldn't call constructor", e);
|
||||
}
|
||||
}
|
||||
|
||||
public Activity instantiateActivityCompat(ClassLoader classLoader, String str, Intent intent) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
try {
|
||||
return (Activity) Class.forName(str, false, classLoader).asSubclass(Activity.class).getDeclaredConstructor(new Class[0]).newInstance(new Object[0]);
|
||||
} catch (NoSuchMethodException | InvocationTargetException e) {
|
||||
throw new RuntimeException("Couldn't call constructor", e);
|
||||
}
|
||||
}
|
||||
|
||||
public BroadcastReceiver instantiateReceiverCompat(ClassLoader classLoader, String str, Intent intent) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
try {
|
||||
return (BroadcastReceiver) Class.forName(str, false, classLoader).asSubclass(BroadcastReceiver.class).getDeclaredConstructor(new Class[0]).newInstance(new Object[0]);
|
||||
} catch (NoSuchMethodException | InvocationTargetException e) {
|
||||
throw new RuntimeException("Couldn't call constructor", e);
|
||||
}
|
||||
}
|
||||
|
||||
public Service instantiateServiceCompat(ClassLoader classLoader, String str, Intent intent) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
try {
|
||||
return (Service) Class.forName(str, false, classLoader).asSubclass(Service.class).getDeclaredConstructor(new Class[0]).newInstance(new Object[0]);
|
||||
} catch (NoSuchMethodException | InvocationTargetException e) {
|
||||
throw new RuntimeException("Couldn't call constructor", e);
|
||||
}
|
||||
}
|
||||
|
||||
public ContentProvider instantiateProviderCompat(ClassLoader classLoader, String str) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
try {
|
||||
return (ContentProvider) Class.forName(str, false, classLoader).asSubclass(ContentProvider.class).getDeclaredConstructor(new Class[0]).newInstance(new Object[0]);
|
||||
} catch (NoSuchMethodException | InvocationTargetException e) {
|
||||
throw new RuntimeException("Couldn't call constructor", e);
|
||||
}
|
||||
}
|
||||
}
|
32
02-Easy5/E5/sources/androidx/core/app/AppLaunchChecker.java
Normal file
32
02-Easy5/E5/sources/androidx/core/app/AppLaunchChecker.java
Normal file
@ -0,0 +1,32 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import androidx.core.content.IntentCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AppLaunchChecker {
|
||||
private static final String KEY_STARTED_FROM_LAUNCHER = "startedFromLauncher";
|
||||
private static final String SHARED_PREFS_NAME = "android.support.AppLaunchChecker";
|
||||
|
||||
public static boolean hasStartedFromLauncher(Context context) {
|
||||
return context.getSharedPreferences(SHARED_PREFS_NAME, 0).getBoolean(KEY_STARTED_FROM_LAUNCHER, false);
|
||||
}
|
||||
|
||||
public static void onActivityCreate(Activity activity) {
|
||||
Intent intent;
|
||||
SharedPreferences sharedPreferences = activity.getSharedPreferences(SHARED_PREFS_NAME, 0);
|
||||
if (sharedPreferences.getBoolean(KEY_STARTED_FROM_LAUNCHER, false) || (intent = activity.getIntent()) == null || !"android.intent.action.MAIN".equals(intent.getAction())) {
|
||||
return;
|
||||
}
|
||||
if (intent.hasCategory("android.intent.category.LAUNCHER") || intent.hasCategory(IntentCompat.CATEGORY_LEANBACK_LAUNCHER)) {
|
||||
sharedPreferences.edit().putBoolean(KEY_STARTED_FROM_LAUNCHER, true).apply();
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public AppLaunchChecker() {
|
||||
}
|
||||
}
|
109
02-Easy5/E5/sources/androidx/core/app/AppOpsManagerCompat.java
Normal file
109
02-Easy5/E5/sources/androidx/core/app/AppOpsManagerCompat.java
Normal file
@ -0,0 +1,109 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.AppOpsManager;
|
||||
import android.content.Context;
|
||||
import android.os.Binder;
|
||||
import android.os.Build;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class AppOpsManagerCompat {
|
||||
public static final int MODE_ALLOWED = 0;
|
||||
public static final int MODE_DEFAULT = 3;
|
||||
public static final int MODE_ERRORED = 2;
|
||||
public static final int MODE_IGNORED = 1;
|
||||
|
||||
private AppOpsManagerCompat() {
|
||||
}
|
||||
|
||||
public static String permissionToOp(String str) {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
return Api23Impl.permissionToOp(str);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int noteOp(Context context, String str, int i, String str2) {
|
||||
return Api19Impl.noteOp((AppOpsManager) context.getSystemService("appops"), str, i, str2);
|
||||
}
|
||||
|
||||
public static int noteOpNoThrow(Context context, String str, int i, String str2) {
|
||||
return Api19Impl.noteOpNoThrow((AppOpsManager) context.getSystemService("appops"), str, i, str2);
|
||||
}
|
||||
|
||||
public static int noteProxyOp(Context context, String str, String str2) {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
return Api23Impl.noteProxyOp((AppOpsManager) Api23Impl.getSystemService(context, AppOpsManager.class), str, str2);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
public static int noteProxyOpNoThrow(Context context, String str, String str2) {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
return Api23Impl.noteProxyOpNoThrow((AppOpsManager) Api23Impl.getSystemService(context, AppOpsManager.class), str, str2);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
public static int checkOrNoteProxyOp(Context context, int i, String str, String str2) {
|
||||
if (Build.VERSION.SDK_INT >= 29) {
|
||||
AppOpsManager systemService = Api29Impl.getSystemService(context);
|
||||
int checkOpNoThrow = Api29Impl.checkOpNoThrow(systemService, str, Binder.getCallingUid(), str2);
|
||||
return checkOpNoThrow != 0 ? checkOpNoThrow : Api29Impl.checkOpNoThrow(systemService, str, i, Api29Impl.getOpPackageName(context));
|
||||
}
|
||||
return noteProxyOpNoThrow(context, str, str2);
|
||||
}
|
||||
|
||||
static class Api29Impl {
|
||||
private Api29Impl() {
|
||||
}
|
||||
|
||||
static AppOpsManager getSystemService(Context context) {
|
||||
return (AppOpsManager) context.getSystemService(AppOpsManager.class);
|
||||
}
|
||||
|
||||
static int checkOpNoThrow(AppOpsManager appOpsManager, String str, int i, String str2) {
|
||||
if (appOpsManager == null) {
|
||||
return 1;
|
||||
}
|
||||
return appOpsManager.checkOpNoThrow(str, i, str2);
|
||||
}
|
||||
|
||||
static String getOpPackageName(Context context) {
|
||||
return context.getOpPackageName();
|
||||
}
|
||||
}
|
||||
|
||||
static class Api23Impl {
|
||||
private Api23Impl() {
|
||||
}
|
||||
|
||||
static String permissionToOp(String str) {
|
||||
return AppOpsManager.permissionToOp(str);
|
||||
}
|
||||
|
||||
static <T> T getSystemService(Context context, Class<T> cls) {
|
||||
return (T) context.getSystemService(cls);
|
||||
}
|
||||
|
||||
static int noteProxyOp(AppOpsManager appOpsManager, String str, String str2) {
|
||||
return appOpsManager.noteProxyOp(str, str2);
|
||||
}
|
||||
|
||||
static int noteProxyOpNoThrow(AppOpsManager appOpsManager, String str, String str2) {
|
||||
return appOpsManager.noteProxyOpNoThrow(str, str2);
|
||||
}
|
||||
}
|
||||
|
||||
static class Api19Impl {
|
||||
private Api19Impl() {
|
||||
}
|
||||
|
||||
static int noteOpNoThrow(AppOpsManager appOpsManager, String str, int i, String str2) {
|
||||
return appOpsManager.noteOpNoThrow(str, i, str2);
|
||||
}
|
||||
|
||||
static int noteOp(AppOpsManager appOpsManager, String str, int i, String str2) {
|
||||
return appOpsManager.noteOp(str, i, str2);
|
||||
}
|
||||
}
|
||||
}
|
91
02-Easy5/E5/sources/androidx/core/app/BundleCompat.java
Normal file
91
02-Easy5/E5/sources/androidx/core/app/BundleCompat.java
Normal file
@ -0,0 +1,91 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.util.Log;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class BundleCompat {
|
||||
|
||||
static class BeforeApi18Impl {
|
||||
private static final String TAG = "BundleCompatBaseImpl";
|
||||
private static Method sGetIBinderMethod;
|
||||
private static boolean sGetIBinderMethodFetched;
|
||||
private static Method sPutIBinderMethod;
|
||||
private static boolean sPutIBinderMethodFetched;
|
||||
|
||||
private BeforeApi18Impl() {
|
||||
}
|
||||
|
||||
public static IBinder getBinder(Bundle bundle, String str) {
|
||||
if (!sGetIBinderMethodFetched) {
|
||||
try {
|
||||
Method method = Bundle.class.getMethod("getIBinder", String.class);
|
||||
sGetIBinderMethod = method;
|
||||
method.setAccessible(true);
|
||||
} catch (NoSuchMethodException e) {
|
||||
Log.i(TAG, "Failed to retrieve getIBinder method", e);
|
||||
}
|
||||
sGetIBinderMethodFetched = true;
|
||||
}
|
||||
Method method2 = sGetIBinderMethod;
|
||||
if (method2 != null) {
|
||||
try {
|
||||
return (IBinder) method2.invoke(bundle, str);
|
||||
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e2) {
|
||||
Log.i(TAG, "Failed to invoke getIBinder via reflection", e2);
|
||||
sGetIBinderMethod = null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void putBinder(Bundle bundle, String str, IBinder iBinder) {
|
||||
if (!sPutIBinderMethodFetched) {
|
||||
try {
|
||||
Method method = Bundle.class.getMethod("putIBinder", String.class, IBinder.class);
|
||||
sPutIBinderMethod = method;
|
||||
method.setAccessible(true);
|
||||
} catch (NoSuchMethodException e) {
|
||||
Log.i(TAG, "Failed to retrieve putIBinder method", e);
|
||||
}
|
||||
sPutIBinderMethodFetched = true;
|
||||
}
|
||||
Method method2 = sPutIBinderMethod;
|
||||
if (method2 != null) {
|
||||
try {
|
||||
method2.invoke(bundle, str, iBinder);
|
||||
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e2) {
|
||||
Log.i(TAG, "Failed to invoke putIBinder via reflection", e2);
|
||||
sPutIBinderMethod = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private BundleCompat() {
|
||||
}
|
||||
|
||||
public static IBinder getBinder(Bundle bundle, String str) {
|
||||
return Api18Impl.getBinder(bundle, str);
|
||||
}
|
||||
|
||||
public static void putBinder(Bundle bundle, String str, IBinder iBinder) {
|
||||
Api18Impl.putBinder(bundle, str, iBinder);
|
||||
}
|
||||
|
||||
static class Api18Impl {
|
||||
private Api18Impl() {
|
||||
}
|
||||
|
||||
static IBinder getBinder(Bundle bundle, String str) {
|
||||
return bundle.getBinder(str);
|
||||
}
|
||||
|
||||
static void putBinder(Bundle bundle, String str, IBinder iBinder) {
|
||||
bundle.putBinder(str, iBinder);
|
||||
}
|
||||
}
|
||||
}
|
99
02-Easy5/E5/sources/androidx/core/app/ComponentActivity.java
Normal file
99
02-Easy5/E5/sources/androidx/core/app/ComponentActivity.java
Normal file
@ -0,0 +1,99 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import androidx.collection.SimpleArrayMap;
|
||||
import androidx.core.os.BuildCompat;
|
||||
import androidx.core.view.KeyEventDispatcher;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.lifecycle.LifecycleRegistry;
|
||||
import androidx.lifecycle.ReportFragment;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ComponentActivity extends Activity implements LifecycleOwner, KeyEventDispatcher.Component {
|
||||
private SimpleArrayMap<Class<? extends ExtraData>, ExtraData> mExtraDataMap = new SimpleArrayMap<>();
|
||||
private LifecycleRegistry mLifecycleRegistry = new LifecycleRegistry(this);
|
||||
|
||||
@Deprecated
|
||||
public static class ExtraData {
|
||||
}
|
||||
|
||||
public Lifecycle getLifecycle() {
|
||||
return this.mLifecycleRegistry;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Deprecated
|
||||
public void putExtraData(ExtraData extraData) {
|
||||
this.mExtraDataMap.put(extraData.getClass(), extraData);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
ReportFragment.injectIfNeededIn(this);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onSaveInstanceState(Bundle bundle) {
|
||||
this.mLifecycleRegistry.markState(Lifecycle.State.CREATED);
|
||||
super.onSaveInstanceState(bundle);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public <T extends ExtraData> T getExtraData(Class<T> cls) {
|
||||
return (T) this.mExtraDataMap.get(cls);
|
||||
}
|
||||
|
||||
@Override // androidx.core.view.KeyEventDispatcher.Component
|
||||
public boolean superDispatchKeyEvent(KeyEvent keyEvent) {
|
||||
return super.dispatchKeyEvent(keyEvent);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.Window.Callback
|
||||
public boolean dispatchKeyShortcutEvent(KeyEvent keyEvent) {
|
||||
View decorView = getWindow().getDecorView();
|
||||
if (decorView == null || !KeyEventDispatcher.dispatchBeforeHierarchy(decorView, keyEvent)) {
|
||||
return super.dispatchKeyShortcutEvent(keyEvent);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.Window.Callback
|
||||
public boolean dispatchKeyEvent(KeyEvent keyEvent) {
|
||||
View decorView = getWindow().getDecorView();
|
||||
if (decorView == null || !KeyEventDispatcher.dispatchBeforeHierarchy(decorView, keyEvent)) {
|
||||
return KeyEventDispatcher.dispatchKeyEvent(this, decorView, this, keyEvent);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected final boolean shouldDumpInternalState(String[] strArr) {
|
||||
return !shouldSkipDump(strArr);
|
||||
}
|
||||
|
||||
private static boolean shouldSkipDump(String[] strArr) {
|
||||
if (strArr == null || strArr.length <= 0) {
|
||||
return false;
|
||||
}
|
||||
String str = strArr[0];
|
||||
str.hashCode();
|
||||
switch (str) {
|
||||
case "--translation":
|
||||
return Build.VERSION.SDK_INT >= 31;
|
||||
case "--dump-dumpable":
|
||||
case "--list-dumpables":
|
||||
return BuildCompat.isAtLeastT();
|
||||
case "--contentcapture":
|
||||
return Build.VERSION.SDK_INT >= 29;
|
||||
case "--autofill":
|
||||
return Build.VERSION.SDK_INT >= 26;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.app.Service;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ContentProvider;
|
||||
import android.content.Intent;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class CoreComponentFactory extends android.app.AppComponentFactory {
|
||||
|
||||
public interface CompatWrapped {
|
||||
Object getWrapper();
|
||||
}
|
||||
|
||||
@Override // android.app.AppComponentFactory
|
||||
public Activity instantiateActivity(ClassLoader classLoader, String str, Intent intent) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
return (Activity) checkCompatWrapper(super.instantiateActivity(classLoader, str, intent));
|
||||
}
|
||||
|
||||
@Override // android.app.AppComponentFactory
|
||||
public Application instantiateApplication(ClassLoader classLoader, String str) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
return (Application) checkCompatWrapper(super.instantiateApplication(classLoader, str));
|
||||
}
|
||||
|
||||
@Override // android.app.AppComponentFactory
|
||||
public BroadcastReceiver instantiateReceiver(ClassLoader classLoader, String str, Intent intent) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
return (BroadcastReceiver) checkCompatWrapper(super.instantiateReceiver(classLoader, str, intent));
|
||||
}
|
||||
|
||||
@Override // android.app.AppComponentFactory
|
||||
public ContentProvider instantiateProvider(ClassLoader classLoader, String str) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
return (ContentProvider) checkCompatWrapper(super.instantiateProvider(classLoader, str));
|
||||
}
|
||||
|
||||
@Override // android.app.AppComponentFactory
|
||||
public Service instantiateService(ClassLoader classLoader, String str, Intent intent) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
return (Service) checkCompatWrapper(super.instantiateService(classLoader, str, intent));
|
||||
}
|
||||
|
||||
static <T> T checkCompatWrapper(T t) {
|
||||
T t2;
|
||||
return (!(t instanceof CompatWrapped) || (t2 = (T) ((CompatWrapped) t).getWrapper()) == null) ? t : t2;
|
||||
}
|
||||
}
|
31
02-Easy5/E5/sources/androidx/core/app/DialogCompat.java
Normal file
31
02-Easy5/E5/sources/androidx/core/app/DialogCompat.java
Normal file
@ -0,0 +1,31 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.os.Build;
|
||||
import android.view.View;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DialogCompat {
|
||||
private DialogCompat() {
|
||||
}
|
||||
|
||||
public static View requireViewById(Dialog dialog, int i) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
return (View) Api28Impl.requireViewById(dialog, i);
|
||||
}
|
||||
View findViewById = dialog.findViewById(i);
|
||||
if (findViewById != null) {
|
||||
return findViewById;
|
||||
}
|
||||
throw new IllegalArgumentException("ID does not reference a View inside this Dialog");
|
||||
}
|
||||
|
||||
static class Api28Impl {
|
||||
private Api28Impl() {
|
||||
}
|
||||
|
||||
static <T> T requireViewById(Dialog dialog, int i) {
|
||||
return (T) dialog.requireViewById(i);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,223 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.util.SparseIntArray;
|
||||
import android.view.FrameMetrics;
|
||||
import android.view.Window;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class FrameMetricsAggregator {
|
||||
public static final int ANIMATION_DURATION = 256;
|
||||
public static final int ANIMATION_INDEX = 8;
|
||||
public static final int COMMAND_DURATION = 32;
|
||||
public static final int COMMAND_INDEX = 5;
|
||||
public static final int DELAY_DURATION = 128;
|
||||
public static final int DELAY_INDEX = 7;
|
||||
public static final int DRAW_DURATION = 8;
|
||||
public static final int DRAW_INDEX = 3;
|
||||
public static final int EVERY_DURATION = 511;
|
||||
public static final int INPUT_DURATION = 2;
|
||||
public static final int INPUT_INDEX = 1;
|
||||
private static final int LAST_INDEX = 8;
|
||||
public static final int LAYOUT_MEASURE_DURATION = 4;
|
||||
public static final int LAYOUT_MEASURE_INDEX = 2;
|
||||
public static final int SWAP_DURATION = 64;
|
||||
public static final int SWAP_INDEX = 6;
|
||||
public static final int SYNC_DURATION = 16;
|
||||
public static final int SYNC_INDEX = 4;
|
||||
public static final int TOTAL_DURATION = 1;
|
||||
public static final int TOTAL_INDEX = 0;
|
||||
private final FrameMetricsBaseImpl mInstance;
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface MetricType {
|
||||
}
|
||||
|
||||
public FrameMetricsAggregator() {
|
||||
this(1);
|
||||
}
|
||||
|
||||
public FrameMetricsAggregator(int i) {
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
this.mInstance = new FrameMetricsApi24Impl(i);
|
||||
} else {
|
||||
this.mInstance = new FrameMetricsBaseImpl();
|
||||
}
|
||||
}
|
||||
|
||||
public void add(Activity activity) {
|
||||
this.mInstance.add(activity);
|
||||
}
|
||||
|
||||
public SparseIntArray[] remove(Activity activity) {
|
||||
return this.mInstance.remove(activity);
|
||||
}
|
||||
|
||||
public SparseIntArray[] stop() {
|
||||
return this.mInstance.stop();
|
||||
}
|
||||
|
||||
public SparseIntArray[] reset() {
|
||||
return this.mInstance.reset();
|
||||
}
|
||||
|
||||
public SparseIntArray[] getMetrics() {
|
||||
return this.mInstance.getMetrics();
|
||||
}
|
||||
|
||||
private static class FrameMetricsBaseImpl {
|
||||
public void add(Activity activity) {
|
||||
}
|
||||
|
||||
public SparseIntArray[] getMetrics() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public SparseIntArray[] remove(Activity activity) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public SparseIntArray[] reset() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public SparseIntArray[] stop() {
|
||||
return null;
|
||||
}
|
||||
|
||||
FrameMetricsBaseImpl() {
|
||||
}
|
||||
}
|
||||
|
||||
private static class FrameMetricsApi24Impl extends FrameMetricsBaseImpl {
|
||||
private static final int NANOS_PER_MS = 1000000;
|
||||
private static final int NANOS_ROUNDING_VALUE = 500000;
|
||||
private static Handler sHandler;
|
||||
private static HandlerThread sHandlerThread;
|
||||
int mTrackingFlags;
|
||||
SparseIntArray[] mMetrics = new SparseIntArray[9];
|
||||
private final ArrayList<WeakReference<Activity>> mActivities = new ArrayList<>();
|
||||
Window.OnFrameMetricsAvailableListener mListener = new Window.OnFrameMetricsAvailableListener() { // from class: androidx.core.app.FrameMetricsAggregator.FrameMetricsApi24Impl.1
|
||||
@Override // android.view.Window.OnFrameMetricsAvailableListener
|
||||
public void onFrameMetricsAvailable(Window window, FrameMetrics frameMetrics, int i) {
|
||||
if ((FrameMetricsApi24Impl.this.mTrackingFlags & 1) != 0) {
|
||||
FrameMetricsApi24Impl frameMetricsApi24Impl = FrameMetricsApi24Impl.this;
|
||||
frameMetricsApi24Impl.addDurationItem(frameMetricsApi24Impl.mMetrics[0], frameMetrics.getMetric(8));
|
||||
}
|
||||
if ((FrameMetricsApi24Impl.this.mTrackingFlags & 2) != 0) {
|
||||
FrameMetricsApi24Impl frameMetricsApi24Impl2 = FrameMetricsApi24Impl.this;
|
||||
frameMetricsApi24Impl2.addDurationItem(frameMetricsApi24Impl2.mMetrics[1], frameMetrics.getMetric(1));
|
||||
}
|
||||
if ((FrameMetricsApi24Impl.this.mTrackingFlags & 4) != 0) {
|
||||
FrameMetricsApi24Impl frameMetricsApi24Impl3 = FrameMetricsApi24Impl.this;
|
||||
frameMetricsApi24Impl3.addDurationItem(frameMetricsApi24Impl3.mMetrics[2], frameMetrics.getMetric(3));
|
||||
}
|
||||
if ((FrameMetricsApi24Impl.this.mTrackingFlags & 8) != 0) {
|
||||
FrameMetricsApi24Impl frameMetricsApi24Impl4 = FrameMetricsApi24Impl.this;
|
||||
frameMetricsApi24Impl4.addDurationItem(frameMetricsApi24Impl4.mMetrics[3], frameMetrics.getMetric(4));
|
||||
}
|
||||
if ((FrameMetricsApi24Impl.this.mTrackingFlags & 16) != 0) {
|
||||
FrameMetricsApi24Impl frameMetricsApi24Impl5 = FrameMetricsApi24Impl.this;
|
||||
frameMetricsApi24Impl5.addDurationItem(frameMetricsApi24Impl5.mMetrics[4], frameMetrics.getMetric(5));
|
||||
}
|
||||
if ((FrameMetricsApi24Impl.this.mTrackingFlags & 64) != 0) {
|
||||
FrameMetricsApi24Impl frameMetricsApi24Impl6 = FrameMetricsApi24Impl.this;
|
||||
frameMetricsApi24Impl6.addDurationItem(frameMetricsApi24Impl6.mMetrics[6], frameMetrics.getMetric(7));
|
||||
}
|
||||
if ((FrameMetricsApi24Impl.this.mTrackingFlags & 32) != 0) {
|
||||
FrameMetricsApi24Impl frameMetricsApi24Impl7 = FrameMetricsApi24Impl.this;
|
||||
frameMetricsApi24Impl7.addDurationItem(frameMetricsApi24Impl7.mMetrics[5], frameMetrics.getMetric(6));
|
||||
}
|
||||
if ((FrameMetricsApi24Impl.this.mTrackingFlags & 128) != 0) {
|
||||
FrameMetricsApi24Impl frameMetricsApi24Impl8 = FrameMetricsApi24Impl.this;
|
||||
frameMetricsApi24Impl8.addDurationItem(frameMetricsApi24Impl8.mMetrics[7], frameMetrics.getMetric(0));
|
||||
}
|
||||
if ((FrameMetricsApi24Impl.this.mTrackingFlags & 256) != 0) {
|
||||
FrameMetricsApi24Impl frameMetricsApi24Impl9 = FrameMetricsApi24Impl.this;
|
||||
frameMetricsApi24Impl9.addDurationItem(frameMetricsApi24Impl9.mMetrics[8], frameMetrics.getMetric(2));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@Override // androidx.core.app.FrameMetricsAggregator.FrameMetricsBaseImpl
|
||||
public SparseIntArray[] getMetrics() {
|
||||
return this.mMetrics;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.FrameMetricsAggregator.FrameMetricsBaseImpl
|
||||
public SparseIntArray[] reset() {
|
||||
SparseIntArray[] sparseIntArrayArr = this.mMetrics;
|
||||
this.mMetrics = new SparseIntArray[9];
|
||||
return sparseIntArrayArr;
|
||||
}
|
||||
|
||||
FrameMetricsApi24Impl(int i) {
|
||||
this.mTrackingFlags = i;
|
||||
}
|
||||
|
||||
void addDurationItem(SparseIntArray sparseIntArray, long j) {
|
||||
if (sparseIntArray != null) {
|
||||
int i = (int) ((500000 + j) / 1000000);
|
||||
if (j >= 0) {
|
||||
sparseIntArray.put(i, sparseIntArray.get(i) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.FrameMetricsAggregator.FrameMetricsBaseImpl
|
||||
public void add(Activity activity) {
|
||||
if (sHandlerThread == null) {
|
||||
HandlerThread handlerThread = new HandlerThread("FrameMetricsAggregator");
|
||||
sHandlerThread = handlerThread;
|
||||
handlerThread.start();
|
||||
sHandler = new Handler(sHandlerThread.getLooper());
|
||||
}
|
||||
for (int i = 0; i <= 8; i++) {
|
||||
SparseIntArray[] sparseIntArrayArr = this.mMetrics;
|
||||
if (sparseIntArrayArr[i] == null && (this.mTrackingFlags & (1 << i)) != 0) {
|
||||
sparseIntArrayArr[i] = new SparseIntArray();
|
||||
}
|
||||
}
|
||||
activity.getWindow().addOnFrameMetricsAvailableListener(this.mListener, sHandler);
|
||||
this.mActivities.add(new WeakReference<>(activity));
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.FrameMetricsAggregator.FrameMetricsBaseImpl
|
||||
public SparseIntArray[] remove(Activity activity) {
|
||||
Iterator<WeakReference<Activity>> it = this.mActivities.iterator();
|
||||
while (true) {
|
||||
if (!it.hasNext()) {
|
||||
break;
|
||||
}
|
||||
WeakReference<Activity> next = it.next();
|
||||
if (next.get() == activity) {
|
||||
this.mActivities.remove(next);
|
||||
break;
|
||||
}
|
||||
}
|
||||
activity.getWindow().removeOnFrameMetricsAvailableListener(this.mListener);
|
||||
return this.mMetrics;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.FrameMetricsAggregator.FrameMetricsBaseImpl
|
||||
public SparseIntArray[] stop() {
|
||||
for (int size = this.mActivities.size() - 1; size >= 0; size--) {
|
||||
WeakReference<Activity> weakReference = this.mActivities.get(size);
|
||||
Activity activity = weakReference.get();
|
||||
if (weakReference.get() != null) {
|
||||
activity.getWindow().removeOnFrameMetricsAvailableListener(this.mListener);
|
||||
this.mActivities.remove(size);
|
||||
}
|
||||
}
|
||||
return this.mMetrics;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
package androidx.core.app;
|
||||
|
||||
/* compiled from: D8$$SyntheticClass */
|
||||
/* loaded from: classes.dex */
|
||||
public final /* synthetic */ class JobIntentService$JobServiceEngineImpl$$ExternalSyntheticApiModelOutline0 {
|
||||
}
|
448
02-Easy5/E5/sources/androidx/core/app/JobIntentService.java
Normal file
448
02-Easy5/E5/sources/androidx/core/app/JobIntentService.java
Normal file
@ -0,0 +1,448 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Service;
|
||||
import android.app.job.JobInfo;
|
||||
import android.app.job.JobParameters;
|
||||
import android.app.job.JobScheduler;
|
||||
import android.app.job.JobServiceEngine;
|
||||
import android.app.job.JobWorkItem;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import android.os.PowerManager;
|
||||
import androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
@Deprecated
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class JobIntentService extends Service {
|
||||
static final boolean DEBUG = false;
|
||||
static final String TAG = "JobIntentService";
|
||||
final ArrayList<CompatWorkItem> mCompatQueue;
|
||||
WorkEnqueuer mCompatWorkEnqueuer;
|
||||
CommandProcessor mCurProcessor;
|
||||
CompatJobEngine mJobImpl;
|
||||
static final Object sLock = new Object();
|
||||
static final HashMap<ComponentName, WorkEnqueuer> sClassWorkEnqueuer = new HashMap<>();
|
||||
boolean mInterruptIfStopped = false;
|
||||
boolean mStopped = false;
|
||||
boolean mDestroyed = false;
|
||||
|
||||
interface CompatJobEngine {
|
||||
IBinder compatGetBinder();
|
||||
|
||||
GenericWorkItem dequeueWork();
|
||||
}
|
||||
|
||||
interface GenericWorkItem {
|
||||
void complete();
|
||||
|
||||
Intent getIntent();
|
||||
}
|
||||
|
||||
public boolean isStopped() {
|
||||
return this.mStopped;
|
||||
}
|
||||
|
||||
protected abstract void onHandleWork(Intent intent);
|
||||
|
||||
public boolean onStopCurrentWork() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setInterruptIfStopped(boolean z) {
|
||||
this.mInterruptIfStopped = z;
|
||||
}
|
||||
|
||||
static abstract class WorkEnqueuer {
|
||||
final ComponentName mComponentName;
|
||||
boolean mHasJobId;
|
||||
int mJobId;
|
||||
|
||||
abstract void enqueueWork(Intent intent);
|
||||
|
||||
public void serviceProcessingFinished() {
|
||||
}
|
||||
|
||||
public void serviceProcessingStarted() {
|
||||
}
|
||||
|
||||
public void serviceStartReceived() {
|
||||
}
|
||||
|
||||
WorkEnqueuer(ComponentName componentName) {
|
||||
this.mComponentName = componentName;
|
||||
}
|
||||
|
||||
void ensureJobId(int i) {
|
||||
if (!this.mHasJobId) {
|
||||
this.mHasJobId = true;
|
||||
this.mJobId = i;
|
||||
} else {
|
||||
if (this.mJobId == i) {
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException("Given job ID " + i + " is different than previous " + this.mJobId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static final class CompatWorkEnqueuer extends WorkEnqueuer {
|
||||
private final Context mContext;
|
||||
private final PowerManager.WakeLock mLaunchWakeLock;
|
||||
boolean mLaunchingService;
|
||||
private final PowerManager.WakeLock mRunWakeLock;
|
||||
boolean mServiceProcessing;
|
||||
|
||||
CompatWorkEnqueuer(Context context, ComponentName componentName) {
|
||||
super(componentName);
|
||||
this.mContext = context.getApplicationContext();
|
||||
PowerManager powerManager = (PowerManager) context.getSystemService("power");
|
||||
PowerManager.WakeLock newWakeLock = powerManager.newWakeLock(1, componentName.getClassName() + ":launch");
|
||||
this.mLaunchWakeLock = newWakeLock;
|
||||
newWakeLock.setReferenceCounted(false);
|
||||
PowerManager.WakeLock newWakeLock2 = powerManager.newWakeLock(1, componentName.getClassName() + ":run");
|
||||
this.mRunWakeLock = newWakeLock2;
|
||||
newWakeLock2.setReferenceCounted(false);
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.JobIntentService.WorkEnqueuer
|
||||
void enqueueWork(Intent intent) {
|
||||
Intent intent2 = new Intent(intent);
|
||||
intent2.setComponent(this.mComponentName);
|
||||
if (this.mContext.startService(intent2) != null) {
|
||||
synchronized (this) {
|
||||
if (!this.mLaunchingService) {
|
||||
this.mLaunchingService = true;
|
||||
if (!this.mServiceProcessing) {
|
||||
this.mLaunchWakeLock.acquire(60000L);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.JobIntentService.WorkEnqueuer
|
||||
public void serviceStartReceived() {
|
||||
synchronized (this) {
|
||||
this.mLaunchingService = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.JobIntentService.WorkEnqueuer
|
||||
public void serviceProcessingStarted() {
|
||||
synchronized (this) {
|
||||
if (!this.mServiceProcessing) {
|
||||
this.mServiceProcessing = true;
|
||||
this.mRunWakeLock.acquire(600000L);
|
||||
this.mLaunchWakeLock.release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.JobIntentService.WorkEnqueuer
|
||||
public void serviceProcessingFinished() {
|
||||
synchronized (this) {
|
||||
if (this.mServiceProcessing) {
|
||||
if (this.mLaunchingService) {
|
||||
this.mLaunchWakeLock.acquire(60000L);
|
||||
}
|
||||
this.mServiceProcessing = false;
|
||||
this.mRunWakeLock.release();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static final class JobServiceEngineImpl extends JobServiceEngine implements CompatJobEngine {
|
||||
static final boolean DEBUG = false;
|
||||
static final String TAG = "JobServiceEngineImpl";
|
||||
final Object mLock;
|
||||
JobParameters mParams;
|
||||
final JobIntentService mService;
|
||||
|
||||
final class WrapperWorkItem implements GenericWorkItem {
|
||||
final JobWorkItem mJobWork;
|
||||
|
||||
WrapperWorkItem(JobWorkItem jobWorkItem) {
|
||||
this.mJobWork = jobWorkItem;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.JobIntentService.GenericWorkItem
|
||||
public Intent getIntent() {
|
||||
Intent intent;
|
||||
intent = this.mJobWork.getIntent();
|
||||
return intent;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.JobIntentService.GenericWorkItem
|
||||
public void complete() {
|
||||
synchronized (JobServiceEngineImpl.this.mLock) {
|
||||
if (JobServiceEngineImpl.this.mParams != null) {
|
||||
JobServiceEngineImpl.this.mParams.completeWork(this.mJobWork);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JobServiceEngineImpl(JobIntentService jobIntentService) {
|
||||
super(jobIntentService);
|
||||
this.mLock = new Object();
|
||||
this.mService = jobIntentService;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.JobIntentService.CompatJobEngine
|
||||
public IBinder compatGetBinder() {
|
||||
IBinder binder;
|
||||
binder = getBinder();
|
||||
return binder;
|
||||
}
|
||||
|
||||
@Override // android.app.job.JobServiceEngine
|
||||
public boolean onStartJob(JobParameters jobParameters) {
|
||||
this.mParams = jobParameters;
|
||||
this.mService.ensureProcessorRunningLocked(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // android.app.job.JobServiceEngine
|
||||
public boolean onStopJob(JobParameters jobParameters) {
|
||||
boolean doStopCurrentWork = this.mService.doStopCurrentWork();
|
||||
synchronized (this.mLock) {
|
||||
this.mParams = null;
|
||||
}
|
||||
return doStopCurrentWork;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.JobIntentService.CompatJobEngine
|
||||
public GenericWorkItem dequeueWork() {
|
||||
JobWorkItem dequeueWork;
|
||||
Intent intent;
|
||||
synchronized (this.mLock) {
|
||||
JobParameters jobParameters = this.mParams;
|
||||
if (jobParameters == null) {
|
||||
return null;
|
||||
}
|
||||
dequeueWork = jobParameters.dequeueWork();
|
||||
if (dequeueWork == null) {
|
||||
return null;
|
||||
}
|
||||
intent = dequeueWork.getIntent();
|
||||
intent.setExtrasClassLoader(this.mService.getClassLoader());
|
||||
return new WrapperWorkItem(dequeueWork);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static final class JobWorkEnqueuer extends WorkEnqueuer {
|
||||
private final JobInfo mJobInfo;
|
||||
private final JobScheduler mJobScheduler;
|
||||
|
||||
JobWorkEnqueuer(Context context, ComponentName componentName, int i) {
|
||||
super(componentName);
|
||||
ensureJobId(i);
|
||||
this.mJobInfo = new JobInfo.Builder(i, this.mComponentName).setOverrideDeadline(0L).build();
|
||||
this.mJobScheduler = (JobScheduler) context.getApplicationContext().getSystemService("jobscheduler");
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.JobIntentService.WorkEnqueuer
|
||||
void enqueueWork(Intent intent) {
|
||||
this.mJobScheduler.enqueue(this.mJobInfo, ComponentDialog$$ExternalSyntheticApiModelOutline0.m(intent));
|
||||
}
|
||||
}
|
||||
|
||||
final class CompatWorkItem implements GenericWorkItem {
|
||||
final Intent mIntent;
|
||||
final int mStartId;
|
||||
|
||||
@Override // androidx.core.app.JobIntentService.GenericWorkItem
|
||||
public Intent getIntent() {
|
||||
return this.mIntent;
|
||||
}
|
||||
|
||||
CompatWorkItem(Intent intent, int i) {
|
||||
this.mIntent = intent;
|
||||
this.mStartId = i;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.JobIntentService.GenericWorkItem
|
||||
public void complete() {
|
||||
JobIntentService.this.stopSelf(this.mStartId);
|
||||
}
|
||||
}
|
||||
|
||||
final class CommandProcessor extends AsyncTask<Void, Void, Void> {
|
||||
CommandProcessor() {
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // android.os.AsyncTask
|
||||
public Void doInBackground(Void... voidArr) {
|
||||
while (true) {
|
||||
GenericWorkItem dequeueWork = JobIntentService.this.dequeueWork();
|
||||
if (dequeueWork == null) {
|
||||
return null;
|
||||
}
|
||||
JobIntentService.this.onHandleWork(dequeueWork.getIntent());
|
||||
dequeueWork.complete();
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // android.os.AsyncTask
|
||||
public void onCancelled(Void r1) {
|
||||
JobIntentService.this.processorFinished();
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: protected */
|
||||
@Override // android.os.AsyncTask
|
||||
public void onPostExecute(Void r1) {
|
||||
JobIntentService.this.processorFinished();
|
||||
}
|
||||
}
|
||||
|
||||
public JobIntentService() {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
this.mCompatQueue = null;
|
||||
} else {
|
||||
this.mCompatQueue = new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Service
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
this.mJobImpl = new JobServiceEngineImpl(this);
|
||||
this.mCompatWorkEnqueuer = null;
|
||||
} else {
|
||||
this.mJobImpl = null;
|
||||
this.mCompatWorkEnqueuer = getWorkEnqueuer(this, new ComponentName(this, getClass()), false, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Service
|
||||
public int onStartCommand(Intent intent, int i, int i2) {
|
||||
if (this.mCompatQueue == null) {
|
||||
return 2;
|
||||
}
|
||||
this.mCompatWorkEnqueuer.serviceStartReceived();
|
||||
synchronized (this.mCompatQueue) {
|
||||
ArrayList<CompatWorkItem> arrayList = this.mCompatQueue;
|
||||
if (intent == null) {
|
||||
intent = new Intent();
|
||||
}
|
||||
arrayList.add(new CompatWorkItem(intent, i2));
|
||||
ensureProcessorRunningLocked(true);
|
||||
}
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override // android.app.Service
|
||||
public IBinder onBind(Intent intent) {
|
||||
CompatJobEngine compatJobEngine = this.mJobImpl;
|
||||
if (compatJobEngine != null) {
|
||||
return compatJobEngine.compatGetBinder();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.app.Service
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
ArrayList<CompatWorkItem> arrayList = this.mCompatQueue;
|
||||
if (arrayList != null) {
|
||||
synchronized (arrayList) {
|
||||
this.mDestroyed = true;
|
||||
this.mCompatWorkEnqueuer.serviceProcessingFinished();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void enqueueWork(Context context, Class<?> cls, int i, Intent intent) {
|
||||
enqueueWork(context, new ComponentName(context, cls), i, intent);
|
||||
}
|
||||
|
||||
public static void enqueueWork(Context context, ComponentName componentName, int i, Intent intent) {
|
||||
if (intent == null) {
|
||||
throw new IllegalArgumentException("work must not be null");
|
||||
}
|
||||
synchronized (sLock) {
|
||||
WorkEnqueuer workEnqueuer = getWorkEnqueuer(context, componentName, true, i);
|
||||
workEnqueuer.ensureJobId(i);
|
||||
workEnqueuer.enqueueWork(intent);
|
||||
}
|
||||
}
|
||||
|
||||
static WorkEnqueuer getWorkEnqueuer(Context context, ComponentName componentName, boolean z, int i) {
|
||||
WorkEnqueuer compatWorkEnqueuer;
|
||||
HashMap<ComponentName, WorkEnqueuer> hashMap = sClassWorkEnqueuer;
|
||||
WorkEnqueuer workEnqueuer = hashMap.get(componentName);
|
||||
if (workEnqueuer != null) {
|
||||
return workEnqueuer;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT < 26) {
|
||||
compatWorkEnqueuer = new CompatWorkEnqueuer(context, componentName);
|
||||
} else {
|
||||
if (!z) {
|
||||
throw new IllegalArgumentException("Can't be here without a job id");
|
||||
}
|
||||
compatWorkEnqueuer = new JobWorkEnqueuer(context, componentName, i);
|
||||
}
|
||||
WorkEnqueuer workEnqueuer2 = compatWorkEnqueuer;
|
||||
hashMap.put(componentName, workEnqueuer2);
|
||||
return workEnqueuer2;
|
||||
}
|
||||
|
||||
boolean doStopCurrentWork() {
|
||||
CommandProcessor commandProcessor = this.mCurProcessor;
|
||||
if (commandProcessor != null) {
|
||||
commandProcessor.cancel(this.mInterruptIfStopped);
|
||||
}
|
||||
this.mStopped = true;
|
||||
return onStopCurrentWork();
|
||||
}
|
||||
|
||||
void ensureProcessorRunningLocked(boolean z) {
|
||||
if (this.mCurProcessor == null) {
|
||||
this.mCurProcessor = new CommandProcessor();
|
||||
WorkEnqueuer workEnqueuer = this.mCompatWorkEnqueuer;
|
||||
if (workEnqueuer != null && z) {
|
||||
workEnqueuer.serviceProcessingStarted();
|
||||
}
|
||||
this.mCurProcessor.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Void[0]);
|
||||
}
|
||||
}
|
||||
|
||||
void processorFinished() {
|
||||
ArrayList<CompatWorkItem> arrayList = this.mCompatQueue;
|
||||
if (arrayList != null) {
|
||||
synchronized (arrayList) {
|
||||
this.mCurProcessor = null;
|
||||
ArrayList<CompatWorkItem> arrayList2 = this.mCompatQueue;
|
||||
if (arrayList2 != null && arrayList2.size() > 0) {
|
||||
ensureProcessorRunningLocked(false);
|
||||
} else if (!this.mDestroyed) {
|
||||
this.mCompatWorkEnqueuer.serviceProcessingFinished();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GenericWorkItem dequeueWork() {
|
||||
CompatJobEngine compatJobEngine = this.mJobImpl;
|
||||
if (compatJobEngine != null) {
|
||||
return compatJobEngine.dequeueWork();
|
||||
}
|
||||
synchronized (this.mCompatQueue) {
|
||||
if (this.mCompatQueue.size() <= 0) {
|
||||
return null;
|
||||
}
|
||||
return this.mCompatQueue.remove(0);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.LocaleManager;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Build;
|
||||
import android.os.LocaleList;
|
||||
import androidx.core.os.BuildCompat;
|
||||
import androidx.core.os.LocaleListCompat;
|
||||
import java.util.Locale;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class LocaleManagerCompat {
|
||||
private LocaleManagerCompat() {
|
||||
}
|
||||
|
||||
public static LocaleListCompat getSystemLocales(Context context) {
|
||||
LocaleListCompat emptyLocaleList = LocaleListCompat.getEmptyLocaleList();
|
||||
if (BuildCompat.isAtLeastT()) {
|
||||
Object localeManagerForApplication = getLocaleManagerForApplication(context);
|
||||
return localeManagerForApplication != null ? LocaleListCompat.wrap(Api33Impl.localeManagerGetSystemLocales(localeManagerForApplication)) : emptyLocaleList;
|
||||
}
|
||||
return getConfigurationLocales(context.getApplicationContext().getResources().getConfiguration());
|
||||
}
|
||||
|
||||
private static Object getLocaleManagerForApplication(Context context) {
|
||||
return context.getSystemService("locale");
|
||||
}
|
||||
|
||||
static LocaleListCompat getConfigurationLocales(Configuration configuration) {
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
return Api24Impl.getLocales(configuration);
|
||||
}
|
||||
return LocaleListCompat.forLanguageTags(Api21Impl.toLanguageTag(configuration.locale));
|
||||
}
|
||||
|
||||
static class Api21Impl {
|
||||
private Api21Impl() {
|
||||
}
|
||||
|
||||
static String toLanguageTag(Locale locale) {
|
||||
return locale.toLanguageTag();
|
||||
}
|
||||
}
|
||||
|
||||
static class Api24Impl {
|
||||
private Api24Impl() {
|
||||
}
|
||||
|
||||
static LocaleListCompat getLocales(Configuration configuration) {
|
||||
return LocaleListCompat.forLanguageTags(configuration.getLocales().toLanguageTags());
|
||||
}
|
||||
}
|
||||
|
||||
static class Api33Impl {
|
||||
private Api33Impl() {
|
||||
}
|
||||
|
||||
static LocaleList localeManagerGetSystemLocales(Object obj) {
|
||||
return ((LocaleManager) obj).getSystemLocales();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.content.res.Configuration;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class MultiWindowModeChangedInfo {
|
||||
private final boolean mIsInMultiWindowMode;
|
||||
private final Configuration mNewConfig;
|
||||
|
||||
public boolean isInMultiWindowMode() {
|
||||
return this.mIsInMultiWindowMode;
|
||||
}
|
||||
|
||||
public MultiWindowModeChangedInfo(boolean z) {
|
||||
this.mIsInMultiWindowMode = z;
|
||||
this.mNewConfig = null;
|
||||
}
|
||||
|
||||
public MultiWindowModeChangedInfo(boolean z, Configuration configuration) {
|
||||
this.mIsInMultiWindowMode = z;
|
||||
this.mNewConfig = configuration;
|
||||
}
|
||||
|
||||
public Configuration getNewConfig() {
|
||||
Configuration configuration = this.mNewConfig;
|
||||
if (configuration != null) {
|
||||
return configuration;
|
||||
}
|
||||
throw new IllegalStateException("MultiWindowModeChangedInfo must be constructed with the constructor that takes a Configuration to call getNewConfig(). Are you running on an API 26 or higher device that makes this information available?");
|
||||
}
|
||||
}
|
121
02-Easy5/E5/sources/androidx/core/app/NavUtils.java
Normal file
121
02-Easy5/E5/sources/androidx/core/app/NavUtils.java
Normal file
@ -0,0 +1,121 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class NavUtils {
|
||||
public static final String PARENT_ACTIVITY = "android.support.PARENT_ACTIVITY";
|
||||
private static final String TAG = "NavUtils";
|
||||
|
||||
public static boolean shouldUpRecreateTask(Activity activity, Intent intent) {
|
||||
return Api16Impl.shouldUpRecreateTask(activity, intent);
|
||||
}
|
||||
|
||||
public static void navigateUpFromSameTask(Activity activity) {
|
||||
Intent parentActivityIntent = getParentActivityIntent(activity);
|
||||
if (parentActivityIntent == null) {
|
||||
throw new IllegalArgumentException("Activity " + activity.getClass().getSimpleName() + " does not have a parent activity name specified. (Did you forget to add the android.support.PARENT_ACTIVITY <meta-data> element in your manifest?)");
|
||||
}
|
||||
navigateUpTo(activity, parentActivityIntent);
|
||||
}
|
||||
|
||||
public static void navigateUpTo(Activity activity, Intent intent) {
|
||||
Api16Impl.navigateUpTo(activity, intent);
|
||||
}
|
||||
|
||||
public static Intent getParentActivityIntent(Activity activity) {
|
||||
Intent parentActivityIntent = Api16Impl.getParentActivityIntent(activity);
|
||||
if (parentActivityIntent != null) {
|
||||
return parentActivityIntent;
|
||||
}
|
||||
String parentActivityName = getParentActivityName(activity);
|
||||
if (parentActivityName == null) {
|
||||
return null;
|
||||
}
|
||||
ComponentName componentName = new ComponentName(activity, parentActivityName);
|
||||
try {
|
||||
if (getParentActivityName(activity, componentName) == null) {
|
||||
return Intent.makeMainActivity(componentName);
|
||||
}
|
||||
return new Intent().setComponent(componentName);
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
Log.e(TAG, "getParentActivityIntent: bad parentActivityName '" + parentActivityName + "' in manifest");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static Intent getParentActivityIntent(Context context, Class<?> cls) throws PackageManager.NameNotFoundException {
|
||||
String parentActivityName = getParentActivityName(context, new ComponentName(context, cls));
|
||||
if (parentActivityName == null) {
|
||||
return null;
|
||||
}
|
||||
ComponentName componentName = new ComponentName(context, parentActivityName);
|
||||
if (getParentActivityName(context, componentName) == null) {
|
||||
return Intent.makeMainActivity(componentName);
|
||||
}
|
||||
return new Intent().setComponent(componentName);
|
||||
}
|
||||
|
||||
public static Intent getParentActivityIntent(Context context, ComponentName componentName) throws PackageManager.NameNotFoundException {
|
||||
String parentActivityName = getParentActivityName(context, componentName);
|
||||
if (parentActivityName == null) {
|
||||
return null;
|
||||
}
|
||||
ComponentName componentName2 = new ComponentName(componentName.getPackageName(), parentActivityName);
|
||||
if (getParentActivityName(context, componentName2) == null) {
|
||||
return Intent.makeMainActivity(componentName2);
|
||||
}
|
||||
return new Intent().setComponent(componentName2);
|
||||
}
|
||||
|
||||
public static String getParentActivityName(Activity activity) {
|
||||
try {
|
||||
return getParentActivityName(activity, activity.getComponentName());
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getParentActivityName(Context context, ComponentName componentName) throws PackageManager.NameNotFoundException {
|
||||
String string;
|
||||
ActivityInfo activityInfo = context.getPackageManager().getActivityInfo(componentName, Build.VERSION.SDK_INT >= 29 ? 269222528 : Build.VERSION.SDK_INT >= 24 ? 787072 : 640);
|
||||
String str = activityInfo.parentActivityName;
|
||||
if (str != null) {
|
||||
return str;
|
||||
}
|
||||
if (activityInfo.metaData == null || (string = activityInfo.metaData.getString(PARENT_ACTIVITY)) == null) {
|
||||
return null;
|
||||
}
|
||||
if (string.charAt(0) != '.') {
|
||||
return string;
|
||||
}
|
||||
return context.getPackageName() + string;
|
||||
}
|
||||
|
||||
private NavUtils() {
|
||||
}
|
||||
|
||||
static class Api16Impl {
|
||||
private Api16Impl() {
|
||||
}
|
||||
|
||||
static boolean shouldUpRecreateTask(Activity activity, Intent intent) {
|
||||
return activity.shouldUpRecreateTask(intent);
|
||||
}
|
||||
|
||||
static boolean navigateUpTo(Activity activity, Intent intent) {
|
||||
return activity.navigateUpTo(intent);
|
||||
}
|
||||
|
||||
static Intent getParentActivityIntent(Activity activity) {
|
||||
return activity.getParentActivityIntent();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Notification;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface NotificationBuilderWithBuilderAccessor {
|
||||
Notification.Builder getBuilder();
|
||||
}
|
@ -0,0 +1,273 @@
|
||||
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.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0;
|
||||
import androidx.core.util.Preconditions;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
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;
|
||||
AudioAttributes mAudioAttributes;
|
||||
private boolean mBypassDnd;
|
||||
private boolean mCanBubble;
|
||||
String mConversationId;
|
||||
String mDescription;
|
||||
String mGroupId;
|
||||
final String mId;
|
||||
int mImportance;
|
||||
private boolean mImportantConversation;
|
||||
int mLightColor;
|
||||
boolean mLights;
|
||||
private int mLockscreenVisibility;
|
||||
CharSequence mName;
|
||||
String mParentId;
|
||||
boolean mShowBadge;
|
||||
Uri mSound;
|
||||
boolean mVibrationEnabled;
|
||||
long[] mVibrationPattern;
|
||||
|
||||
public boolean canBubble() {
|
||||
return this.mCanBubble;
|
||||
}
|
||||
|
||||
public boolean canBypassDnd() {
|
||||
return this.mBypassDnd;
|
||||
}
|
||||
|
||||
public boolean canShowBadge() {
|
||||
return this.mShowBadge;
|
||||
}
|
||||
|
||||
public AudioAttributes getAudioAttributes() {
|
||||
return this.mAudioAttributes;
|
||||
}
|
||||
|
||||
public String getConversationId() {
|
||||
return this.mConversationId;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return this.mDescription;
|
||||
}
|
||||
|
||||
public String getGroup() {
|
||||
return this.mGroupId;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return this.mId;
|
||||
}
|
||||
|
||||
public int getImportance() {
|
||||
return this.mImportance;
|
||||
}
|
||||
|
||||
public int getLightColor() {
|
||||
return this.mLightColor;
|
||||
}
|
||||
|
||||
public int getLockscreenVisibility() {
|
||||
return this.mLockscreenVisibility;
|
||||
}
|
||||
|
||||
public CharSequence getName() {
|
||||
return this.mName;
|
||||
}
|
||||
|
||||
public String getParentChannelId() {
|
||||
return this.mParentId;
|
||||
}
|
||||
|
||||
public Uri getSound() {
|
||||
return this.mSound;
|
||||
}
|
||||
|
||||
public long[] getVibrationPattern() {
|
||||
return this.mVibrationPattern;
|
||||
}
|
||||
|
||||
public boolean isImportantConversation() {
|
||||
return this.mImportantConversation;
|
||||
}
|
||||
|
||||
public boolean shouldShowLights() {
|
||||
return this.mLights;
|
||||
}
|
||||
|
||||
public boolean shouldVibrate() {
|
||||
return this.mVibrationEnabled;
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
private final NotificationChannelCompat mChannel;
|
||||
|
||||
public NotificationChannelCompat build() {
|
||||
return this.mChannel;
|
||||
}
|
||||
|
||||
public Builder(String str, int i) {
|
||||
this.mChannel = new NotificationChannelCompat(str, i);
|
||||
}
|
||||
|
||||
public Builder setName(CharSequence charSequence) {
|
||||
this.mChannel.mName = charSequence;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setImportance(int i) {
|
||||
this.mChannel.mImportance = i;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setDescription(String str) {
|
||||
this.mChannel.mDescription = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setGroup(String str) {
|
||||
this.mChannel.mGroupId = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setShowBadge(boolean z) {
|
||||
this.mChannel.mShowBadge = z;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setSound(Uri uri, AudioAttributes audioAttributes) {
|
||||
this.mChannel.mSound = uri;
|
||||
this.mChannel.mAudioAttributes = audioAttributes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setLightsEnabled(boolean z) {
|
||||
this.mChannel.mLights = z;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setLightColor(int i) {
|
||||
this.mChannel.mLightColor = i;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setVibrationEnabled(boolean z) {
|
||||
this.mChannel.mVibrationEnabled = z;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setVibrationPattern(long[] jArr) {
|
||||
this.mChannel.mVibrationEnabled = (jArr == null || jArr.length <= 0) ? false : NotificationChannelCompat.DEFAULT_SHOW_BADGE;
|
||||
this.mChannel.mVibrationPattern = jArr;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setConversationId(String str, String str2) {
|
||||
if (Build.VERSION.SDK_INT >= 30) {
|
||||
this.mChannel.mParentId = str;
|
||||
this.mChannel.mConversationId = str2;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
NotificationChannelCompat(String str, int i) {
|
||||
this.mShowBadge = DEFAULT_SHOW_BADGE;
|
||||
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;
|
||||
}
|
||||
|
||||
/* JADX WARN: Illegal instructions before constructor call */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
NotificationChannelCompat(android.app.NotificationChannel r4) {
|
||||
/*
|
||||
r3 = this;
|
||||
java.lang.String r0 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m22m(r4)
|
||||
int r1 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m$1(r4)
|
||||
r3.<init>(r0, r1)
|
||||
java.lang.CharSequence r0 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m20m(r4)
|
||||
r3.mName = r0
|
||||
java.lang.String r0 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m$3(r4)
|
||||
r3.mDescription = r0
|
||||
java.lang.String r0 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m$4(r4)
|
||||
r3.mGroupId = r0
|
||||
boolean r0 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m41m$4(r4)
|
||||
r3.mShowBadge = r0
|
||||
android.net.Uri r0 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m14m(r4)
|
||||
r3.mSound = r0
|
||||
android.media.AudioAttributes r0 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m13m(r4)
|
||||
r3.mAudioAttributes = r0
|
||||
boolean r0 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m$5(r4)
|
||||
r3.mLights = r0
|
||||
int r0 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m$2(r4)
|
||||
r3.mLightColor = r0
|
||||
boolean r0 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m29m(r4)
|
||||
r3.mVibrationEnabled = r0
|
||||
long[] r0 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m34m(r4)
|
||||
r3.mVibrationPattern = r0
|
||||
int r0 = android.os.Build.VERSION.SDK_INT
|
||||
r1 = 30
|
||||
if (r0 < r1) goto L59
|
||||
java.lang.String r0 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m36m$1(r4)
|
||||
r3.mParentId = r0
|
||||
java.lang.String r0 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m38m$2(r4)
|
||||
r3.mConversationId = r0
|
||||
L59:
|
||||
boolean r0 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m37m$1(r4)
|
||||
r3.mBypassDnd = r0
|
||||
int r0 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m(r4)
|
||||
r3.mLockscreenVisibility = r0
|
||||
int r0 = android.os.Build.VERSION.SDK_INT
|
||||
r2 = 29
|
||||
if (r0 < r2) goto L71
|
||||
boolean r0 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m39m$2(r4)
|
||||
r3.mCanBubble = r0
|
||||
L71:
|
||||
int r0 = android.os.Build.VERSION.SDK_INT
|
||||
if (r0 < r1) goto L7b
|
||||
boolean r4 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m40m$3(r4)
|
||||
r3.mImportantConversation = r4
|
||||
L7b:
|
||||
return
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: androidx.core.app.NotificationChannelCompat.<init>(android.app.NotificationChannel):void");
|
||||
}
|
||||
|
||||
NotificationChannel getNotificationChannel() {
|
||||
String str;
|
||||
String str2;
|
||||
if (Build.VERSION.SDK_INT < 26) {
|
||||
return null;
|
||||
}
|
||||
ComponentDialog$$ExternalSyntheticApiModelOutline0.m25m();
|
||||
NotificationChannel m = ComponentDialog$$ExternalSyntheticApiModelOutline0.m(this.mId, this.mName, this.mImportance);
|
||||
m.setDescription(this.mDescription);
|
||||
m.setGroup(this.mGroupId);
|
||||
m.setShowBadge(this.mShowBadge);
|
||||
m.setSound(this.mSound, this.mAudioAttributes);
|
||||
m.enableLights(this.mLights);
|
||||
m.setLightColor(this.mLightColor);
|
||||
m.setVibrationPattern(this.mVibrationPattern);
|
||||
m.enableVibration(this.mVibrationEnabled);
|
||||
if (Build.VERSION.SDK_INT >= 30 && (str = this.mParentId) != null && (str2 = this.mConversationId) != null) {
|
||||
m.setConversationId(str, str2);
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
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,137 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationChannelGroup;
|
||||
import android.os.Build;
|
||||
import androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0;
|
||||
import androidx.core.util.Preconditions;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class NotificationChannelGroupCompat {
|
||||
private boolean mBlocked;
|
||||
private List<NotificationChannelCompat> mChannels;
|
||||
String mDescription;
|
||||
final String mId;
|
||||
CharSequence mName;
|
||||
|
||||
public List<NotificationChannelCompat> getChannels() {
|
||||
return this.mChannels;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return this.mDescription;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return this.mId;
|
||||
}
|
||||
|
||||
public CharSequence getName() {
|
||||
return this.mName;
|
||||
}
|
||||
|
||||
public boolean isBlocked() {
|
||||
return this.mBlocked;
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
final NotificationChannelGroupCompat mGroup;
|
||||
|
||||
public NotificationChannelGroupCompat build() {
|
||||
return this.mGroup;
|
||||
}
|
||||
|
||||
public Builder(String str) {
|
||||
this.mGroup = new NotificationChannelGroupCompat(str);
|
||||
}
|
||||
|
||||
public Builder setName(CharSequence charSequence) {
|
||||
this.mGroup.mName = charSequence;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setDescription(String str) {
|
||||
this.mGroup.mDescription = str;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
NotificationChannelGroupCompat(String str) {
|
||||
this.mChannels = Collections.emptyList();
|
||||
this.mId = (String) Preconditions.checkNotNull(str);
|
||||
}
|
||||
|
||||
NotificationChannelGroupCompat(NotificationChannelGroup notificationChannelGroup) {
|
||||
this(notificationChannelGroup, Collections.emptyList());
|
||||
}
|
||||
|
||||
/* JADX WARN: Illegal instructions before constructor call */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
NotificationChannelGroupCompat(android.app.NotificationChannelGroup r3, java.util.List<android.app.NotificationChannel> r4) {
|
||||
/*
|
||||
r2 = this;
|
||||
java.lang.String r0 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m23m(r3)
|
||||
r2.<init>(r0)
|
||||
java.lang.CharSequence r0 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m(r3)
|
||||
r2.mName = r0
|
||||
int r0 = android.os.Build.VERSION.SDK_INT
|
||||
r1 = 28
|
||||
if (r0 < r1) goto L19
|
||||
java.lang.String r0 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m$1(r3)
|
||||
r2.mDescription = r0
|
||||
L19:
|
||||
int r0 = android.os.Build.VERSION.SDK_INT
|
||||
if (r0 < r1) goto L2e
|
||||
boolean r4 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m30m(r3)
|
||||
r2.mBlocked = r4
|
||||
java.util.List r3 = androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0.m24m(r3)
|
||||
java.util.List r3 = r2.getChannelsCompat(r3)
|
||||
r2.mChannels = r3
|
||||
goto L34
|
||||
L2e:
|
||||
java.util.List r3 = r2.getChannelsCompat(r4)
|
||||
r2.mChannels = r3
|
||||
L34:
|
||||
return
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: androidx.core.app.NotificationChannelGroupCompat.<init>(android.app.NotificationChannelGroup, java.util.List):void");
|
||||
}
|
||||
|
||||
private List<NotificationChannelCompat> getChannelsCompat(List<NotificationChannel> list) {
|
||||
String group;
|
||||
ArrayList arrayList = new ArrayList();
|
||||
Iterator<NotificationChannel> it = list.iterator();
|
||||
while (it.hasNext()) {
|
||||
NotificationChannel m = ComponentDialog$$ExternalSyntheticApiModelOutline0.m((Object) it.next());
|
||||
String str = this.mId;
|
||||
group = m.getGroup();
|
||||
if (str.equals(group)) {
|
||||
arrayList.add(new NotificationChannelCompat(m));
|
||||
}
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
NotificationChannelGroup getNotificationChannelGroup() {
|
||||
if (Build.VERSION.SDK_INT < 26) {
|
||||
return null;
|
||||
}
|
||||
ComponentDialog$$ExternalSyntheticApiModelOutline0.m$1();
|
||||
NotificationChannelGroup m = ComponentDialog$$ExternalSyntheticApiModelOutline0.m(this.mId, this.mName);
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
m.setDescription(this.mDescription);
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
public Builder toBuilder() {
|
||||
return new Builder(this.mId).setName(this.mName).setDescription(this.mDescription);
|
||||
}
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannelGroup;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.pm.ShortcutInfo;
|
||||
import android.content.pm.ShortcutManager;
|
||||
import android.graphics.drawable.Icon;
|
||||
import android.telephony.SubscriptionManager;
|
||||
|
||||
/* compiled from: D8$$SyntheticClass */
|
||||
/* loaded from: classes.dex */
|
||||
public final /* synthetic */ class NotificationCompat$Style$$ExternalSyntheticApiModelOutline0 {
|
||||
public static /* synthetic */ Notification.Action.Builder m(Icon icon, CharSequence charSequence, PendingIntent pendingIntent) {
|
||||
return new Notification.Action.Builder(icon, charSequence, pendingIntent);
|
||||
}
|
||||
|
||||
public static /* synthetic */ Notification.Builder m(Context context, String str) {
|
||||
return new Notification.Builder(context, str);
|
||||
}
|
||||
|
||||
public static /* synthetic */ Notification.MessagingStyle.Message m(CharSequence charSequence, long j, android.app.Person person) {
|
||||
return new Notification.MessagingStyle.Message(charSequence, j, person);
|
||||
}
|
||||
|
||||
public static /* synthetic */ Notification.MessagingStyle.Message m(CharSequence charSequence, long j, CharSequence charSequence2) {
|
||||
return new Notification.MessagingStyle.Message(charSequence, j, charSequence2);
|
||||
}
|
||||
|
||||
public static /* synthetic */ Notification.MessagingStyle m(android.app.Person person) {
|
||||
return new Notification.MessagingStyle(person);
|
||||
}
|
||||
|
||||
public static /* synthetic */ Notification.MessagingStyle m(CharSequence charSequence) {
|
||||
return new Notification.MessagingStyle(charSequence);
|
||||
}
|
||||
|
||||
public static /* bridge */ /* synthetic */ NotificationChannelGroup m(Object obj) {
|
||||
return (NotificationChannelGroup) obj;
|
||||
}
|
||||
|
||||
/* renamed from: m, reason: collision with other method in class */
|
||||
public static /* synthetic */ ShortcutInfo.Builder m56m(Context context, String str) {
|
||||
return new ShortcutInfo.Builder(context, str);
|
||||
}
|
||||
|
||||
/* renamed from: m, reason: collision with other method in class */
|
||||
public static /* bridge */ /* synthetic */ ShortcutInfo m57m(Object obj) {
|
||||
return (ShortcutInfo) obj;
|
||||
}
|
||||
|
||||
/* renamed from: m, reason: collision with other method in class */
|
||||
public static /* bridge */ /* synthetic */ ShortcutManager m58m(Object obj) {
|
||||
return (ShortcutManager) obj;
|
||||
}
|
||||
|
||||
public static /* bridge */ /* synthetic */ Class m() {
|
||||
return Notification.MessagingStyle.class;
|
||||
}
|
||||
|
||||
/* renamed from: m, reason: collision with other method in class */
|
||||
public static /* synthetic */ void m65m() {
|
||||
}
|
||||
|
||||
public static /* bridge */ /* synthetic */ Class m$1() {
|
||||
return Notification.DecoratedCustomViewStyle.class;
|
||||
}
|
||||
|
||||
/* renamed from: m$1, reason: collision with other method in class */
|
||||
public static /* synthetic */ void m73m$1() {
|
||||
}
|
||||
|
||||
public static /* bridge */ /* synthetic */ Class m$2() {
|
||||
return SubscriptionManager.class;
|
||||
}
|
||||
|
||||
/* renamed from: m$2, reason: collision with other method in class */
|
||||
public static /* synthetic */ void m75m$2() {
|
||||
}
|
||||
|
||||
public static /* bridge */ /* synthetic */ Class m$3() {
|
||||
return ShortcutManager.class;
|
||||
}
|
||||
|
||||
/* renamed from: m$3, reason: collision with other method in class */
|
||||
public static /* synthetic */ void m77m$3() {
|
||||
}
|
||||
|
||||
public static /* synthetic */ void m$4() {
|
||||
}
|
||||
}
|
3717
02-Easy5/E5/sources/androidx/core/app/NotificationCompat.java
Normal file
3717
02-Easy5/E5/sources/androidx/core/app/NotificationCompat.java
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,294 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.RemoteViews;
|
||||
import androidx.collection.ArraySet;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.core.graphics.drawable.IconCompat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class NotificationCompatBuilder implements NotificationBuilderWithBuilderAccessor {
|
||||
private RemoteViews mBigContentView;
|
||||
private final Notification.Builder mBuilder;
|
||||
private final NotificationCompat.Builder mBuilderCompat;
|
||||
private RemoteViews mContentView;
|
||||
private final Context mContext;
|
||||
private int mGroupAlertBehavior;
|
||||
private RemoteViews mHeadsUpContentView;
|
||||
private final List<Bundle> mActionExtrasList = new ArrayList();
|
||||
private final Bundle mExtras = new Bundle();
|
||||
|
||||
@Override // androidx.core.app.NotificationBuilderWithBuilderAccessor
|
||||
public Notification.Builder getBuilder() {
|
||||
return this.mBuilder;
|
||||
}
|
||||
|
||||
Context getContext() {
|
||||
return this.mContext;
|
||||
}
|
||||
|
||||
NotificationCompatBuilder(NotificationCompat.Builder builder) {
|
||||
List list;
|
||||
Notification.Builder badgeIconType;
|
||||
Notification.Builder settingsText;
|
||||
Notification.Builder shortcutId;
|
||||
Notification.Builder timeoutAfter;
|
||||
this.mBuilderCompat = builder;
|
||||
this.mContext = builder.mContext;
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m77m$3();
|
||||
this.mBuilder = NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m(builder.mContext, builder.mChannelId);
|
||||
} else {
|
||||
this.mBuilder = new Notification.Builder(builder.mContext);
|
||||
}
|
||||
Notification notification = builder.mNotification;
|
||||
this.mBuilder.setWhen(notification.when).setSmallIcon(notification.icon, notification.iconLevel).setContent(notification.contentView).setTicker(notification.tickerText, builder.mTickerView).setVibrate(notification.vibrate).setLights(notification.ledARGB, notification.ledOnMS, notification.ledOffMS).setOngoing((notification.flags & 2) != 0).setOnlyAlertOnce((notification.flags & 8) != 0).setAutoCancel((notification.flags & 16) != 0).setDefaults(notification.defaults).setContentTitle(builder.mContentTitle).setContentText(builder.mContentText).setContentInfo(builder.mContentInfo).setContentIntent(builder.mContentIntent).setDeleteIntent(notification.deleteIntent).setFullScreenIntent(builder.mFullScreenIntent, (notification.flags & 128) != 0).setLargeIcon(builder.mLargeIcon).setNumber(builder.mNumber).setProgress(builder.mProgressMax, builder.mProgress, builder.mProgressIndeterminate);
|
||||
this.mBuilder.setSubText(builder.mSubText).setUsesChronometer(builder.mUseChronometer).setPriority(builder.mPriority);
|
||||
Iterator<NotificationCompat.Action> it = builder.mActions.iterator();
|
||||
while (it.hasNext()) {
|
||||
addAction(it.next());
|
||||
}
|
||||
if (builder.mExtras != null) {
|
||||
this.mExtras.putAll(builder.mExtras);
|
||||
}
|
||||
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);
|
||||
if (Build.VERSION.SDK_INT < 28) {
|
||||
list = combineLists(getPeople(builder.mPersonList), builder.mPeople);
|
||||
} else {
|
||||
list = builder.mPeople;
|
||||
}
|
||||
if (list != null && !list.isEmpty()) {
|
||||
Iterator it2 = list.iterator();
|
||||
while (it2.hasNext()) {
|
||||
this.mBuilder.addPerson((String) it2.next());
|
||||
}
|
||||
}
|
||||
this.mHeadsUpContentView = builder.mHeadsUpContentView;
|
||||
if (builder.mInvisibleActions.size() > 0) {
|
||||
Bundle bundle = builder.getExtras().getBundle("android.car.EXTENSIONS");
|
||||
bundle = bundle == null ? new Bundle() : bundle;
|
||||
Bundle bundle2 = new Bundle(bundle);
|
||||
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.putBundle("invisible_actions", bundle3);
|
||||
bundle2.putBundle("invisible_actions", bundle3);
|
||||
builder.getExtras().putBundle("android.car.EXTENSIONS", bundle);
|
||||
this.mExtras.putBundle("android.car.EXTENSIONS", bundle2);
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 23 && builder.mSmallIcon != null) {
|
||||
this.mBuilder.setSmallIcon(builder.mSmallIcon);
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
this.mBuilder.setExtras(builder.mExtras).setRemoteInputHistory(builder.mRemoteInputHistory);
|
||||
if (builder.mContentView != null) {
|
||||
this.mBuilder.setCustomContentView(builder.mContentView);
|
||||
}
|
||||
if (builder.mBigContentView != null) {
|
||||
this.mBuilder.setCustomBigContentView(builder.mBigContentView);
|
||||
}
|
||||
if (builder.mHeadsUpContentView != null) {
|
||||
this.mBuilder.setCustomHeadsUpContentView(builder.mHeadsUpContentView);
|
||||
}
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
badgeIconType = this.mBuilder.setBadgeIconType(builder.mBadgeIcon);
|
||||
settingsText = badgeIconType.setSettingsText(builder.mSettingsText);
|
||||
shortcutId = settingsText.setShortcutId(builder.mShortcutId);
|
||||
timeoutAfter = shortcutId.setTimeoutAfter(builder.mTimeout);
|
||||
timeoutAfter.setGroupAlertBehavior(builder.mGroupAlertBehavior);
|
||||
if (builder.mColorizedSet) {
|
||||
this.mBuilder.setColorized(builder.mColorized);
|
||||
}
|
||||
if (!TextUtils.isEmpty(builder.mChannelId)) {
|
||||
this.mBuilder.setSound(null).setDefaults(0).setLights(0, 0, 0).setVibrate(null);
|
||||
}
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
Iterator<Person> it3 = builder.mPersonList.iterator();
|
||||
while (it3.hasNext()) {
|
||||
this.mBuilder.addPerson(it3.next().toAndroidPerson());
|
||||
}
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 29) {
|
||||
this.mBuilder.setAllowSystemGeneratedContextualActions(builder.mAllowSystemGeneratedContextualActions);
|
||||
this.mBuilder.setBubbleMetadata(NotificationCompat.BubbleMetadata.toPlatform(builder.mBubbleMetadata));
|
||||
if (builder.mLocusId != null) {
|
||||
this.mBuilder.setLocusId(builder.mLocusId.toLocusId());
|
||||
}
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 31 && builder.mFgsDeferBehavior != 0) {
|
||||
this.mBuilder.setForegroundServiceBehavior(builder.mFgsDeferBehavior);
|
||||
}
|
||||
if (builder.mSilent) {
|
||||
if (this.mBuilderCompat.mGroupSummary) {
|
||||
this.mGroupAlertBehavior = 2;
|
||||
} else {
|
||||
this.mGroupAlertBehavior = 1;
|
||||
}
|
||||
this.mBuilder.setVibrate(null);
|
||||
this.mBuilder.setSound(null);
|
||||
notification.defaults &= -2;
|
||||
notification.defaults &= -3;
|
||||
this.mBuilder.setDefaults(notification.defaults);
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
if (TextUtils.isEmpty(this.mBuilderCompat.mGroupKey)) {
|
||||
this.mBuilder.setGroup(NotificationCompat.GROUP_KEY_SILENT);
|
||||
}
|
||||
this.mBuilder.setGroupAlertBehavior(this.mGroupAlertBehavior);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static List<String> combineLists(List<String> list, List<String> list2) {
|
||||
if (list == null) {
|
||||
return list2;
|
||||
}
|
||||
if (list2 == null) {
|
||||
return list;
|
||||
}
|
||||
ArraySet arraySet = new ArraySet(list.size() + list2.size());
|
||||
arraySet.addAll(list);
|
||||
arraySet.addAll(list2);
|
||||
return new ArrayList(arraySet);
|
||||
}
|
||||
|
||||
private static List<String> getPeople(List<Person> list) {
|
||||
if (list == null) {
|
||||
return null;
|
||||
}
|
||||
ArrayList arrayList = new ArrayList(list.size());
|
||||
Iterator<Person> it = list.iterator();
|
||||
while (it.hasNext()) {
|
||||
arrayList.add(it.next().resolveToLegacyUri());
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public Notification build() {
|
||||
Bundle extras;
|
||||
RemoteViews makeHeadsUpContentView;
|
||||
RemoteViews makeBigContentView;
|
||||
NotificationCompat.Style style = this.mBuilderCompat.mStyle;
|
||||
if (style != null) {
|
||||
style.apply(this);
|
||||
}
|
||||
RemoteViews makeContentView = style != null ? style.makeContentView(this) : null;
|
||||
Notification buildInternal = buildInternal();
|
||||
if (makeContentView != null) {
|
||||
buildInternal.contentView = makeContentView;
|
||||
} else if (this.mBuilderCompat.mContentView != null) {
|
||||
buildInternal.contentView = this.mBuilderCompat.mContentView;
|
||||
}
|
||||
if (style != null && (makeBigContentView = style.makeBigContentView(this)) != null) {
|
||||
buildInternal.bigContentView = makeBigContentView;
|
||||
}
|
||||
if (style != null && (makeHeadsUpContentView = this.mBuilderCompat.mStyle.makeHeadsUpContentView(this)) != null) {
|
||||
buildInternal.headsUpContentView = makeHeadsUpContentView;
|
||||
}
|
||||
if (style != null && (extras = NotificationCompat.getExtras(buildInternal)) != null) {
|
||||
style.addCompatExtras(extras);
|
||||
}
|
||||
return buildInternal;
|
||||
}
|
||||
|
||||
private void addAction(NotificationCompat.Action action) {
|
||||
Notification.Action.Builder builder;
|
||||
Bundle bundle;
|
||||
IconCompat iconCompat = action.getIconCompat();
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m75m$2();
|
||||
builder = NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m(iconCompat != null ? iconCompat.toIcon() : null, action.getTitle(), action.getActionIntent());
|
||||
} else {
|
||||
builder = new Notification.Action.Builder(iconCompat != null ? iconCompat.getResId() : 0, action.getTitle(), action.getActionIntent());
|
||||
}
|
||||
if (action.getRemoteInputs() != null) {
|
||||
for (android.app.RemoteInput remoteInput : RemoteInput.fromCompat(action.getRemoteInputs())) {
|
||||
builder.addRemoteInput(remoteInput);
|
||||
}
|
||||
}
|
||||
if (action.getExtras() != null) {
|
||||
bundle = new Bundle(action.getExtras());
|
||||
} else {
|
||||
bundle = new Bundle();
|
||||
}
|
||||
bundle.putBoolean("android.support.allowGeneratedReplies", action.getAllowGeneratedReplies());
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
builder.setAllowGeneratedReplies(action.getAllowGeneratedReplies());
|
||||
}
|
||||
bundle.putInt("android.support.action.semanticAction", action.getSemanticAction());
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
builder.setSemanticAction(action.getSemanticAction());
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 29) {
|
||||
builder.setContextual(action.isContextual());
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 31) {
|
||||
builder.setAuthenticationRequired(action.isAuthenticationRequired());
|
||||
}
|
||||
bundle.putBoolean("android.support.action.showsUserInterface", action.getShowsUserInterface());
|
||||
builder.addExtras(bundle);
|
||||
this.mBuilder.addAction(builder.build());
|
||||
}
|
||||
|
||||
protected Notification buildInternal() {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
return this.mBuilder.build();
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
Notification build = this.mBuilder.build();
|
||||
if (this.mGroupAlertBehavior != 0) {
|
||||
if (build.getGroup() != null && (build.flags & 512) != 0 && this.mGroupAlertBehavior == 2) {
|
||||
removeSoundAndVibration(build);
|
||||
}
|
||||
if (build.getGroup() != null && (build.flags & 512) == 0 && this.mGroupAlertBehavior == 1) {
|
||||
removeSoundAndVibration(build);
|
||||
}
|
||||
}
|
||||
return build;
|
||||
}
|
||||
this.mBuilder.setExtras(this.mExtras);
|
||||
Notification build2 = this.mBuilder.build();
|
||||
RemoteViews remoteViews = this.mContentView;
|
||||
if (remoteViews != null) {
|
||||
build2.contentView = remoteViews;
|
||||
}
|
||||
RemoteViews remoteViews2 = this.mBigContentView;
|
||||
if (remoteViews2 != null) {
|
||||
build2.bigContentView = remoteViews2;
|
||||
}
|
||||
RemoteViews remoteViews3 = this.mHeadsUpContentView;
|
||||
if (remoteViews3 != null) {
|
||||
build2.headsUpContentView = remoteViews3;
|
||||
}
|
||||
if (this.mGroupAlertBehavior != 0) {
|
||||
if (build2.getGroup() != null && (build2.flags & 512) != 0 && this.mGroupAlertBehavior == 2) {
|
||||
removeSoundAndVibration(build2);
|
||||
}
|
||||
if (build2.getGroup() != null && (build2.flags & 512) == 0 && this.mGroupAlertBehavior == 1) {
|
||||
removeSoundAndVibration(build2);
|
||||
}
|
||||
}
|
||||
return build2;
|
||||
}
|
||||
|
||||
private void removeSoundAndVibration(Notification notification) {
|
||||
notification.sound = null;
|
||||
notification.vibrate = null;
|
||||
notification.defaults &= -2;
|
||||
notification.defaults &= -3;
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package androidx.core.app;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class NotificationCompatExtras {
|
||||
public static final String EXTRA_ACTION_EXTRAS = "android.support.actionExtras";
|
||||
public static final String EXTRA_GROUP_KEY = "android.support.groupKey";
|
||||
public static final String EXTRA_GROUP_SUMMARY = "android.support.isGroupSummary";
|
||||
public static final String EXTRA_LOCAL_ONLY = "android.support.localOnly";
|
||||
public static final String EXTRA_REMOTE_INPUTS = "android.support.remoteInputs";
|
||||
public static final String EXTRA_SORT_KEY = "android.support.sortKey";
|
||||
|
||||
private NotificationCompatExtras() {
|
||||
}
|
||||
}
|
@ -0,0 +1,286 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.PendingIntent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.core.graphics.drawable.IconCompat;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class NotificationCompatJellybean {
|
||||
static final String EXTRA_ALLOW_GENERATED_REPLIES = "android.support.allowGeneratedReplies";
|
||||
static final String EXTRA_DATA_ONLY_REMOTE_INPUTS = "android.support.dataRemoteInputs";
|
||||
private static final String KEY_ACTION_INTENT = "actionIntent";
|
||||
private static final String KEY_ALLOWED_DATA_TYPES = "allowedDataTypes";
|
||||
private static final String KEY_ALLOW_FREE_FORM_INPUT = "allowFreeFormInput";
|
||||
private static final String KEY_CHOICES = "choices";
|
||||
private static final String KEY_DATA_ONLY_REMOTE_INPUTS = "dataOnlyRemoteInputs";
|
||||
private static final String KEY_EXTRAS = "extras";
|
||||
private static final String KEY_ICON = "icon";
|
||||
private static final String KEY_LABEL = "label";
|
||||
private static final String KEY_REMOTE_INPUTS = "remoteInputs";
|
||||
private static final String KEY_RESULT_KEY = "resultKey";
|
||||
private static final String KEY_SEMANTIC_ACTION = "semanticAction";
|
||||
private static final String KEY_SHOWS_USER_INTERFACE = "showsUserInterface";
|
||||
private static final String KEY_TITLE = "title";
|
||||
public static final String TAG = "NotificationCompat";
|
||||
private static Field sActionIconField;
|
||||
private static Field sActionIntentField;
|
||||
private static Field sActionTitleField;
|
||||
private static boolean sActionsAccessFailed;
|
||||
private static Field sActionsField;
|
||||
private static Field sExtrasField;
|
||||
private static boolean sExtrasFieldAccessFailed;
|
||||
private static final Object sExtrasLock = new Object();
|
||||
private static final Object sActionsLock = new Object();
|
||||
|
||||
public static SparseArray<Bundle> buildActionExtrasMap(List<Bundle> list) {
|
||||
int size = list.size();
|
||||
SparseArray<Bundle> sparseArray = null;
|
||||
for (int i = 0; i < size; i++) {
|
||||
Bundle bundle = list.get(i);
|
||||
if (bundle != null) {
|
||||
if (sparseArray == null) {
|
||||
sparseArray = new SparseArray<>();
|
||||
}
|
||||
sparseArray.put(i, bundle);
|
||||
}
|
||||
}
|
||||
return sparseArray;
|
||||
}
|
||||
|
||||
public static Bundle getExtras(Notification notification) {
|
||||
synchronized (sExtrasLock) {
|
||||
if (sExtrasFieldAccessFailed) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
if (sExtrasField == null) {
|
||||
Field declaredField = Notification.class.getDeclaredField(KEY_EXTRAS);
|
||||
if (!Bundle.class.isAssignableFrom(declaredField.getType())) {
|
||||
Log.e(TAG, "Notification.extras field is not of type Bundle");
|
||||
sExtrasFieldAccessFailed = true;
|
||||
return null;
|
||||
}
|
||||
declaredField.setAccessible(true);
|
||||
sExtrasField = declaredField;
|
||||
}
|
||||
Bundle bundle = (Bundle) sExtrasField.get(notification);
|
||||
if (bundle == null) {
|
||||
bundle = new Bundle();
|
||||
sExtrasField.set(notification, bundle);
|
||||
}
|
||||
return bundle;
|
||||
} catch (IllegalAccessException e) {
|
||||
Log.e(TAG, "Unable to access notification extras", e);
|
||||
sExtrasFieldAccessFailed = true;
|
||||
return null;
|
||||
} catch (NoSuchFieldException e2) {
|
||||
Log.e(TAG, "Unable to access notification extras", e2);
|
||||
sExtrasFieldAccessFailed = true;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static NotificationCompat.Action readAction(int i, CharSequence charSequence, PendingIntent pendingIntent, Bundle bundle) {
|
||||
RemoteInput[] remoteInputArr;
|
||||
RemoteInput[] remoteInputArr2;
|
||||
boolean z;
|
||||
if (bundle != null) {
|
||||
remoteInputArr = fromBundleArray(getBundleArrayFromBundle(bundle, NotificationCompatExtras.EXTRA_REMOTE_INPUTS));
|
||||
remoteInputArr2 = fromBundleArray(getBundleArrayFromBundle(bundle, EXTRA_DATA_ONLY_REMOTE_INPUTS));
|
||||
z = bundle.getBoolean(EXTRA_ALLOW_GENERATED_REPLIES);
|
||||
} else {
|
||||
remoteInputArr = null;
|
||||
remoteInputArr2 = null;
|
||||
z = false;
|
||||
}
|
||||
return new NotificationCompat.Action(i, charSequence, pendingIntent, bundle, remoteInputArr, remoteInputArr2, z, 0, true, false, false);
|
||||
}
|
||||
|
||||
public static Bundle writeActionAndGetExtras(Notification.Builder builder, NotificationCompat.Action action) {
|
||||
IconCompat iconCompat = action.getIconCompat();
|
||||
builder.addAction(iconCompat != null ? iconCompat.getResId() : 0, action.getTitle(), action.getActionIntent());
|
||||
Bundle bundle = new Bundle(action.getExtras());
|
||||
if (action.getRemoteInputs() != null) {
|
||||
bundle.putParcelableArray(NotificationCompatExtras.EXTRA_REMOTE_INPUTS, toBundleArray(action.getRemoteInputs()));
|
||||
}
|
||||
if (action.getDataOnlyRemoteInputs() != null) {
|
||||
bundle.putParcelableArray(EXTRA_DATA_ONLY_REMOTE_INPUTS, toBundleArray(action.getDataOnlyRemoteInputs()));
|
||||
}
|
||||
bundle.putBoolean(EXTRA_ALLOW_GENERATED_REPLIES, action.getAllowGeneratedReplies());
|
||||
return bundle;
|
||||
}
|
||||
|
||||
public static int getActionCount(Notification notification) {
|
||||
int length;
|
||||
synchronized (sActionsLock) {
|
||||
Object[] actionObjectsLocked = getActionObjectsLocked(notification);
|
||||
length = actionObjectsLocked != null ? actionObjectsLocked.length : 0;
|
||||
}
|
||||
return length;
|
||||
}
|
||||
|
||||
public static NotificationCompat.Action getAction(Notification notification, int i) {
|
||||
SparseArray sparseParcelableArray;
|
||||
synchronized (sActionsLock) {
|
||||
try {
|
||||
try {
|
||||
Object[] actionObjectsLocked = getActionObjectsLocked(notification);
|
||||
if (actionObjectsLocked != null) {
|
||||
Object obj = actionObjectsLocked[i];
|
||||
Bundle extras = getExtras(notification);
|
||||
return readAction(sActionIconField.getInt(obj), (CharSequence) sActionTitleField.get(obj), (PendingIntent) sActionIntentField.get(obj), (extras == null || (sparseParcelableArray = extras.getSparseParcelableArray(NotificationCompatExtras.EXTRA_ACTION_EXTRAS)) == null) ? null : (Bundle) sparseParcelableArray.get(i));
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
Log.e(TAG, "Unable to access notification actions", e);
|
||||
sActionsAccessFailed = true;
|
||||
}
|
||||
return null;
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Object[] getActionObjectsLocked(Notification notification) {
|
||||
synchronized (sActionsLock) {
|
||||
if (!ensureActionReflectionReadyLocked()) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return (Object[]) sActionsField.get(notification);
|
||||
} catch (IllegalAccessException e) {
|
||||
Log.e(TAG, "Unable to access notification actions", e);
|
||||
sActionsAccessFailed = true;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean ensureActionReflectionReadyLocked() {
|
||||
if (sActionsAccessFailed) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
if (sActionsField == null) {
|
||||
Class<?> cls = Class.forName("android.app.Notification$Action");
|
||||
sActionIconField = cls.getDeclaredField(KEY_ICON);
|
||||
sActionTitleField = cls.getDeclaredField(KEY_TITLE);
|
||||
sActionIntentField = cls.getDeclaredField(KEY_ACTION_INTENT);
|
||||
Field declaredField = Notification.class.getDeclaredField("actions");
|
||||
sActionsField = declaredField;
|
||||
declaredField.setAccessible(true);
|
||||
}
|
||||
} catch (ClassNotFoundException e) {
|
||||
Log.e(TAG, "Unable to access notification actions", e);
|
||||
sActionsAccessFailed = true;
|
||||
} catch (NoSuchFieldException e2) {
|
||||
Log.e(TAG, "Unable to access notification actions", e2);
|
||||
sActionsAccessFailed = true;
|
||||
}
|
||||
return !sActionsAccessFailed;
|
||||
}
|
||||
|
||||
static NotificationCompat.Action getActionFromBundle(Bundle bundle) {
|
||||
Bundle bundle2 = bundle.getBundle(KEY_EXTRAS);
|
||||
return new NotificationCompat.Action(bundle.getInt(KEY_ICON), bundle.getCharSequence(KEY_TITLE), (PendingIntent) bundle.getParcelable(KEY_ACTION_INTENT), bundle.getBundle(KEY_EXTRAS), fromBundleArray(getBundleArrayFromBundle(bundle, KEY_REMOTE_INPUTS)), fromBundleArray(getBundleArrayFromBundle(bundle, KEY_DATA_ONLY_REMOTE_INPUTS)), bundle2 != null ? bundle2.getBoolean(EXTRA_ALLOW_GENERATED_REPLIES, false) : false, bundle.getInt(KEY_SEMANTIC_ACTION), bundle.getBoolean(KEY_SHOWS_USER_INTERFACE), false, false);
|
||||
}
|
||||
|
||||
static Bundle getBundleForAction(NotificationCompat.Action action) {
|
||||
Bundle bundle;
|
||||
Bundle bundle2 = new Bundle();
|
||||
IconCompat iconCompat = action.getIconCompat();
|
||||
bundle2.putInt(KEY_ICON, iconCompat != null ? iconCompat.getResId() : 0);
|
||||
bundle2.putCharSequence(KEY_TITLE, action.getTitle());
|
||||
bundle2.putParcelable(KEY_ACTION_INTENT, action.getActionIntent());
|
||||
if (action.getExtras() != null) {
|
||||
bundle = new Bundle(action.getExtras());
|
||||
} else {
|
||||
bundle = new Bundle();
|
||||
}
|
||||
bundle.putBoolean(EXTRA_ALLOW_GENERATED_REPLIES, action.getAllowGeneratedReplies());
|
||||
bundle2.putBundle(KEY_EXTRAS, bundle);
|
||||
bundle2.putParcelableArray(KEY_REMOTE_INPUTS, toBundleArray(action.getRemoteInputs()));
|
||||
bundle2.putBoolean(KEY_SHOWS_USER_INTERFACE, action.getShowsUserInterface());
|
||||
bundle2.putInt(KEY_SEMANTIC_ACTION, action.getSemanticAction());
|
||||
return bundle2;
|
||||
}
|
||||
|
||||
private static RemoteInput fromBundle(Bundle bundle) {
|
||||
ArrayList<String> stringArrayList = bundle.getStringArrayList(KEY_ALLOWED_DATA_TYPES);
|
||||
HashSet hashSet = new HashSet();
|
||||
if (stringArrayList != null) {
|
||||
Iterator<String> it = stringArrayList.iterator();
|
||||
while (it.hasNext()) {
|
||||
hashSet.add(it.next());
|
||||
}
|
||||
}
|
||||
return new RemoteInput(bundle.getString(KEY_RESULT_KEY), bundle.getCharSequence(KEY_LABEL), bundle.getCharSequenceArray(KEY_CHOICES), bundle.getBoolean(KEY_ALLOW_FREE_FORM_INPUT), 0, bundle.getBundle(KEY_EXTRAS), hashSet);
|
||||
}
|
||||
|
||||
private static Bundle toBundle(RemoteInput remoteInput) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(KEY_RESULT_KEY, remoteInput.getResultKey());
|
||||
bundle.putCharSequence(KEY_LABEL, remoteInput.getLabel());
|
||||
bundle.putCharSequenceArray(KEY_CHOICES, remoteInput.getChoices());
|
||||
bundle.putBoolean(KEY_ALLOW_FREE_FORM_INPUT, remoteInput.getAllowFreeFormInput());
|
||||
bundle.putBundle(KEY_EXTRAS, remoteInput.getExtras());
|
||||
Set<String> allowedDataTypes = remoteInput.getAllowedDataTypes();
|
||||
if (allowedDataTypes != null && !allowedDataTypes.isEmpty()) {
|
||||
ArrayList<String> arrayList = new ArrayList<>(allowedDataTypes.size());
|
||||
Iterator<String> it = allowedDataTypes.iterator();
|
||||
while (it.hasNext()) {
|
||||
arrayList.add(it.next());
|
||||
}
|
||||
bundle.putStringArrayList(KEY_ALLOWED_DATA_TYPES, arrayList);
|
||||
}
|
||||
return bundle;
|
||||
}
|
||||
|
||||
private static RemoteInput[] fromBundleArray(Bundle[] bundleArr) {
|
||||
if (bundleArr == null) {
|
||||
return null;
|
||||
}
|
||||
RemoteInput[] remoteInputArr = new RemoteInput[bundleArr.length];
|
||||
for (int i = 0; i < bundleArr.length; i++) {
|
||||
remoteInputArr[i] = fromBundle(bundleArr[i]);
|
||||
}
|
||||
return remoteInputArr;
|
||||
}
|
||||
|
||||
private static Bundle[] toBundleArray(RemoteInput[] remoteInputArr) {
|
||||
if (remoteInputArr == null) {
|
||||
return null;
|
||||
}
|
||||
Bundle[] bundleArr = new Bundle[remoteInputArr.length];
|
||||
for (int i = 0; i < remoteInputArr.length; i++) {
|
||||
bundleArr[i] = toBundle(remoteInputArr[i]);
|
||||
}
|
||||
return bundleArr;
|
||||
}
|
||||
|
||||
private static Bundle[] getBundleArrayFromBundle(Bundle bundle, String str) {
|
||||
Parcelable[] parcelableArray = bundle.getParcelableArray(str);
|
||||
if ((parcelableArray instanceof Bundle[]) || parcelableArray == null) {
|
||||
return (Bundle[]) parcelableArray;
|
||||
}
|
||||
Bundle[] bundleArr = (Bundle[]) Arrays.copyOf(parcelableArray, parcelableArray.length, Bundle[].class);
|
||||
bundle.putParcelableArray(str, bundleArr);
|
||||
return bundleArr;
|
||||
}
|
||||
|
||||
private NotificationCompatJellybean() {
|
||||
}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.support.v4.app.INotificationSideChannel;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class NotificationCompatSideChannelService extends Service {
|
||||
public abstract void cancel(String str, int i, String str2);
|
||||
|
||||
public abstract void cancelAll(String str);
|
||||
|
||||
public abstract void notify(String str, int i, String str2, Notification notification);
|
||||
|
||||
@Override // android.app.Service
|
||||
public IBinder onBind(Intent intent) {
|
||||
intent.getAction().equals(NotificationManagerCompat.ACTION_BIND_SIDE_CHANNEL);
|
||||
return null;
|
||||
}
|
||||
|
||||
private class NotificationSideChannelStub extends INotificationSideChannel.Stub {
|
||||
NotificationSideChannelStub() {
|
||||
}
|
||||
|
||||
@Override // android.support.v4.app.INotificationSideChannel
|
||||
public void notify(String str, int i, String str2, Notification notification) throws RemoteException {
|
||||
NotificationCompatSideChannelService.this.checkPermission(getCallingUid(), str);
|
||||
long clearCallingIdentity = clearCallingIdentity();
|
||||
try {
|
||||
NotificationCompatSideChannelService.this.notify(str, i, str2, notification);
|
||||
} finally {
|
||||
restoreCallingIdentity(clearCallingIdentity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.app.INotificationSideChannel
|
||||
public void cancel(String str, int i, String str2) throws RemoteException {
|
||||
NotificationCompatSideChannelService.this.checkPermission(getCallingUid(), str);
|
||||
long clearCallingIdentity = clearCallingIdentity();
|
||||
try {
|
||||
NotificationCompatSideChannelService.this.cancel(str, i, str2);
|
||||
} finally {
|
||||
restoreCallingIdentity(clearCallingIdentity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.app.INotificationSideChannel
|
||||
public void cancelAll(String str) {
|
||||
NotificationCompatSideChannelService.this.checkPermission(getCallingUid(), str);
|
||||
long clearCallingIdentity = clearCallingIdentity();
|
||||
try {
|
||||
NotificationCompatSideChannelService.this.cancelAll(str);
|
||||
} finally {
|
||||
restoreCallingIdentity(clearCallingIdentity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void checkPermission(int i, String str) {
|
||||
for (String str2 : getPackageManager().getPackagesForUid(i)) {
|
||||
if (str2.equals(str)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw new SecurityException("NotificationSideChannelService: Uid " + i + " is not authorized for package " + str);
|
||||
}
|
||||
}
|
@ -0,0 +1,673 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.AppOpsManager;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationChannelGroup;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.DeadObjectException;
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.os.IBinder;
|
||||
import android.os.Message;
|
||||
import android.os.RemoteException;
|
||||
import android.provider.Settings;
|
||||
import android.support.v4.app.INotificationSideChannel;
|
||||
import android.util.Log;
|
||||
import androidx.activity.ComponentDialog$$ExternalSyntheticApiModelOutline0;
|
||||
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;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class NotificationManagerCompat {
|
||||
public static final String ACTION_BIND_SIDE_CHANNEL = "android.support.BIND_NOTIFICATION_SIDE_CHANNEL";
|
||||
private static final String CHECK_OP_NO_THROW = "checkOpNoThrow";
|
||||
public static final String EXTRA_USE_SIDE_CHANNEL = "android.support.useSideChannel";
|
||||
public static final int IMPORTANCE_DEFAULT = 3;
|
||||
public static final int IMPORTANCE_HIGH = 4;
|
||||
public static final int IMPORTANCE_LOW = 2;
|
||||
public static final int IMPORTANCE_MAX = 5;
|
||||
public static final int IMPORTANCE_MIN = 1;
|
||||
public static final int IMPORTANCE_NONE = 0;
|
||||
public static final int IMPORTANCE_UNSPECIFIED = -1000;
|
||||
static final int MAX_SIDE_CHANNEL_SDK_VERSION = 19;
|
||||
private static final String OP_POST_NOTIFICATION = "OP_POST_NOTIFICATION";
|
||||
private static final String SETTING_ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
|
||||
private static final int SIDE_CHANNEL_RETRY_BASE_INTERVAL_MS = 1000;
|
||||
private static final int SIDE_CHANNEL_RETRY_MAX_COUNT = 6;
|
||||
private static final String TAG = "NotifManCompat";
|
||||
private static String sEnabledNotificationListeners;
|
||||
private static SideChannelManager sSideChannelManager;
|
||||
private final Context mContext;
|
||||
private final NotificationManager mNotificationManager;
|
||||
private static final Object sEnabledNotificationListenersLock = new Object();
|
||||
private static Set<String> sEnabledNotificationListenerPackages = new HashSet();
|
||||
private static final Object sLock = new Object();
|
||||
|
||||
private interface Task {
|
||||
void send(INotificationSideChannel iNotificationSideChannel) throws RemoteException;
|
||||
}
|
||||
|
||||
public static NotificationManagerCompat from(Context context) {
|
||||
return new NotificationManagerCompat(context);
|
||||
}
|
||||
|
||||
private NotificationManagerCompat(Context context) {
|
||||
this.mContext = context;
|
||||
this.mNotificationManager = (NotificationManager) context.getSystemService("notification");
|
||||
}
|
||||
|
||||
public void cancel(int i) {
|
||||
cancel(null, i);
|
||||
}
|
||||
|
||||
public void cancel(String str, int i) {
|
||||
this.mNotificationManager.cancel(str, i);
|
||||
}
|
||||
|
||||
public void cancelAll() {
|
||||
this.mNotificationManager.cancelAll();
|
||||
}
|
||||
|
||||
public void notify(int i, Notification notification) {
|
||||
notify(null, i, notification);
|
||||
}
|
||||
|
||||
public void notify(String str, int i, Notification notification) {
|
||||
if (useSideChannelForNotification(notification)) {
|
||||
pushSideChannelQueue(new NotifyTask(this.mContext.getPackageName(), i, str, notification));
|
||||
this.mNotificationManager.cancel(str, i);
|
||||
} else {
|
||||
this.mNotificationManager.notify(str, i, notification);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean areNotificationsEnabled() {
|
||||
boolean areNotificationsEnabled;
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
areNotificationsEnabled = this.mNotificationManager.areNotificationsEnabled();
|
||||
return areNotificationsEnabled;
|
||||
}
|
||||
AppOpsManager appOpsManager = (AppOpsManager) this.mContext.getSystemService("appops");
|
||||
ApplicationInfo applicationInfo = this.mContext.getApplicationInfo();
|
||||
String packageName = this.mContext.getApplicationContext().getPackageName();
|
||||
int i = applicationInfo.uid;
|
||||
try {
|
||||
Class<?> cls = Class.forName(AppOpsManager.class.getName());
|
||||
return ((Integer) cls.getMethod(CHECK_OP_NO_THROW, Integer.TYPE, Integer.TYPE, String.class).invoke(appOpsManager, Integer.valueOf(((Integer) cls.getDeclaredField(OP_POST_NOTIFICATION).get(Integer.class)).intValue()), Integer.valueOf(i), packageName)).intValue() == 0;
|
||||
} catch (ClassNotFoundException | IllegalAccessException | NoSuchFieldException | NoSuchMethodException | RuntimeException | InvocationTargetException unused) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public int getImportance() {
|
||||
int importance;
|
||||
if (Build.VERSION.SDK_INT < 24) {
|
||||
return IMPORTANCE_UNSPECIFIED;
|
||||
}
|
||||
importance = this.mNotificationManager.getImportance();
|
||||
return importance;
|
||||
}
|
||||
|
||||
public void createNotificationChannel(NotificationChannel notificationChannel) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
this.mNotificationManager.createNotificationChannel(notificationChannel);
|
||||
}
|
||||
}
|
||||
|
||||
public void createNotificationChannel(NotificationChannelCompat notificationChannelCompat) {
|
||||
createNotificationChannel(notificationChannelCompat.getNotificationChannel());
|
||||
}
|
||||
|
||||
public void createNotificationChannelGroup(NotificationChannelGroup notificationChannelGroup) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
this.mNotificationManager.createNotificationChannelGroup(notificationChannelGroup);
|
||||
}
|
||||
}
|
||||
|
||||
public void createNotificationChannelGroup(NotificationChannelGroupCompat notificationChannelGroupCompat) {
|
||||
createNotificationChannelGroup(notificationChannelGroupCompat.getNotificationChannelGroup());
|
||||
}
|
||||
|
||||
public void createNotificationChannels(List<NotificationChannel> list) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
this.mNotificationManager.createNotificationChannels(list);
|
||||
}
|
||||
}
|
||||
|
||||
public void createNotificationChannelsCompat(List<NotificationChannelCompat> list) {
|
||||
if (Build.VERSION.SDK_INT < 26 || list.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
ArrayList arrayList = new ArrayList(list.size());
|
||||
Iterator<NotificationChannelCompat> it = list.iterator();
|
||||
while (it.hasNext()) {
|
||||
arrayList.add(it.next().getNotificationChannel());
|
||||
}
|
||||
this.mNotificationManager.createNotificationChannels(arrayList);
|
||||
}
|
||||
|
||||
public void createNotificationChannelGroups(List<NotificationChannelGroup> list) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
this.mNotificationManager.createNotificationChannelGroups(list);
|
||||
}
|
||||
}
|
||||
|
||||
public void createNotificationChannelGroupsCompat(List<NotificationChannelGroupCompat> list) {
|
||||
if (Build.VERSION.SDK_INT < 26 || list.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
ArrayList arrayList = new ArrayList(list.size());
|
||||
Iterator<NotificationChannelGroupCompat> it = list.iterator();
|
||||
while (it.hasNext()) {
|
||||
arrayList.add(it.next().getNotificationChannelGroup());
|
||||
}
|
||||
this.mNotificationManager.createNotificationChannelGroups(arrayList);
|
||||
}
|
||||
|
||||
public void deleteNotificationChannel(String str) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
this.mNotificationManager.deleteNotificationChannel(str);
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteNotificationChannelGroup(String str) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
this.mNotificationManager.deleteNotificationChannelGroup(str);
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteUnlistedNotificationChannels(Collection<String> collection) {
|
||||
List notificationChannels;
|
||||
String id;
|
||||
String id2;
|
||||
String parentChannelId;
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
notificationChannels = this.mNotificationManager.getNotificationChannels();
|
||||
Iterator it = notificationChannels.iterator();
|
||||
while (it.hasNext()) {
|
||||
NotificationChannel m = ComponentDialog$$ExternalSyntheticApiModelOutline0.m(it.next());
|
||||
id = m.getId();
|
||||
if (!collection.contains(id)) {
|
||||
if (Build.VERSION.SDK_INT >= 30) {
|
||||
parentChannelId = m.getParentChannelId();
|
||||
if (collection.contains(parentChannelId)) {
|
||||
}
|
||||
}
|
||||
NotificationManager notificationManager = this.mNotificationManager;
|
||||
id2 = m.getId();
|
||||
notificationManager.deleteNotificationChannel(id2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public NotificationChannel getNotificationChannel(String str) {
|
||||
NotificationChannel notificationChannel;
|
||||
if (Build.VERSION.SDK_INT < 26) {
|
||||
return null;
|
||||
}
|
||||
notificationChannel = this.mNotificationManager.getNotificationChannel(str);
|
||||
return notificationChannel;
|
||||
}
|
||||
|
||||
public NotificationChannelCompat getNotificationChannelCompat(String str) {
|
||||
NotificationChannel notificationChannel;
|
||||
if (Build.VERSION.SDK_INT < 26 || (notificationChannel = getNotificationChannel(str)) == null) {
|
||||
return null;
|
||||
}
|
||||
return new NotificationChannelCompat(notificationChannel);
|
||||
}
|
||||
|
||||
public NotificationChannel getNotificationChannel(String str, String str2) {
|
||||
NotificationChannel notificationChannel;
|
||||
if (Build.VERSION.SDK_INT >= 30) {
|
||||
notificationChannel = this.mNotificationManager.getNotificationChannel(str, str2);
|
||||
return notificationChannel;
|
||||
}
|
||||
return getNotificationChannel(str);
|
||||
}
|
||||
|
||||
public NotificationChannelCompat getNotificationChannelCompat(String str, String str2) {
|
||||
NotificationChannel notificationChannel;
|
||||
if (Build.VERSION.SDK_INT < 26 || (notificationChannel = getNotificationChannel(str, str2)) == null) {
|
||||
return null;
|
||||
}
|
||||
return new NotificationChannelCompat(notificationChannel);
|
||||
}
|
||||
|
||||
public NotificationChannelGroup getNotificationChannelGroup(String str) {
|
||||
String id;
|
||||
NotificationChannelGroup notificationChannelGroup;
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
notificationChannelGroup = this.mNotificationManager.getNotificationChannelGroup(str);
|
||||
return notificationChannelGroup;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
Iterator<NotificationChannelGroup> it = getNotificationChannelGroups().iterator();
|
||||
while (it.hasNext()) {
|
||||
NotificationChannelGroup m = NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m((Object) it.next());
|
||||
id = m.getId();
|
||||
if (id.equals(str)) {
|
||||
return m;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public NotificationChannelGroupCompat getNotificationChannelGroupCompat(String str) {
|
||||
NotificationChannelGroup notificationChannelGroup;
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
NotificationChannelGroup notificationChannelGroup2 = getNotificationChannelGroup(str);
|
||||
if (notificationChannelGroup2 != null) {
|
||||
return new NotificationChannelGroupCompat(notificationChannelGroup2);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT < 26 || (notificationChannelGroup = getNotificationChannelGroup(str)) == null) {
|
||||
return null;
|
||||
}
|
||||
return new NotificationChannelGroupCompat(notificationChannelGroup, getNotificationChannels());
|
||||
}
|
||||
|
||||
public List<NotificationChannel> getNotificationChannels() {
|
||||
List<NotificationChannel> notificationChannels;
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
notificationChannels = this.mNotificationManager.getNotificationChannels();
|
||||
return notificationChannels;
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
public List<NotificationChannelCompat> getNotificationChannelsCompat() {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
List<NotificationChannel> notificationChannels = getNotificationChannels();
|
||||
if (!notificationChannels.isEmpty()) {
|
||||
ArrayList arrayList = new ArrayList(notificationChannels.size());
|
||||
Iterator<NotificationChannel> it = notificationChannels.iterator();
|
||||
while (it.hasNext()) {
|
||||
arrayList.add(new NotificationChannelCompat(ComponentDialog$$ExternalSyntheticApiModelOutline0.m((Object) it.next())));
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
public List<NotificationChannelGroup> getNotificationChannelGroups() {
|
||||
List<NotificationChannelGroup> notificationChannelGroups;
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
notificationChannelGroups = this.mNotificationManager.getNotificationChannelGroups();
|
||||
return notificationChannelGroups;
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
public List<NotificationChannelGroupCompat> getNotificationChannelGroupsCompat() {
|
||||
List<NotificationChannel> notificationChannels;
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
List<NotificationChannelGroup> notificationChannelGroups = getNotificationChannelGroups();
|
||||
if (!notificationChannelGroups.isEmpty()) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
notificationChannels = Collections.emptyList();
|
||||
} else {
|
||||
notificationChannels = getNotificationChannels();
|
||||
}
|
||||
ArrayList arrayList = new ArrayList(notificationChannelGroups.size());
|
||||
Iterator<NotificationChannelGroup> it = notificationChannelGroups.iterator();
|
||||
while (it.hasNext()) {
|
||||
NotificationChannelGroup m = NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m((Object) it.next());
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
arrayList.add(new NotificationChannelGroupCompat(m));
|
||||
} else {
|
||||
arrayList.add(new NotificationChannelGroupCompat(m, notificationChannels));
|
||||
}
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
public static Set<String> getEnabledListenerPackages(Context context) {
|
||||
Set<String> set;
|
||||
String string = Settings.Secure.getString(context.getContentResolver(), SETTING_ENABLED_NOTIFICATION_LISTENERS);
|
||||
synchronized (sEnabledNotificationListenersLock) {
|
||||
if (string != null) {
|
||||
if (!string.equals(sEnabledNotificationListeners)) {
|
||||
String[] split = string.split(":", -1);
|
||||
HashSet hashSet = new HashSet(split.length);
|
||||
for (String str : split) {
|
||||
ComponentName unflattenFromString = ComponentName.unflattenFromString(str);
|
||||
if (unflattenFromString != null) {
|
||||
hashSet.add(unflattenFromString.getPackageName());
|
||||
}
|
||||
}
|
||||
sEnabledNotificationListenerPackages = hashSet;
|
||||
sEnabledNotificationListeners = string;
|
||||
}
|
||||
}
|
||||
set = sEnabledNotificationListenerPackages;
|
||||
}
|
||||
return set;
|
||||
}
|
||||
|
||||
private static boolean useSideChannelForNotification(Notification notification) {
|
||||
Bundle extras = NotificationCompat.getExtras(notification);
|
||||
return extras != null && extras.getBoolean(EXTRA_USE_SIDE_CHANNEL);
|
||||
}
|
||||
|
||||
private void pushSideChannelQueue(Task task) {
|
||||
synchronized (sLock) {
|
||||
if (sSideChannelManager == null) {
|
||||
sSideChannelManager = new SideChannelManager(this.mContext.getApplicationContext());
|
||||
}
|
||||
sSideChannelManager.queueTask(task);
|
||||
}
|
||||
}
|
||||
|
||||
private static class SideChannelManager implements Handler.Callback, ServiceConnection {
|
||||
private static final int MSG_QUEUE_TASK = 0;
|
||||
private static final int MSG_RETRY_LISTENER_QUEUE = 3;
|
||||
private static final int MSG_SERVICE_CONNECTED = 1;
|
||||
private static final int MSG_SERVICE_DISCONNECTED = 2;
|
||||
private final Context mContext;
|
||||
private final Handler mHandler;
|
||||
private final HandlerThread mHandlerThread;
|
||||
private final Map<ComponentName, ListenerRecord> mRecordMap = new HashMap();
|
||||
private Set<String> mCachedEnabledPackages = new HashSet();
|
||||
|
||||
SideChannelManager(Context context) {
|
||||
this.mContext = context;
|
||||
HandlerThread handlerThread = new HandlerThread("NotificationManagerCompat");
|
||||
this.mHandlerThread = handlerThread;
|
||||
handlerThread.start();
|
||||
this.mHandler = new Handler(handlerThread.getLooper(), this);
|
||||
}
|
||||
|
||||
public void queueTask(Task task) {
|
||||
this.mHandler.obtainMessage(0, task).sendToTarget();
|
||||
}
|
||||
|
||||
@Override // android.os.Handler.Callback
|
||||
public boolean handleMessage(Message message) {
|
||||
int i = message.what;
|
||||
if (i == 0) {
|
||||
handleQueueTask((Task) message.obj);
|
||||
return true;
|
||||
}
|
||||
if (i == 1) {
|
||||
ServiceConnectedEvent serviceConnectedEvent = (ServiceConnectedEvent) message.obj;
|
||||
handleServiceConnected(serviceConnectedEvent.componentName, serviceConnectedEvent.iBinder);
|
||||
return true;
|
||||
}
|
||||
if (i == 2) {
|
||||
handleServiceDisconnected((ComponentName) message.obj);
|
||||
return true;
|
||||
}
|
||||
if (i != 3) {
|
||||
return false;
|
||||
}
|
||||
handleRetryListenerQueue((ComponentName) message.obj);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void handleQueueTask(Task task) {
|
||||
updateListenerMap();
|
||||
for (ListenerRecord listenerRecord : this.mRecordMap.values()) {
|
||||
listenerRecord.taskQueue.add(task);
|
||||
processListenerQueue(listenerRecord);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleServiceConnected(ComponentName componentName, IBinder iBinder) {
|
||||
ListenerRecord listenerRecord = this.mRecordMap.get(componentName);
|
||||
if (listenerRecord != null) {
|
||||
listenerRecord.service = INotificationSideChannel.Stub.asInterface(iBinder);
|
||||
listenerRecord.retryCount = 0;
|
||||
processListenerQueue(listenerRecord);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleServiceDisconnected(ComponentName componentName) {
|
||||
ListenerRecord listenerRecord = this.mRecordMap.get(componentName);
|
||||
if (listenerRecord != null) {
|
||||
ensureServiceUnbound(listenerRecord);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleRetryListenerQueue(ComponentName componentName) {
|
||||
ListenerRecord listenerRecord = this.mRecordMap.get(componentName);
|
||||
if (listenerRecord != null) {
|
||||
processListenerQueue(listenerRecord);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.content.ServiceConnection
|
||||
public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
|
||||
if (Log.isLoggable(NotificationManagerCompat.TAG, 3)) {
|
||||
Log.d(NotificationManagerCompat.TAG, "Connected to service " + componentName);
|
||||
}
|
||||
this.mHandler.obtainMessage(1, new ServiceConnectedEvent(componentName, iBinder)).sendToTarget();
|
||||
}
|
||||
|
||||
@Override // android.content.ServiceConnection
|
||||
public void onServiceDisconnected(ComponentName componentName) {
|
||||
if (Log.isLoggable(NotificationManagerCompat.TAG, 3)) {
|
||||
Log.d(NotificationManagerCompat.TAG, "Disconnected from service " + componentName);
|
||||
}
|
||||
this.mHandler.obtainMessage(2, componentName).sendToTarget();
|
||||
}
|
||||
|
||||
private void updateListenerMap() {
|
||||
Set<String> enabledListenerPackages = NotificationManagerCompat.getEnabledListenerPackages(this.mContext);
|
||||
if (enabledListenerPackages.equals(this.mCachedEnabledPackages)) {
|
||||
return;
|
||||
}
|
||||
this.mCachedEnabledPackages = enabledListenerPackages;
|
||||
List<ResolveInfo> queryIntentServices = this.mContext.getPackageManager().queryIntentServices(new Intent().setAction(NotificationManagerCompat.ACTION_BIND_SIDE_CHANNEL), 0);
|
||||
HashSet<ComponentName> hashSet = new HashSet();
|
||||
for (ResolveInfo resolveInfo : queryIntentServices) {
|
||||
if (enabledListenerPackages.contains(resolveInfo.serviceInfo.packageName)) {
|
||||
ComponentName componentName = new ComponentName(resolveInfo.serviceInfo.packageName, resolveInfo.serviceInfo.name);
|
||||
if (resolveInfo.serviceInfo.permission != null) {
|
||||
Log.w(NotificationManagerCompat.TAG, "Permission present on component " + componentName + ", not adding listener record.");
|
||||
} else {
|
||||
hashSet.add(componentName);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (ComponentName componentName2 : hashSet) {
|
||||
if (!this.mRecordMap.containsKey(componentName2)) {
|
||||
if (Log.isLoggable(NotificationManagerCompat.TAG, 3)) {
|
||||
Log.d(NotificationManagerCompat.TAG, "Adding listener record for " + componentName2);
|
||||
}
|
||||
this.mRecordMap.put(componentName2, new ListenerRecord(componentName2));
|
||||
}
|
||||
}
|
||||
Iterator<Map.Entry<ComponentName, ListenerRecord>> it = this.mRecordMap.entrySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Map.Entry<ComponentName, ListenerRecord> next = it.next();
|
||||
if (!hashSet.contains(next.getKey())) {
|
||||
if (Log.isLoggable(NotificationManagerCompat.TAG, 3)) {
|
||||
Log.d(NotificationManagerCompat.TAG, "Removing listener record for " + next.getKey());
|
||||
}
|
||||
ensureServiceUnbound(next.getValue());
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean ensureServiceBound(ListenerRecord listenerRecord) {
|
||||
if (listenerRecord.bound) {
|
||||
return true;
|
||||
}
|
||||
listenerRecord.bound = this.mContext.bindService(new Intent(NotificationManagerCompat.ACTION_BIND_SIDE_CHANNEL).setComponent(listenerRecord.componentName), this, 33);
|
||||
if (listenerRecord.bound) {
|
||||
listenerRecord.retryCount = 0;
|
||||
} else {
|
||||
Log.w(NotificationManagerCompat.TAG, "Unable to bind to listener " + listenerRecord.componentName);
|
||||
this.mContext.unbindService(this);
|
||||
}
|
||||
return listenerRecord.bound;
|
||||
}
|
||||
|
||||
private void ensureServiceUnbound(ListenerRecord listenerRecord) {
|
||||
if (listenerRecord.bound) {
|
||||
this.mContext.unbindService(this);
|
||||
listenerRecord.bound = false;
|
||||
}
|
||||
listenerRecord.service = null;
|
||||
}
|
||||
|
||||
private void scheduleListenerRetry(ListenerRecord listenerRecord) {
|
||||
if (this.mHandler.hasMessages(3, listenerRecord.componentName)) {
|
||||
return;
|
||||
}
|
||||
listenerRecord.retryCount++;
|
||||
if (listenerRecord.retryCount > 6) {
|
||||
Log.w(NotificationManagerCompat.TAG, "Giving up on delivering " + listenerRecord.taskQueue.size() + " tasks to " + listenerRecord.componentName + " after " + listenerRecord.retryCount + " retries");
|
||||
listenerRecord.taskQueue.clear();
|
||||
return;
|
||||
}
|
||||
int i = (1 << (listenerRecord.retryCount - 1)) * 1000;
|
||||
if (Log.isLoggable(NotificationManagerCompat.TAG, 3)) {
|
||||
Log.d(NotificationManagerCompat.TAG, "Scheduling retry for " + i + " ms");
|
||||
}
|
||||
this.mHandler.sendMessageDelayed(this.mHandler.obtainMessage(3, listenerRecord.componentName), i);
|
||||
}
|
||||
|
||||
private void processListenerQueue(ListenerRecord listenerRecord) {
|
||||
if (Log.isLoggable(NotificationManagerCompat.TAG, 3)) {
|
||||
Log.d(NotificationManagerCompat.TAG, "Processing component " + listenerRecord.componentName + ", " + listenerRecord.taskQueue.size() + " queued tasks");
|
||||
}
|
||||
if (listenerRecord.taskQueue.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (!ensureServiceBound(listenerRecord) || listenerRecord.service == null) {
|
||||
scheduleListenerRetry(listenerRecord);
|
||||
return;
|
||||
}
|
||||
while (true) {
|
||||
Task peek = listenerRecord.taskQueue.peek();
|
||||
if (peek == null) {
|
||||
break;
|
||||
}
|
||||
try {
|
||||
if (Log.isLoggable(NotificationManagerCompat.TAG, 3)) {
|
||||
Log.d(NotificationManagerCompat.TAG, "Sending task " + peek);
|
||||
}
|
||||
peek.send(listenerRecord.service);
|
||||
listenerRecord.taskQueue.remove();
|
||||
} catch (DeadObjectException unused) {
|
||||
if (Log.isLoggable(NotificationManagerCompat.TAG, 3)) {
|
||||
Log.d(NotificationManagerCompat.TAG, "Remote service has died: " + listenerRecord.componentName);
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Log.w(NotificationManagerCompat.TAG, "RemoteException communicating with " + listenerRecord.componentName, e);
|
||||
}
|
||||
}
|
||||
if (listenerRecord.taskQueue.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
scheduleListenerRetry(listenerRecord);
|
||||
}
|
||||
|
||||
private static class ListenerRecord {
|
||||
final ComponentName componentName;
|
||||
INotificationSideChannel service;
|
||||
boolean bound = false;
|
||||
ArrayDeque<Task> taskQueue = new ArrayDeque<>();
|
||||
int retryCount = 0;
|
||||
|
||||
ListenerRecord(ComponentName componentName) {
|
||||
this.componentName = componentName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class ServiceConnectedEvent {
|
||||
final ComponentName componentName;
|
||||
final IBinder iBinder;
|
||||
|
||||
ServiceConnectedEvent(ComponentName componentName, IBinder iBinder) {
|
||||
this.componentName = componentName;
|
||||
this.iBinder = iBinder;
|
||||
}
|
||||
}
|
||||
|
||||
private static class NotifyTask implements Task {
|
||||
final int id;
|
||||
final Notification notif;
|
||||
final String packageName;
|
||||
final String tag;
|
||||
|
||||
NotifyTask(String str, int i, String str2, Notification notification) {
|
||||
this.packageName = str;
|
||||
this.id = i;
|
||||
this.tag = str2;
|
||||
this.notif = notification;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.NotificationManagerCompat.Task
|
||||
public void send(INotificationSideChannel iNotificationSideChannel) throws RemoteException {
|
||||
iNotificationSideChannel.notify(this.packageName, this.id, this.tag, this.notif);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "NotifyTask[packageName:" + this.packageName + ", id:" + this.id + ", tag:" + this.tag + "]";
|
||||
}
|
||||
}
|
||||
|
||||
private static class CancelTask implements Task {
|
||||
final boolean all;
|
||||
final int id;
|
||||
final String packageName;
|
||||
final String tag;
|
||||
|
||||
CancelTask(String str) {
|
||||
this.packageName = str;
|
||||
this.id = 0;
|
||||
this.tag = null;
|
||||
this.all = true;
|
||||
}
|
||||
|
||||
CancelTask(String str, int i, String str2) {
|
||||
this.packageName = str;
|
||||
this.id = i;
|
||||
this.tag = str2;
|
||||
this.all = false;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.NotificationManagerCompat.Task
|
||||
public void send(INotificationSideChannel iNotificationSideChannel) throws RemoteException {
|
||||
if (this.all) {
|
||||
iNotificationSideChannel.cancelAll(this.packageName);
|
||||
} else {
|
||||
iNotificationSideChannel.cancel(this.packageName, this.id, this.tag);
|
||||
}
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "CancelTask[packageName:" + this.packageName + ", id:" + this.id + ", tag:" + this.tag + ", all:" + this.all + "]";
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import androidx.core.util.Consumer;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface OnMultiWindowModeChangedProvider {
|
||||
void addOnMultiWindowModeChangedListener(Consumer<MultiWindowModeChangedInfo> consumer);
|
||||
|
||||
void removeOnMultiWindowModeChangedListener(Consumer<MultiWindowModeChangedInfo> consumer);
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.content.Intent;
|
||||
import androidx.core.util.Consumer;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface OnNewIntentProvider {
|
||||
void addOnNewIntentListener(Consumer<Intent> consumer);
|
||||
|
||||
void removeOnNewIntentListener(Consumer<Intent> consumer);
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import androidx.core.util.Consumer;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface OnPictureInPictureModeChangedProvider {
|
||||
void addOnPictureInPictureModeChangedListener(Consumer<PictureInPictureModeChangedInfo> consumer);
|
||||
|
||||
void removeOnPictureInPictureModeChangedListener(Consumer<PictureInPictureModeChangedInfo> consumer);
|
||||
}
|
190
02-Easy5/E5/sources/androidx/core/app/Person.java
Normal file
190
02-Easy5/E5/sources/androidx/core/app/Person.java
Normal file
@ -0,0 +1,190 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Person;
|
||||
import android.os.Bundle;
|
||||
import android.os.PersistableBundle;
|
||||
import androidx.core.graphics.drawable.IconCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Person {
|
||||
private static final String ICON_KEY = "icon";
|
||||
private static final String IS_BOT_KEY = "isBot";
|
||||
private static final String IS_IMPORTANT_KEY = "isImportant";
|
||||
private static final String KEY_KEY = "key";
|
||||
private static final String NAME_KEY = "name";
|
||||
private static final String URI_KEY = "uri";
|
||||
IconCompat mIcon;
|
||||
boolean mIsBot;
|
||||
boolean mIsImportant;
|
||||
String mKey;
|
||||
CharSequence mName;
|
||||
String mUri;
|
||||
|
||||
public IconCompat getIcon() {
|
||||
return this.mIcon;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return this.mKey;
|
||||
}
|
||||
|
||||
public CharSequence getName() {
|
||||
return this.mName;
|
||||
}
|
||||
|
||||
public String getUri() {
|
||||
return this.mUri;
|
||||
}
|
||||
|
||||
public boolean isBot() {
|
||||
return this.mIsBot;
|
||||
}
|
||||
|
||||
public boolean isImportant() {
|
||||
return this.mIsImportant;
|
||||
}
|
||||
|
||||
public static Person fromBundle(Bundle bundle) {
|
||||
Bundle bundle2 = bundle.getBundle(ICON_KEY);
|
||||
return new Builder().setName(bundle.getCharSequence(NAME_KEY)).setIcon(bundle2 != null ? IconCompat.createFromBundle(bundle2) : null).setUri(bundle.getString(URI_KEY)).setKey(bundle.getString(KEY_KEY)).setBot(bundle.getBoolean(IS_BOT_KEY)).setImportant(bundle.getBoolean(IS_IMPORTANT_KEY)).build();
|
||||
}
|
||||
|
||||
public static Person fromPersistableBundle(PersistableBundle persistableBundle) {
|
||||
return Api22Impl.fromPersistableBundle(persistableBundle);
|
||||
}
|
||||
|
||||
public static Person fromAndroidPerson(android.app.Person person) {
|
||||
return Api28Impl.fromAndroidPerson(person);
|
||||
}
|
||||
|
||||
Person(Builder builder) {
|
||||
this.mName = builder.mName;
|
||||
this.mIcon = builder.mIcon;
|
||||
this.mUri = builder.mUri;
|
||||
this.mKey = builder.mKey;
|
||||
this.mIsBot = builder.mIsBot;
|
||||
this.mIsImportant = builder.mIsImportant;
|
||||
}
|
||||
|
||||
public Bundle toBundle() {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putCharSequence(NAME_KEY, this.mName);
|
||||
IconCompat iconCompat = this.mIcon;
|
||||
bundle.putBundle(ICON_KEY, iconCompat != null ? iconCompat.toBundle() : null);
|
||||
bundle.putString(URI_KEY, this.mUri);
|
||||
bundle.putString(KEY_KEY, this.mKey);
|
||||
bundle.putBoolean(IS_BOT_KEY, this.mIsBot);
|
||||
bundle.putBoolean(IS_IMPORTANT_KEY, this.mIsImportant);
|
||||
return bundle;
|
||||
}
|
||||
|
||||
public PersistableBundle toPersistableBundle() {
|
||||
return Api22Impl.toPersistableBundle(this);
|
||||
}
|
||||
|
||||
public Builder toBuilder() {
|
||||
return new Builder(this);
|
||||
}
|
||||
|
||||
public android.app.Person toAndroidPerson() {
|
||||
return Api28Impl.toAndroidPerson(this);
|
||||
}
|
||||
|
||||
public String resolveToLegacyUri() {
|
||||
String str = this.mUri;
|
||||
if (str != null) {
|
||||
return str;
|
||||
}
|
||||
if (this.mName == null) {
|
||||
return "";
|
||||
}
|
||||
return "name:" + ((Object) this.mName);
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
IconCompat mIcon;
|
||||
boolean mIsBot;
|
||||
boolean mIsImportant;
|
||||
String mKey;
|
||||
CharSequence mName;
|
||||
String mUri;
|
||||
|
||||
public Builder setBot(boolean z) {
|
||||
this.mIsBot = z;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setIcon(IconCompat iconCompat) {
|
||||
this.mIcon = iconCompat;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setImportant(boolean z) {
|
||||
this.mIsImportant = z;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setKey(String str) {
|
||||
this.mKey = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setName(CharSequence charSequence) {
|
||||
this.mName = charSequence;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setUri(String str) {
|
||||
this.mUri = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
Builder(Person person) {
|
||||
this.mName = person.mName;
|
||||
this.mIcon = person.mIcon;
|
||||
this.mUri = person.mUri;
|
||||
this.mKey = person.mKey;
|
||||
this.mIsBot = person.mIsBot;
|
||||
this.mIsImportant = person.mIsImportant;
|
||||
}
|
||||
|
||||
public Person build() {
|
||||
return new Person(this);
|
||||
}
|
||||
}
|
||||
|
||||
static class Api22Impl {
|
||||
private Api22Impl() {
|
||||
}
|
||||
|
||||
static Person fromPersistableBundle(PersistableBundle persistableBundle) {
|
||||
return new Builder().setName(persistableBundle.getString(Person.NAME_KEY)).setUri(persistableBundle.getString(Person.URI_KEY)).setKey(persistableBundle.getString(Person.KEY_KEY)).setBot(persistableBundle.getBoolean(Person.IS_BOT_KEY)).setImportant(persistableBundle.getBoolean(Person.IS_IMPORTANT_KEY)).build();
|
||||
}
|
||||
|
||||
static PersistableBundle toPersistableBundle(Person person) {
|
||||
PersistableBundle persistableBundle = new PersistableBundle();
|
||||
persistableBundle.putString(Person.NAME_KEY, person.mName != null ? person.mName.toString() : null);
|
||||
persistableBundle.putString(Person.URI_KEY, person.mUri);
|
||||
persistableBundle.putString(Person.KEY_KEY, person.mKey);
|
||||
persistableBundle.putBoolean(Person.IS_BOT_KEY, person.mIsBot);
|
||||
persistableBundle.putBoolean(Person.IS_IMPORTANT_KEY, person.mIsImportant);
|
||||
return persistableBundle;
|
||||
}
|
||||
}
|
||||
|
||||
static class Api28Impl {
|
||||
private Api28Impl() {
|
||||
}
|
||||
|
||||
static Person fromAndroidPerson(android.app.Person person) {
|
||||
return new Builder().setName(person.getName()).setIcon(person.getIcon() != null ? IconCompat.createFromIcon(person.getIcon()) : null).setUri(person.getUri()).setKey(person.getKey()).setBot(person.isBot()).setImportant(person.isImportant()).build();
|
||||
}
|
||||
|
||||
static android.app.Person toAndroidPerson(Person person) {
|
||||
return new Person.Builder().setName(person.getName()).setIcon(person.getIcon() != null ? person.getIcon().toIcon() : null).setUri(person.getUri()).setKey(person.getKey()).setBot(person.isBot()).setImportant(person.isImportant()).build();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.content.res.Configuration;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class PictureInPictureModeChangedInfo {
|
||||
private final boolean mIsInPictureInPictureMode;
|
||||
private final Configuration mNewConfig;
|
||||
|
||||
public boolean isInPictureInPictureMode() {
|
||||
return this.mIsInPictureInPictureMode;
|
||||
}
|
||||
|
||||
public PictureInPictureModeChangedInfo(boolean z) {
|
||||
this.mIsInPictureInPictureMode = z;
|
||||
this.mNewConfig = null;
|
||||
}
|
||||
|
||||
public PictureInPictureModeChangedInfo(boolean z, Configuration configuration) {
|
||||
this.mIsInPictureInPictureMode = z;
|
||||
this.mNewConfig = configuration;
|
||||
}
|
||||
|
||||
public Configuration getNewConfig() {
|
||||
Configuration configuration = this.mNewConfig;
|
||||
if (configuration != null) {
|
||||
return configuration;
|
||||
}
|
||||
throw new IllegalStateException("PictureInPictureModeChangedInfo must be constructed with the constructor that takes a Configuration to call getNewConfig(). Are you running on an API 26 or higher device that makes this information available?");
|
||||
}
|
||||
}
|
138
02-Easy5/E5/sources/androidx/core/app/RemoteActionCompat.java
Normal file
138
02-Easy5/E5/sources/androidx/core/app/RemoteActionCompat.java
Normal file
@ -0,0 +1,138 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.app.RemoteAction;
|
||||
import android.graphics.drawable.Icon;
|
||||
import android.os.Build;
|
||||
import androidx.core.graphics.drawable.IconCompat;
|
||||
import androidx.core.util.Preconditions;
|
||||
import androidx.versionedparcelable.VersionedParcelable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class RemoteActionCompat implements VersionedParcelable {
|
||||
public PendingIntent mActionIntent;
|
||||
public CharSequence mContentDescription;
|
||||
public boolean mEnabled;
|
||||
public IconCompat mIcon;
|
||||
public boolean mShouldShowIcon;
|
||||
public CharSequence mTitle;
|
||||
|
||||
public PendingIntent getActionIntent() {
|
||||
return this.mActionIntent;
|
||||
}
|
||||
|
||||
public CharSequence getContentDescription() {
|
||||
return this.mContentDescription;
|
||||
}
|
||||
|
||||
public IconCompat getIcon() {
|
||||
return this.mIcon;
|
||||
}
|
||||
|
||||
public CharSequence getTitle() {
|
||||
return this.mTitle;
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return this.mEnabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean z) {
|
||||
this.mEnabled = z;
|
||||
}
|
||||
|
||||
public void setShouldShowIcon(boolean z) {
|
||||
this.mShouldShowIcon = z;
|
||||
}
|
||||
|
||||
public boolean shouldShowIcon() {
|
||||
return this.mShouldShowIcon;
|
||||
}
|
||||
|
||||
public RemoteActionCompat(IconCompat iconCompat, CharSequence charSequence, CharSequence charSequence2, PendingIntent pendingIntent) {
|
||||
this.mIcon = (IconCompat) Preconditions.checkNotNull(iconCompat);
|
||||
this.mTitle = (CharSequence) Preconditions.checkNotNull(charSequence);
|
||||
this.mContentDescription = (CharSequence) Preconditions.checkNotNull(charSequence2);
|
||||
this.mActionIntent = (PendingIntent) Preconditions.checkNotNull(pendingIntent);
|
||||
this.mEnabled = true;
|
||||
this.mShouldShowIcon = true;
|
||||
}
|
||||
|
||||
public RemoteActionCompat() {
|
||||
}
|
||||
|
||||
public RemoteActionCompat(RemoteActionCompat remoteActionCompat) {
|
||||
Preconditions.checkNotNull(remoteActionCompat);
|
||||
this.mIcon = remoteActionCompat.mIcon;
|
||||
this.mTitle = remoteActionCompat.mTitle;
|
||||
this.mContentDescription = remoteActionCompat.mContentDescription;
|
||||
this.mActionIntent = remoteActionCompat.mActionIntent;
|
||||
this.mEnabled = remoteActionCompat.mEnabled;
|
||||
this.mShouldShowIcon = remoteActionCompat.mShouldShowIcon;
|
||||
}
|
||||
|
||||
public static RemoteActionCompat createFromRemoteAction(RemoteAction remoteAction) {
|
||||
Preconditions.checkNotNull(remoteAction);
|
||||
RemoteActionCompat remoteActionCompat = new RemoteActionCompat(IconCompat.createFromIcon(Api26Impl.getIcon(remoteAction)), Api26Impl.getTitle(remoteAction), Api26Impl.getContentDescription(remoteAction), Api26Impl.getActionIntent(remoteAction));
|
||||
remoteActionCompat.setEnabled(Api26Impl.isEnabled(remoteAction));
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
remoteActionCompat.setShouldShowIcon(Api28Impl.shouldShowIcon(remoteAction));
|
||||
}
|
||||
return remoteActionCompat;
|
||||
}
|
||||
|
||||
public RemoteAction toRemoteAction() {
|
||||
RemoteAction createRemoteAction = Api26Impl.createRemoteAction(this.mIcon.toIcon(), this.mTitle, this.mContentDescription, this.mActionIntent);
|
||||
Api26Impl.setEnabled(createRemoteAction, isEnabled());
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
Api28Impl.setShouldShowIcon(createRemoteAction, shouldShowIcon());
|
||||
}
|
||||
return createRemoteAction;
|
||||
}
|
||||
|
||||
static class Api28Impl {
|
||||
private Api28Impl() {
|
||||
}
|
||||
|
||||
static boolean shouldShowIcon(RemoteAction remoteAction) {
|
||||
return remoteAction.shouldShowIcon();
|
||||
}
|
||||
|
||||
static void setShouldShowIcon(RemoteAction remoteAction, boolean z) {
|
||||
remoteAction.setShouldShowIcon(z);
|
||||
}
|
||||
}
|
||||
|
||||
static class Api26Impl {
|
||||
private Api26Impl() {
|
||||
}
|
||||
|
||||
static CharSequence getContentDescription(RemoteAction remoteAction) {
|
||||
return remoteAction.getContentDescription();
|
||||
}
|
||||
|
||||
static PendingIntent getActionIntent(RemoteAction remoteAction) {
|
||||
return remoteAction.getActionIntent();
|
||||
}
|
||||
|
||||
static CharSequence getTitle(RemoteAction remoteAction) {
|
||||
return remoteAction.getTitle();
|
||||
}
|
||||
|
||||
static Icon getIcon(RemoteAction remoteAction) {
|
||||
return remoteAction.getIcon();
|
||||
}
|
||||
|
||||
static boolean isEnabled(RemoteAction remoteAction) {
|
||||
return remoteAction.isEnabled();
|
||||
}
|
||||
|
||||
static RemoteAction createRemoteAction(Icon icon, CharSequence charSequence, CharSequence charSequence2, PendingIntent pendingIntent) {
|
||||
return new RemoteAction(icon, charSequence, charSequence2, pendingIntent);
|
||||
}
|
||||
|
||||
static void setEnabled(RemoteAction remoteAction, boolean z) {
|
||||
remoteAction.setEnabled(z);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import androidx.core.graphics.drawable.IconCompat;
|
||||
import androidx.versionedparcelable.VersionedParcel;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class RemoteActionCompatParcelizer {
|
||||
public static RemoteActionCompat read(VersionedParcel versionedParcel) {
|
||||
RemoteActionCompat remoteActionCompat = new RemoteActionCompat();
|
||||
remoteActionCompat.mIcon = (IconCompat) versionedParcel.readVersionedParcelable(remoteActionCompat.mIcon, 1);
|
||||
remoteActionCompat.mTitle = versionedParcel.readCharSequence(remoteActionCompat.mTitle, 2);
|
||||
remoteActionCompat.mContentDescription = versionedParcel.readCharSequence(remoteActionCompat.mContentDescription, 3);
|
||||
remoteActionCompat.mActionIntent = (PendingIntent) versionedParcel.readParcelable(remoteActionCompat.mActionIntent, 4);
|
||||
remoteActionCompat.mEnabled = versionedParcel.readBoolean(remoteActionCompat.mEnabled, 5);
|
||||
remoteActionCompat.mShouldShowIcon = versionedParcel.readBoolean(remoteActionCompat.mShouldShowIcon, 6);
|
||||
return remoteActionCompat;
|
||||
}
|
||||
|
||||
public static void write(RemoteActionCompat remoteActionCompat, VersionedParcel versionedParcel) {
|
||||
versionedParcel.setSerializationFlags(false, false);
|
||||
versionedParcel.writeVersionedParcelable(remoteActionCompat.mIcon, 1);
|
||||
versionedParcel.writeCharSequence(remoteActionCompat.mTitle, 2);
|
||||
versionedParcel.writeCharSequence(remoteActionCompat.mContentDescription, 3);
|
||||
versionedParcel.writeParcelable(remoteActionCompat.mActionIntent, 4);
|
||||
versionedParcel.writeBoolean(remoteActionCompat.mEnabled, 5);
|
||||
versionedParcel.writeBoolean(remoteActionCompat.mShouldShowIcon, 6);
|
||||
}
|
||||
}
|
386
02-Easy5/E5/sources/androidx/core/app/RemoteInput.java
Normal file
386
02-Easy5/E5/sources/androidx/core/app/RemoteInput.java
Normal file
@ -0,0 +1,386 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.RemoteInput;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipDescription;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class RemoteInput {
|
||||
public static final int EDIT_CHOICES_BEFORE_SENDING_AUTO = 0;
|
||||
public static final int EDIT_CHOICES_BEFORE_SENDING_DISABLED = 1;
|
||||
public static final int EDIT_CHOICES_BEFORE_SENDING_ENABLED = 2;
|
||||
private static final String EXTRA_DATA_TYPE_RESULTS_DATA = "android.remoteinput.dataTypeResultsData";
|
||||
public static final String EXTRA_RESULTS_DATA = "android.remoteinput.resultsData";
|
||||
private static final String EXTRA_RESULTS_SOURCE = "android.remoteinput.resultsSource";
|
||||
public static final String RESULTS_CLIP_LABEL = "android.remoteinput.results";
|
||||
public static final int SOURCE_CHOICE = 1;
|
||||
public static final int SOURCE_FREE_FORM_INPUT = 0;
|
||||
private final boolean mAllowFreeFormTextInput;
|
||||
private final Set<String> mAllowedDataTypes;
|
||||
private final CharSequence[] mChoices;
|
||||
private final int mEditChoicesBeforeSending;
|
||||
private final Bundle mExtras;
|
||||
private final CharSequence mLabel;
|
||||
private final String mResultKey;
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface EditChoicesBeforeSending {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface Source {
|
||||
}
|
||||
|
||||
public boolean getAllowFreeFormInput() {
|
||||
return this.mAllowFreeFormTextInput;
|
||||
}
|
||||
|
||||
public Set<String> getAllowedDataTypes() {
|
||||
return this.mAllowedDataTypes;
|
||||
}
|
||||
|
||||
public CharSequence[] getChoices() {
|
||||
return this.mChoices;
|
||||
}
|
||||
|
||||
public int getEditChoicesBeforeSending() {
|
||||
return this.mEditChoicesBeforeSending;
|
||||
}
|
||||
|
||||
public Bundle getExtras() {
|
||||
return this.mExtras;
|
||||
}
|
||||
|
||||
public CharSequence getLabel() {
|
||||
return this.mLabel;
|
||||
}
|
||||
|
||||
public String getResultKey() {
|
||||
return this.mResultKey;
|
||||
}
|
||||
|
||||
RemoteInput(String str, CharSequence charSequence, CharSequence[] charSequenceArr, boolean z, int i, Bundle bundle, Set<String> set) {
|
||||
this.mResultKey = str;
|
||||
this.mLabel = charSequence;
|
||||
this.mChoices = charSequenceArr;
|
||||
this.mAllowFreeFormTextInput = z;
|
||||
this.mEditChoicesBeforeSending = i;
|
||||
this.mExtras = bundle;
|
||||
this.mAllowedDataTypes = set;
|
||||
if (getEditChoicesBeforeSending() == 2 && !getAllowFreeFormInput()) {
|
||||
throw new IllegalArgumentException("setEditChoicesBeforeSending requires setAllowFreeFormInput");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isDataOnly() {
|
||||
return (getAllowFreeFormInput() || (getChoices() != null && getChoices().length != 0) || getAllowedDataTypes() == null || getAllowedDataTypes().isEmpty()) ? false : true;
|
||||
}
|
||||
|
||||
public static final class Builder {
|
||||
private CharSequence[] mChoices;
|
||||
private CharSequence mLabel;
|
||||
private final String mResultKey;
|
||||
private final Set<String> mAllowedDataTypes = new HashSet();
|
||||
private final Bundle mExtras = new Bundle();
|
||||
private boolean mAllowFreeFormTextInput = true;
|
||||
private int mEditChoicesBeforeSending = 0;
|
||||
|
||||
public Bundle getExtras() {
|
||||
return this.mExtras;
|
||||
}
|
||||
|
||||
public Builder setAllowFreeFormInput(boolean z) {
|
||||
this.mAllowFreeFormTextInput = z;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setChoices(CharSequence[] charSequenceArr) {
|
||||
this.mChoices = charSequenceArr;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setEditChoicesBeforeSending(int i) {
|
||||
this.mEditChoicesBeforeSending = i;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setLabel(CharSequence charSequence) {
|
||||
this.mLabel = charSequence;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder(String str) {
|
||||
if (str == null) {
|
||||
throw new IllegalArgumentException("Result key can't be null");
|
||||
}
|
||||
this.mResultKey = str;
|
||||
}
|
||||
|
||||
public Builder setAllowDataType(String str, boolean z) {
|
||||
if (z) {
|
||||
this.mAllowedDataTypes.add(str);
|
||||
} else {
|
||||
this.mAllowedDataTypes.remove(str);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder addExtras(Bundle bundle) {
|
||||
if (bundle != null) {
|
||||
this.mExtras.putAll(bundle);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public RemoteInput build() {
|
||||
return new RemoteInput(this.mResultKey, this.mLabel, this.mChoices, this.mAllowFreeFormTextInput, this.mEditChoicesBeforeSending, this.mExtras, this.mAllowedDataTypes);
|
||||
}
|
||||
}
|
||||
|
||||
public static Map<String, Uri> getDataResultsFromIntent(Intent intent, String str) {
|
||||
String string;
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
return Api26Impl.getDataResultsFromIntent(intent, str);
|
||||
}
|
||||
Intent clipDataIntentFromIntent = getClipDataIntentFromIntent(intent);
|
||||
if (clipDataIntentFromIntent == null) {
|
||||
return null;
|
||||
}
|
||||
HashMap hashMap = new HashMap();
|
||||
for (String str2 : clipDataIntentFromIntent.getExtras().keySet()) {
|
||||
if (str2.startsWith(EXTRA_DATA_TYPE_RESULTS_DATA)) {
|
||||
String substring = str2.substring(39);
|
||||
if (!substring.isEmpty() && (string = clipDataIntentFromIntent.getBundleExtra(str2).getString(str)) != null && !string.isEmpty()) {
|
||||
hashMap.put(substring, Uri.parse(string));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hashMap.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return hashMap;
|
||||
}
|
||||
|
||||
public static Bundle getResultsFromIntent(Intent intent) {
|
||||
return Api20Impl.getResultsFromIntent(intent);
|
||||
}
|
||||
|
||||
public static void addResultsToIntent(RemoteInput[] remoteInputArr, Intent intent, Bundle bundle) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
Api20Impl.addResultsToIntent(fromCompat(remoteInputArr), intent, bundle);
|
||||
return;
|
||||
}
|
||||
Bundle resultsFromIntent = getResultsFromIntent(intent);
|
||||
int resultsSource = getResultsSource(intent);
|
||||
if (resultsFromIntent != null) {
|
||||
resultsFromIntent.putAll(bundle);
|
||||
bundle = resultsFromIntent;
|
||||
}
|
||||
for (RemoteInput remoteInput : remoteInputArr) {
|
||||
Map<String, Uri> dataResultsFromIntent = getDataResultsFromIntent(intent, remoteInput.getResultKey());
|
||||
Api20Impl.addResultsToIntent(fromCompat(new RemoteInput[]{remoteInput}), intent, bundle);
|
||||
if (dataResultsFromIntent != null) {
|
||||
addDataResultToIntent(remoteInput, intent, dataResultsFromIntent);
|
||||
}
|
||||
}
|
||||
setResultsSource(intent, resultsSource);
|
||||
}
|
||||
|
||||
public static void addDataResultToIntent(RemoteInput remoteInput, Intent intent, Map<String, Uri> map) {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
Api26Impl.addDataResultToIntent(remoteInput, intent, map);
|
||||
return;
|
||||
}
|
||||
Intent clipDataIntentFromIntent = getClipDataIntentFromIntent(intent);
|
||||
if (clipDataIntentFromIntent == null) {
|
||||
clipDataIntentFromIntent = new Intent();
|
||||
}
|
||||
for (Map.Entry<String, Uri> entry : map.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
Uri value = entry.getValue();
|
||||
if (key != null) {
|
||||
Bundle bundleExtra = clipDataIntentFromIntent.getBundleExtra(getExtraResultsKeyForData(key));
|
||||
if (bundleExtra == null) {
|
||||
bundleExtra = new Bundle();
|
||||
}
|
||||
bundleExtra.putString(remoteInput.getResultKey(), value.toString());
|
||||
clipDataIntentFromIntent.putExtra(getExtraResultsKeyForData(key), bundleExtra);
|
||||
}
|
||||
}
|
||||
Api16Impl.setClipData(intent, ClipData.newIntent(RESULTS_CLIP_LABEL, clipDataIntentFromIntent));
|
||||
}
|
||||
|
||||
public static void setResultsSource(Intent intent, int i) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
Api28Impl.setResultsSource(intent, i);
|
||||
return;
|
||||
}
|
||||
Intent clipDataIntentFromIntent = getClipDataIntentFromIntent(intent);
|
||||
if (clipDataIntentFromIntent == null) {
|
||||
clipDataIntentFromIntent = new Intent();
|
||||
}
|
||||
clipDataIntentFromIntent.putExtra(EXTRA_RESULTS_SOURCE, i);
|
||||
Api16Impl.setClipData(intent, ClipData.newIntent(RESULTS_CLIP_LABEL, clipDataIntentFromIntent));
|
||||
}
|
||||
|
||||
public static int getResultsSource(Intent intent) {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
return Api28Impl.getResultsSource(intent);
|
||||
}
|
||||
Intent clipDataIntentFromIntent = getClipDataIntentFromIntent(intent);
|
||||
if (clipDataIntentFromIntent == null) {
|
||||
return 0;
|
||||
}
|
||||
return clipDataIntentFromIntent.getExtras().getInt(EXTRA_RESULTS_SOURCE, 0);
|
||||
}
|
||||
|
||||
private static String getExtraResultsKeyForData(String str) {
|
||||
return EXTRA_DATA_TYPE_RESULTS_DATA + str;
|
||||
}
|
||||
|
||||
static android.app.RemoteInput[] fromCompat(RemoteInput[] remoteInputArr) {
|
||||
if (remoteInputArr == null) {
|
||||
return null;
|
||||
}
|
||||
android.app.RemoteInput[] remoteInputArr2 = new android.app.RemoteInput[remoteInputArr.length];
|
||||
for (int i = 0; i < remoteInputArr.length; i++) {
|
||||
remoteInputArr2[i] = fromCompat(remoteInputArr[i]);
|
||||
}
|
||||
return remoteInputArr2;
|
||||
}
|
||||
|
||||
static android.app.RemoteInput fromCompat(RemoteInput remoteInput) {
|
||||
return Api20Impl.fromCompat(remoteInput);
|
||||
}
|
||||
|
||||
static RemoteInput fromPlatform(android.app.RemoteInput remoteInput) {
|
||||
return Api20Impl.fromPlatform(remoteInput);
|
||||
}
|
||||
|
||||
private static Intent getClipDataIntentFromIntent(Intent intent) {
|
||||
ClipData clipData = Api16Impl.getClipData(intent);
|
||||
if (clipData == null) {
|
||||
return null;
|
||||
}
|
||||
ClipDescription description = clipData.getDescription();
|
||||
if (description.hasMimeType("text/vnd.android.intent") && description.getLabel().toString().contentEquals(RESULTS_CLIP_LABEL)) {
|
||||
return clipData.getItemAt(0).getIntent();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static class Api26Impl {
|
||||
private Api26Impl() {
|
||||
}
|
||||
|
||||
static Map<String, Uri> getDataResultsFromIntent(Intent intent, String str) {
|
||||
return android.app.RemoteInput.getDataResultsFromIntent(intent, str);
|
||||
}
|
||||
|
||||
static Set<String> getAllowedDataTypes(Object obj) {
|
||||
return ((android.app.RemoteInput) obj).getAllowedDataTypes();
|
||||
}
|
||||
|
||||
static void addDataResultToIntent(RemoteInput remoteInput, Intent intent, Map<String, Uri> map) {
|
||||
android.app.RemoteInput.addDataResultToIntent(RemoteInput.fromCompat(remoteInput), intent, map);
|
||||
}
|
||||
|
||||
static RemoteInput.Builder setAllowDataType(RemoteInput.Builder builder, String str, boolean z) {
|
||||
return builder.setAllowDataType(str, z);
|
||||
}
|
||||
}
|
||||
|
||||
static class Api20Impl {
|
||||
private Api20Impl() {
|
||||
}
|
||||
|
||||
static Bundle getResultsFromIntent(Intent intent) {
|
||||
return android.app.RemoteInput.getResultsFromIntent(intent);
|
||||
}
|
||||
|
||||
static void addResultsToIntent(Object obj, Intent intent, Bundle bundle) {
|
||||
android.app.RemoteInput.addResultsToIntent((android.app.RemoteInput[]) obj, intent, bundle);
|
||||
}
|
||||
|
||||
static RemoteInput fromPlatform(Object obj) {
|
||||
Set<String> allowedDataTypes;
|
||||
android.app.RemoteInput remoteInput = (android.app.RemoteInput) obj;
|
||||
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 = Api26Impl.getAllowedDataTypes(remoteInput)) != null) {
|
||||
Iterator<String> it = allowedDataTypes.iterator();
|
||||
while (it.hasNext()) {
|
||||
addExtras.setAllowDataType(it.next(), true);
|
||||
}
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 29) {
|
||||
addExtras.setEditChoicesBeforeSending(Api29Impl.getEditChoicesBeforeSending(remoteInput));
|
||||
}
|
||||
return addExtras.build();
|
||||
}
|
||||
|
||||
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) {
|
||||
Iterator<String> it = allowedDataTypes.iterator();
|
||||
while (it.hasNext()) {
|
||||
Api26Impl.setAllowDataType(addExtras, it.next(), true);
|
||||
}
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 29) {
|
||||
Api29Impl.setEditChoicesBeforeSending(addExtras, remoteInput.getEditChoicesBeforeSending());
|
||||
}
|
||||
return addExtras.build();
|
||||
}
|
||||
}
|
||||
|
||||
static class Api16Impl {
|
||||
private Api16Impl() {
|
||||
}
|
||||
|
||||
static ClipData getClipData(Intent intent) {
|
||||
return intent.getClipData();
|
||||
}
|
||||
|
||||
static void setClipData(Intent intent, ClipData clipData) {
|
||||
intent.setClipData(clipData);
|
||||
}
|
||||
}
|
||||
|
||||
static class Api29Impl {
|
||||
private Api29Impl() {
|
||||
}
|
||||
|
||||
static int getEditChoicesBeforeSending(Object obj) {
|
||||
return ((android.app.RemoteInput) obj).getEditChoicesBeforeSending();
|
||||
}
|
||||
|
||||
static RemoteInput.Builder setEditChoicesBeforeSending(RemoteInput.Builder builder, int i) {
|
||||
return builder.setEditChoicesBeforeSending(i);
|
||||
}
|
||||
}
|
||||
|
||||
static class Api28Impl {
|
||||
private Api28Impl() {
|
||||
}
|
||||
|
||||
static void setResultsSource(Intent intent, int i) {
|
||||
android.app.RemoteInput.setResultsSource(intent, i);
|
||||
}
|
||||
|
||||
static int getResultsSource(Intent intent) {
|
||||
return android.app.RemoteInput.getResultsSource(intent);
|
||||
}
|
||||
}
|
||||
}
|
37
02-Easy5/E5/sources/androidx/core/app/ServiceCompat.java
Normal file
37
02-Easy5/E5/sources/androidx/core/app/ServiceCompat.java
Normal file
@ -0,0 +1,37 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Service;
|
||||
import android.os.Build;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ServiceCompat {
|
||||
public static final int START_STICKY = 1;
|
||||
public static final int STOP_FOREGROUND_DETACH = 2;
|
||||
public static final int STOP_FOREGROUND_REMOVE = 1;
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface StopForegroundFlags {
|
||||
}
|
||||
|
||||
private ServiceCompat() {
|
||||
}
|
||||
|
||||
public static void stopForeground(Service service, int i) {
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
Api24Impl.stopForeground(service, i);
|
||||
} else {
|
||||
service.stopForeground((i & 1) != 0);
|
||||
}
|
||||
}
|
||||
|
||||
static class Api24Impl {
|
||||
private Api24Impl() {
|
||||
}
|
||||
|
||||
static void stopForeground(Service service, int i) {
|
||||
service.stopForeground(i);
|
||||
}
|
||||
}
|
||||
}
|
497
02-Easy5/E5/sources/androidx/core/app/ShareCompat.java
Normal file
497
02-Easy5/E5/sources/androidx/core/app/ShareCompat.java
Normal file
@ -0,0 +1,497 @@
|
||||
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;
|
||||
import android.net.Uri;
|
||||
import android.text.Html;
|
||||
import android.text.Spanned;
|
||||
import android.util.Log;
|
||||
import android.view.ActionProvider;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.ShareActionProvider;
|
||||
import androidx.core.content.IntentCompat;
|
||||
import androidx.core.util.Preconditions;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ShareCompat {
|
||||
public static final String EXTRA_CALLING_ACTIVITY = "androidx.core.app.EXTRA_CALLING_ACTIVITY";
|
||||
public static final String EXTRA_CALLING_ACTIVITY_INTEROP = "android.support.v4.app.EXTRA_CALLING_ACTIVITY";
|
||||
public static final String EXTRA_CALLING_PACKAGE = "androidx.core.app.EXTRA_CALLING_PACKAGE";
|
||||
public static final String EXTRA_CALLING_PACKAGE_INTEROP = "android.support.v4.app.EXTRA_CALLING_PACKAGE";
|
||||
private static final String HISTORY_FILENAME_PREFIX = ".sharecompat_";
|
||||
|
||||
private ShareCompat() {
|
||||
}
|
||||
|
||||
public static String getCallingPackage(Activity activity) {
|
||||
Intent intent = activity.getIntent();
|
||||
String callingPackage = activity.getCallingPackage();
|
||||
return (callingPackage != null || intent == null) ? callingPackage : getCallingPackage(intent);
|
||||
}
|
||||
|
||||
static String getCallingPackage(Intent intent) {
|
||||
String stringExtra = intent.getStringExtra(EXTRA_CALLING_PACKAGE);
|
||||
return stringExtra == null ? intent.getStringExtra(EXTRA_CALLING_PACKAGE_INTEROP) : stringExtra;
|
||||
}
|
||||
|
||||
public static ComponentName getCallingActivity(Activity activity) {
|
||||
Intent intent = activity.getIntent();
|
||||
ComponentName callingActivity = activity.getCallingActivity();
|
||||
return callingActivity == null ? getCallingActivity(intent) : callingActivity;
|
||||
}
|
||||
|
||||
static ComponentName getCallingActivity(Intent intent) {
|
||||
ComponentName componentName = (ComponentName) intent.getParcelableExtra(EXTRA_CALLING_ACTIVITY);
|
||||
return componentName == null ? (ComponentName) intent.getParcelableExtra(EXTRA_CALLING_ACTIVITY_INTEROP) : componentName;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void configureMenuItem(MenuItem menuItem, IntentBuilder intentBuilder) {
|
||||
ShareActionProvider shareActionProvider;
|
||||
ActionProvider actionProvider = menuItem.getActionProvider();
|
||||
if (!(actionProvider instanceof ShareActionProvider)) {
|
||||
shareActionProvider = new ShareActionProvider(intentBuilder.getContext());
|
||||
} else {
|
||||
shareActionProvider = (ShareActionProvider) actionProvider;
|
||||
}
|
||||
shareActionProvider.setShareHistoryFileName(HISTORY_FILENAME_PREFIX + intentBuilder.getContext().getClass().getName());
|
||||
shareActionProvider.setShareIntent(intentBuilder.getIntent());
|
||||
menuItem.setActionProvider(shareActionProvider);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void configureMenuItem(Menu menu, int i, IntentBuilder intentBuilder) {
|
||||
MenuItem findItem = menu.findItem(i);
|
||||
if (findItem == null) {
|
||||
throw new IllegalArgumentException("Could not find menu item with id " + i + " in the supplied menu");
|
||||
}
|
||||
configureMenuItem(findItem, intentBuilder);
|
||||
}
|
||||
|
||||
public static class IntentBuilder {
|
||||
private ArrayList<String> mBccAddresses;
|
||||
private ArrayList<String> mCcAddresses;
|
||||
private CharSequence mChooserTitle;
|
||||
private final Context mContext;
|
||||
private final Intent mIntent;
|
||||
private ArrayList<Uri> mStreams;
|
||||
private ArrayList<String> mToAddresses;
|
||||
|
||||
Context getContext() {
|
||||
return this.mContext;
|
||||
}
|
||||
|
||||
public IntentBuilder setChooserTitle(CharSequence charSequence) {
|
||||
this.mChooserTitle = charSequence;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static IntentBuilder from(Activity activity) {
|
||||
return new IntentBuilder(activity);
|
||||
}
|
||||
|
||||
public IntentBuilder(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.addFlags(524288);
|
||||
while (true) {
|
||||
if (!(context instanceof ContextWrapper)) {
|
||||
activity = null;
|
||||
break;
|
||||
} else {
|
||||
if (context instanceof Activity) {
|
||||
activity = (Activity) context;
|
||||
break;
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
public Intent getIntent() {
|
||||
ArrayList<String> arrayList = this.mToAddresses;
|
||||
if (arrayList != null) {
|
||||
combineArrayExtra("android.intent.extra.EMAIL", arrayList);
|
||||
this.mToAddresses = null;
|
||||
}
|
||||
ArrayList<String> arrayList2 = this.mCcAddresses;
|
||||
if (arrayList2 != null) {
|
||||
combineArrayExtra("android.intent.extra.CC", arrayList2);
|
||||
this.mCcAddresses = null;
|
||||
}
|
||||
ArrayList<String> arrayList3 = this.mBccAddresses;
|
||||
if (arrayList3 != null) {
|
||||
combineArrayExtra("android.intent.extra.BCC", arrayList3);
|
||||
this.mBccAddresses = null;
|
||||
}
|
||||
ArrayList<Uri> arrayList4 = this.mStreams;
|
||||
if (arrayList4 == null || arrayList4.size() <= 1) {
|
||||
this.mIntent.setAction("android.intent.action.SEND");
|
||||
ArrayList<Uri> arrayList5 = this.mStreams;
|
||||
if (arrayList5 != null && !arrayList5.isEmpty()) {
|
||||
this.mIntent.putExtra("android.intent.extra.STREAM", this.mStreams.get(0));
|
||||
Api16Impl.migrateExtraStreamToClipData(this.mIntent, this.mStreams);
|
||||
} else {
|
||||
this.mIntent.removeExtra("android.intent.extra.STREAM");
|
||||
Api16Impl.removeClipData(this.mIntent);
|
||||
}
|
||||
} else {
|
||||
this.mIntent.setAction("android.intent.action.SEND_MULTIPLE");
|
||||
this.mIntent.putParcelableArrayListExtra("android.intent.extra.STREAM", this.mStreams);
|
||||
Api16Impl.migrateExtraStreamToClipData(this.mIntent, this.mStreams);
|
||||
}
|
||||
return this.mIntent;
|
||||
}
|
||||
|
||||
private void combineArrayExtra(String str, ArrayList<String> arrayList) {
|
||||
String[] stringArrayExtra = this.mIntent.getStringArrayExtra(str);
|
||||
int length = stringArrayExtra != null ? stringArrayExtra.length : 0;
|
||||
String[] strArr = new String[arrayList.size() + length];
|
||||
arrayList.toArray(strArr);
|
||||
if (stringArrayExtra != null) {
|
||||
System.arraycopy(stringArrayExtra, 0, strArr, arrayList.size(), length);
|
||||
}
|
||||
this.mIntent.putExtra(str, strArr);
|
||||
}
|
||||
|
||||
private void combineArrayExtra(String str, String[] strArr) {
|
||||
Intent intent = getIntent();
|
||||
String[] stringArrayExtra = intent.getStringArrayExtra(str);
|
||||
int length = stringArrayExtra != null ? stringArrayExtra.length : 0;
|
||||
String[] strArr2 = new String[strArr.length + length];
|
||||
if (stringArrayExtra != null) {
|
||||
System.arraycopy(stringArrayExtra, 0, strArr2, 0, length);
|
||||
}
|
||||
System.arraycopy(strArr, 0, strArr2, length, strArr.length);
|
||||
intent.putExtra(str, strArr2);
|
||||
}
|
||||
|
||||
public Intent createChooserIntent() {
|
||||
return Intent.createChooser(getIntent(), this.mChooserTitle);
|
||||
}
|
||||
|
||||
public void startChooser() {
|
||||
this.mContext.startActivity(createChooserIntent());
|
||||
}
|
||||
|
||||
public IntentBuilder setChooserTitle(int i) {
|
||||
return setChooserTitle(this.mContext.getText(i));
|
||||
}
|
||||
|
||||
public IntentBuilder setType(String str) {
|
||||
this.mIntent.setType(str);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IntentBuilder setText(CharSequence charSequence) {
|
||||
this.mIntent.putExtra("android.intent.extra.TEXT", charSequence);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IntentBuilder setHtmlText(String str) {
|
||||
this.mIntent.putExtra(IntentCompat.EXTRA_HTML_TEXT, str);
|
||||
if (!this.mIntent.hasExtra("android.intent.extra.TEXT")) {
|
||||
setText(Html.fromHtml(str));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public IntentBuilder setStream(Uri uri) {
|
||||
this.mStreams = null;
|
||||
if (uri != null) {
|
||||
addStream(uri);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public IntentBuilder addStream(Uri uri) {
|
||||
if (this.mStreams == null) {
|
||||
this.mStreams = new ArrayList<>();
|
||||
}
|
||||
this.mStreams.add(uri);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IntentBuilder setEmailTo(String[] strArr) {
|
||||
if (this.mToAddresses != null) {
|
||||
this.mToAddresses = null;
|
||||
}
|
||||
this.mIntent.putExtra("android.intent.extra.EMAIL", strArr);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IntentBuilder addEmailTo(String str) {
|
||||
if (this.mToAddresses == null) {
|
||||
this.mToAddresses = new ArrayList<>();
|
||||
}
|
||||
this.mToAddresses.add(str);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IntentBuilder addEmailTo(String[] strArr) {
|
||||
combineArrayExtra("android.intent.extra.EMAIL", strArr);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IntentBuilder setEmailCc(String[] strArr) {
|
||||
this.mIntent.putExtra("android.intent.extra.CC", strArr);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IntentBuilder addEmailCc(String str) {
|
||||
if (this.mCcAddresses == null) {
|
||||
this.mCcAddresses = new ArrayList<>();
|
||||
}
|
||||
this.mCcAddresses.add(str);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IntentBuilder addEmailCc(String[] strArr) {
|
||||
combineArrayExtra("android.intent.extra.CC", strArr);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IntentBuilder setEmailBcc(String[] strArr) {
|
||||
this.mIntent.putExtra("android.intent.extra.BCC", strArr);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IntentBuilder addEmailBcc(String str) {
|
||||
if (this.mBccAddresses == null) {
|
||||
this.mBccAddresses = new ArrayList<>();
|
||||
}
|
||||
this.mBccAddresses.add(str);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IntentBuilder addEmailBcc(String[] strArr) {
|
||||
combineArrayExtra("android.intent.extra.BCC", strArr);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IntentBuilder setSubject(String str) {
|
||||
this.mIntent.putExtra("android.intent.extra.SUBJECT", str);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class IntentReader {
|
||||
private static final String TAG = "IntentReader";
|
||||
private final ComponentName mCallingActivity;
|
||||
private final String mCallingPackage;
|
||||
private final Context mContext;
|
||||
private final Intent mIntent;
|
||||
private ArrayList<Uri> mStreams;
|
||||
|
||||
public ComponentName getCallingActivity() {
|
||||
return this.mCallingActivity;
|
||||
}
|
||||
|
||||
public String getCallingPackage() {
|
||||
return this.mCallingPackage;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static IntentReader from(Activity activity) {
|
||||
return new IntentReader(activity);
|
||||
}
|
||||
|
||||
public IntentReader(Activity activity) {
|
||||
this((Context) Preconditions.checkNotNull(activity), activity.getIntent());
|
||||
}
|
||||
|
||||
public IntentReader(Context context, Intent intent) {
|
||||
this.mContext = (Context) Preconditions.checkNotNull(context);
|
||||
this.mIntent = (Intent) Preconditions.checkNotNull(intent);
|
||||
this.mCallingPackage = ShareCompat.getCallingPackage(intent);
|
||||
this.mCallingActivity = ShareCompat.getCallingActivity(intent);
|
||||
}
|
||||
|
||||
public boolean isShareIntent() {
|
||||
String action = this.mIntent.getAction();
|
||||
return "android.intent.action.SEND".equals(action) || "android.intent.action.SEND_MULTIPLE".equals(action);
|
||||
}
|
||||
|
||||
public boolean isSingleShare() {
|
||||
return "android.intent.action.SEND".equals(this.mIntent.getAction());
|
||||
}
|
||||
|
||||
public boolean isMultipleShare() {
|
||||
return "android.intent.action.SEND_MULTIPLE".equals(this.mIntent.getAction());
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return this.mIntent.getType();
|
||||
}
|
||||
|
||||
public CharSequence getText() {
|
||||
return this.mIntent.getCharSequenceExtra("android.intent.extra.TEXT");
|
||||
}
|
||||
|
||||
public String getHtmlText() {
|
||||
String stringExtra = this.mIntent.getStringExtra(IntentCompat.EXTRA_HTML_TEXT);
|
||||
if (stringExtra != null) {
|
||||
return stringExtra;
|
||||
}
|
||||
CharSequence text = getText();
|
||||
if (text instanceof Spanned) {
|
||||
return Html.toHtml((Spanned) text);
|
||||
}
|
||||
return text != null ? Api16Impl.escapeHtml(text) : stringExtra;
|
||||
}
|
||||
|
||||
private static void withinStyle(StringBuilder sb, CharSequence charSequence, int i, int i2) {
|
||||
while (i < i2) {
|
||||
char charAt = charSequence.charAt(i);
|
||||
if (charAt == '<') {
|
||||
sb.append("<");
|
||||
} else if (charAt == '>') {
|
||||
sb.append(">");
|
||||
} else if (charAt == '&') {
|
||||
sb.append("&");
|
||||
} else if (charAt > '~' || charAt < ' ') {
|
||||
sb.append("&#");
|
||||
sb.append((int) charAt);
|
||||
sb.append(";");
|
||||
} else if (charAt == ' ') {
|
||||
while (true) {
|
||||
int i3 = i + 1;
|
||||
if (i3 >= i2 || charSequence.charAt(i3) != ' ') {
|
||||
break;
|
||||
}
|
||||
sb.append(" ");
|
||||
i = i3;
|
||||
}
|
||||
sb.append(' ');
|
||||
} else {
|
||||
sb.append(charAt);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public Uri getStream() {
|
||||
return (Uri) this.mIntent.getParcelableExtra("android.intent.extra.STREAM");
|
||||
}
|
||||
|
||||
public Uri getStream(int i) {
|
||||
if (this.mStreams == null && isMultipleShare()) {
|
||||
this.mStreams = this.mIntent.getParcelableArrayListExtra("android.intent.extra.STREAM");
|
||||
}
|
||||
ArrayList<Uri> arrayList = this.mStreams;
|
||||
if (arrayList != null) {
|
||||
return arrayList.get(i);
|
||||
}
|
||||
if (i == 0) {
|
||||
return (Uri) this.mIntent.getParcelableExtra("android.intent.extra.STREAM");
|
||||
}
|
||||
throw new IndexOutOfBoundsException("Stream items available: " + getStreamCount() + " index requested: " + i);
|
||||
}
|
||||
|
||||
public int getStreamCount() {
|
||||
if (this.mStreams == null && isMultipleShare()) {
|
||||
this.mStreams = this.mIntent.getParcelableArrayListExtra("android.intent.extra.STREAM");
|
||||
}
|
||||
ArrayList<Uri> arrayList = this.mStreams;
|
||||
if (arrayList != null) {
|
||||
return arrayList.size();
|
||||
}
|
||||
return this.mIntent.hasExtra("android.intent.extra.STREAM") ? 1 : 0;
|
||||
}
|
||||
|
||||
public String[] getEmailTo() {
|
||||
return this.mIntent.getStringArrayExtra("android.intent.extra.EMAIL");
|
||||
}
|
||||
|
||||
public String[] getEmailCc() {
|
||||
return this.mIntent.getStringArrayExtra("android.intent.extra.CC");
|
||||
}
|
||||
|
||||
public String[] getEmailBcc() {
|
||||
return this.mIntent.getStringArrayExtra("android.intent.extra.BCC");
|
||||
}
|
||||
|
||||
public String getSubject() {
|
||||
return this.mIntent.getStringExtra("android.intent.extra.SUBJECT");
|
||||
}
|
||||
|
||||
public Drawable getCallingActivityIcon() {
|
||||
if (this.mCallingActivity == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return this.mContext.getPackageManager().getActivityIcon(this.mCallingActivity);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
Log.e(TAG, "Could not retrieve icon for calling activity", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Drawable getCallingApplicationIcon() {
|
||||
if (this.mCallingPackage == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return this.mContext.getPackageManager().getApplicationIcon(this.mCallingPackage);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
Log.e(TAG, "Could not retrieve icon for calling application", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public CharSequence getCallingApplicationLabel() {
|
||||
if (this.mCallingPackage == null) {
|
||||
return null;
|
||||
}
|
||||
PackageManager packageManager = this.mContext.getPackageManager();
|
||||
try {
|
||||
return packageManager.getApplicationLabel(packageManager.getApplicationInfo(this.mCallingPackage, 0));
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
Log.e(TAG, "Could not retrieve label for calling application", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class Api16Impl {
|
||||
private Api16Impl() {
|
||||
}
|
||||
|
||||
static void migrateExtraStreamToClipData(Intent intent, 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);
|
||||
}
|
||||
|
||||
static void removeClipData(Intent intent) {
|
||||
intent.setClipData(null);
|
||||
intent.setFlags(intent.getFlags() & (-2));
|
||||
}
|
||||
|
||||
static String escapeHtml(CharSequence charSequence) {
|
||||
return Html.escapeHtml(charSequence);
|
||||
}
|
||||
}
|
||||
}
|
136
02-Easy5/E5/sources/androidx/core/app/SharedElementCallback.java
Normal file
136
02-Easy5/E5/sources/androidx/core/app/SharedElementCallback.java
Normal file
@ -0,0 +1,136 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.RectF;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class SharedElementCallback {
|
||||
private static final String BUNDLE_SNAPSHOT_BITMAP = "sharedElement:snapshot:bitmap";
|
||||
private static final String BUNDLE_SNAPSHOT_IMAGE_MATRIX = "sharedElement:snapshot:imageMatrix";
|
||||
private static final String BUNDLE_SNAPSHOT_IMAGE_SCALETYPE = "sharedElement:snapshot:imageScaleType";
|
||||
private static final int MAX_IMAGE_SIZE = 1048576;
|
||||
private Matrix mTempMatrix;
|
||||
|
||||
public interface OnSharedElementsReadyListener {
|
||||
void onSharedElementsReady();
|
||||
}
|
||||
|
||||
public void onMapSharedElements(List<String> list, Map<String, View> map) {
|
||||
}
|
||||
|
||||
public void onRejectSharedElements(List<View> list) {
|
||||
}
|
||||
|
||||
public void onSharedElementEnd(List<String> list, List<View> list2, List<View> list3) {
|
||||
}
|
||||
|
||||
public void onSharedElementStart(List<String> list, List<View> list2, List<View> list3) {
|
||||
}
|
||||
|
||||
public Parcelable onCaptureSharedElementSnapshot(View view, Matrix matrix, RectF rectF) {
|
||||
Bitmap createDrawableBitmap;
|
||||
if (view instanceof ImageView) {
|
||||
ImageView imageView = (ImageView) view;
|
||||
Drawable drawable = imageView.getDrawable();
|
||||
Drawable background = imageView.getBackground();
|
||||
if (drawable != null && background == null && (createDrawableBitmap = createDrawableBitmap(drawable)) != null) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putParcelable(BUNDLE_SNAPSHOT_BITMAP, createDrawableBitmap);
|
||||
bundle.putString(BUNDLE_SNAPSHOT_IMAGE_SCALETYPE, imageView.getScaleType().toString());
|
||||
if (imageView.getScaleType() == ImageView.ScaleType.MATRIX) {
|
||||
float[] fArr = new float[9];
|
||||
imageView.getImageMatrix().getValues(fArr);
|
||||
bundle.putFloatArray(BUNDLE_SNAPSHOT_IMAGE_MATRIX, fArr);
|
||||
}
|
||||
return bundle;
|
||||
}
|
||||
}
|
||||
int round = Math.round(rectF.width());
|
||||
int round2 = Math.round(rectF.height());
|
||||
if (round <= 0 || round2 <= 0) {
|
||||
return null;
|
||||
}
|
||||
float min = Math.min(1.0f, 1048576.0f / (round * round2));
|
||||
int i = (int) (round * min);
|
||||
int i2 = (int) (round2 * min);
|
||||
if (this.mTempMatrix == null) {
|
||||
this.mTempMatrix = new Matrix();
|
||||
}
|
||||
this.mTempMatrix.set(matrix);
|
||||
this.mTempMatrix.postTranslate(-rectF.left, -rectF.top);
|
||||
this.mTempMatrix.postScale(min, min);
|
||||
Bitmap createBitmap = Bitmap.createBitmap(i, i2, Bitmap.Config.ARGB_8888);
|
||||
Canvas canvas = new Canvas(createBitmap);
|
||||
canvas.concat(this.mTempMatrix);
|
||||
view.draw(canvas);
|
||||
return createBitmap;
|
||||
}
|
||||
|
||||
private static Bitmap createDrawableBitmap(Drawable drawable) {
|
||||
int intrinsicWidth = drawable.getIntrinsicWidth();
|
||||
int intrinsicHeight = drawable.getIntrinsicHeight();
|
||||
if (intrinsicWidth <= 0 || intrinsicHeight <= 0) {
|
||||
return null;
|
||||
}
|
||||
float min = Math.min(1.0f, 1048576.0f / (intrinsicWidth * intrinsicHeight));
|
||||
if ((drawable instanceof BitmapDrawable) && min == 1.0f) {
|
||||
return ((BitmapDrawable) drawable).getBitmap();
|
||||
}
|
||||
int i = (int) (intrinsicWidth * min);
|
||||
int i2 = (int) (intrinsicHeight * min);
|
||||
Bitmap createBitmap = Bitmap.createBitmap(i, i2, Bitmap.Config.ARGB_8888);
|
||||
Canvas canvas = new Canvas(createBitmap);
|
||||
Rect bounds = drawable.getBounds();
|
||||
int i3 = bounds.left;
|
||||
int i4 = bounds.top;
|
||||
int i5 = bounds.right;
|
||||
int i6 = bounds.bottom;
|
||||
drawable.setBounds(0, 0, i, i2);
|
||||
drawable.draw(canvas);
|
||||
drawable.setBounds(i3, i4, i5, i6);
|
||||
return createBitmap;
|
||||
}
|
||||
|
||||
public View onCreateSnapshotView(Context context, Parcelable parcelable) {
|
||||
if (parcelable instanceof Bundle) {
|
||||
Bundle bundle = (Bundle) parcelable;
|
||||
Bitmap bitmap = (Bitmap) bundle.getParcelable(BUNDLE_SNAPSHOT_BITMAP);
|
||||
if (bitmap == null) {
|
||||
return null;
|
||||
}
|
||||
ImageView imageView = new ImageView(context);
|
||||
imageView.setImageBitmap(bitmap);
|
||||
imageView.setScaleType(ImageView.ScaleType.valueOf(bundle.getString(BUNDLE_SNAPSHOT_IMAGE_SCALETYPE)));
|
||||
if (imageView.getScaleType() != ImageView.ScaleType.MATRIX) {
|
||||
return imageView;
|
||||
}
|
||||
float[] floatArray = bundle.getFloatArray(BUNDLE_SNAPSHOT_IMAGE_MATRIX);
|
||||
Matrix matrix = new Matrix();
|
||||
matrix.setValues(floatArray);
|
||||
imageView.setImageMatrix(matrix);
|
||||
return imageView;
|
||||
}
|
||||
if (!(parcelable instanceof Bitmap)) {
|
||||
return null;
|
||||
}
|
||||
ImageView imageView2 = new ImageView(context);
|
||||
imageView2.setImageBitmap((Bitmap) parcelable);
|
||||
return imageView2;
|
||||
}
|
||||
|
||||
public void onSharedElementsArrived(List<String> list, List<View> list2, OnSharedElementsReadyListener onSharedElementsReadyListener) {
|
||||
onSharedElementsReadyListener.onSharedElementsReady();
|
||||
}
|
||||
}
|
162
02-Easy5/E5/sources/androidx/core/app/TaskStackBuilder.java
Normal file
162
02-Easy5/E5/sources/androidx/core/app/TaskStackBuilder.java
Normal file
@ -0,0 +1,162 @@
|
||||
package androidx.core.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class TaskStackBuilder implements Iterable<Intent> {
|
||||
private static final String TAG = "TaskStackBuilder";
|
||||
private final ArrayList<Intent> mIntents = new ArrayList<>();
|
||||
private final Context mSourceContext;
|
||||
|
||||
public interface SupportParentable {
|
||||
Intent getSupportParentActivityIntent();
|
||||
}
|
||||
|
||||
private TaskStackBuilder(Context context) {
|
||||
this.mSourceContext = context;
|
||||
}
|
||||
|
||||
public static TaskStackBuilder create(Context context) {
|
||||
return new TaskStackBuilder(context);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static TaskStackBuilder from(Context context) {
|
||||
return create(context);
|
||||
}
|
||||
|
||||
public TaskStackBuilder addNextIntent(Intent intent) {
|
||||
this.mIntents.add(intent);
|
||||
return this;
|
||||
}
|
||||
|
||||
public TaskStackBuilder addNextIntentWithParentStack(Intent intent) {
|
||||
ComponentName component = intent.getComponent();
|
||||
if (component == null) {
|
||||
component = intent.resolveActivity(this.mSourceContext.getPackageManager());
|
||||
}
|
||||
if (component != null) {
|
||||
addParentStack(component);
|
||||
}
|
||||
addNextIntent(intent);
|
||||
return this;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public TaskStackBuilder addParentStack(Activity activity) {
|
||||
Intent supportParentActivityIntent = activity instanceof SupportParentable ? ((SupportParentable) activity).getSupportParentActivityIntent() : null;
|
||||
if (supportParentActivityIntent == null) {
|
||||
supportParentActivityIntent = NavUtils.getParentActivityIntent(activity);
|
||||
}
|
||||
if (supportParentActivityIntent != null) {
|
||||
ComponentName component = supportParentActivityIntent.getComponent();
|
||||
if (component == null) {
|
||||
component = supportParentActivityIntent.resolveActivity(this.mSourceContext.getPackageManager());
|
||||
}
|
||||
addParentStack(component);
|
||||
addNextIntent(supportParentActivityIntent);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public TaskStackBuilder addParentStack(Class<?> cls) {
|
||||
return addParentStack(new ComponentName(this.mSourceContext, cls));
|
||||
}
|
||||
|
||||
public TaskStackBuilder addParentStack(ComponentName componentName) {
|
||||
int size = this.mIntents.size();
|
||||
try {
|
||||
Intent parentActivityIntent = NavUtils.getParentActivityIntent(this.mSourceContext, componentName);
|
||||
while (parentActivityIntent != null) {
|
||||
this.mIntents.add(size, parentActivityIntent);
|
||||
parentActivityIntent = NavUtils.getParentActivityIntent(this.mSourceContext, parentActivityIntent.getComponent());
|
||||
}
|
||||
return this;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
Log.e(TAG, "Bad ComponentName while traversing activity parent metadata");
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public int getIntentCount() {
|
||||
return this.mIntents.size();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public Intent getIntent(int i) {
|
||||
return editIntentAt(i);
|
||||
}
|
||||
|
||||
public Intent editIntentAt(int i) {
|
||||
return this.mIntents.get(i);
|
||||
}
|
||||
|
||||
@Override // java.lang.Iterable
|
||||
@Deprecated
|
||||
public Iterator<Intent> iterator() {
|
||||
return this.mIntents.iterator();
|
||||
}
|
||||
|
||||
public void startActivities() {
|
||||
startActivities(null);
|
||||
}
|
||||
|
||||
public void startActivities(Bundle bundle) {
|
||||
if (this.mIntents.isEmpty()) {
|
||||
throw new IllegalStateException("No intents added to TaskStackBuilder; cannot startActivities");
|
||||
}
|
||||
Intent[] intentArr = (Intent[]) this.mIntents.toArray(new Intent[0]);
|
||||
intentArr[0] = new Intent(intentArr[0]).addFlags(268484608);
|
||||
if (ContextCompat.startActivities(this.mSourceContext, intentArr, bundle)) {
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent(intentArr[intentArr.length - 1]);
|
||||
intent.addFlags(268435456);
|
||||
this.mSourceContext.startActivity(intent);
|
||||
}
|
||||
|
||||
public PendingIntent getPendingIntent(int i, int i2) {
|
||||
return getPendingIntent(i, i2, null);
|
||||
}
|
||||
|
||||
public PendingIntent getPendingIntent(int i, int i2, Bundle bundle) {
|
||||
if (this.mIntents.isEmpty()) {
|
||||
throw new IllegalStateException("No intents added to TaskStackBuilder; cannot getPendingIntent");
|
||||
}
|
||||
Intent[] intentArr = (Intent[]) this.mIntents.toArray(new Intent[0]);
|
||||
intentArr[0] = new Intent(intentArr[0]).addFlags(268484608);
|
||||
return Api16Impl.getActivities(this.mSourceContext, i, intentArr, i2, bundle);
|
||||
}
|
||||
|
||||
public Intent[] getIntents() {
|
||||
int size = this.mIntents.size();
|
||||
Intent[] intentArr = new Intent[size];
|
||||
if (size == 0) {
|
||||
return intentArr;
|
||||
}
|
||||
intentArr[0] = new Intent(this.mIntents.get(0)).addFlags(268484608);
|
||||
for (int i = 1; i < size; i++) {
|
||||
intentArr[i] = new Intent(this.mIntents.get(i));
|
||||
}
|
||||
return intentArr;
|
||||
}
|
||||
|
||||
static class Api16Impl {
|
||||
private Api16Impl() {
|
||||
}
|
||||
|
||||
static PendingIntent getActivities(Context context, int i, Intent[] intentArr, int i2, Bundle bundle) {
|
||||
return PendingIntent.getActivities(context, i, intentArr, i2, bundle);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package androidx.core.app.unusedapprestrictions;
|
||||
|
||||
import android.os.Binder;
|
||||
import android.os.IBinder;
|
||||
import android.os.IInterface;
|
||||
import android.os.Parcel;
|
||||
import android.os.RemoteException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IUnusedAppRestrictionsBackportCallback extends IInterface {
|
||||
public static final String DESCRIPTOR = "androidx.core.app.unusedapprestrictions.IUnusedAppRestrictionsBackportCallback";
|
||||
|
||||
public static class Default implements IUnusedAppRestrictionsBackportCallback {
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.unusedapprestrictions.IUnusedAppRestrictionsBackportCallback
|
||||
public void onIsPermissionRevocationEnabledForAppResult(boolean z, boolean z2) throws RemoteException {
|
||||
}
|
||||
}
|
||||
|
||||
void onIsPermissionRevocationEnabledForAppResult(boolean z, boolean z2) throws RemoteException;
|
||||
|
||||
public static abstract class Stub extends Binder implements IUnusedAppRestrictionsBackportCallback {
|
||||
static final int TRANSACTION_onIsPermissionRevocationEnabledForAppResult = 1;
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Stub() {
|
||||
attachInterface(this, IUnusedAppRestrictionsBackportCallback.DESCRIPTOR);
|
||||
}
|
||||
|
||||
public static IUnusedAppRestrictionsBackportCallback asInterface(IBinder iBinder) {
|
||||
if (iBinder == null) {
|
||||
return null;
|
||||
}
|
||||
IInterface queryLocalInterface = iBinder.queryLocalInterface(IUnusedAppRestrictionsBackportCallback.DESCRIPTOR);
|
||||
if (queryLocalInterface != null && (queryLocalInterface instanceof IUnusedAppRestrictionsBackportCallback)) {
|
||||
return (IUnusedAppRestrictionsBackportCallback) queryLocalInterface;
|
||||
}
|
||||
return new Proxy(iBinder);
|
||||
}
|
||||
|
||||
@Override // android.os.Binder
|
||||
public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException {
|
||||
if (i >= 1 && i <= 16777215) {
|
||||
parcel.enforceInterface(IUnusedAppRestrictionsBackportCallback.DESCRIPTOR);
|
||||
}
|
||||
if (i == 1598968902) {
|
||||
parcel2.writeString(IUnusedAppRestrictionsBackportCallback.DESCRIPTOR);
|
||||
return true;
|
||||
}
|
||||
if (i == 1) {
|
||||
onIsPermissionRevocationEnabledForAppResult(parcel.readInt() != 0, parcel.readInt() != 0);
|
||||
return true;
|
||||
}
|
||||
return super.onTransact(i, parcel, parcel2, i2);
|
||||
}
|
||||
|
||||
private static class Proxy implements IUnusedAppRestrictionsBackportCallback {
|
||||
private IBinder mRemote;
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this.mRemote;
|
||||
}
|
||||
|
||||
public String getInterfaceDescriptor() {
|
||||
return IUnusedAppRestrictionsBackportCallback.DESCRIPTOR;
|
||||
}
|
||||
|
||||
Proxy(IBinder iBinder) {
|
||||
this.mRemote = iBinder;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.unusedapprestrictions.IUnusedAppRestrictionsBackportCallback
|
||||
public void onIsPermissionRevocationEnabledForAppResult(boolean z, boolean z2) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken(IUnusedAppRestrictionsBackportCallback.DESCRIPTOR);
|
||||
obtain.writeInt(z ? 1 : 0);
|
||||
obtain.writeInt(z2 ? 1 : 0);
|
||||
this.mRemote.transact(1, obtain, null, 1);
|
||||
} finally {
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package androidx.core.app.unusedapprestrictions;
|
||||
|
||||
import android.os.Binder;
|
||||
import android.os.IBinder;
|
||||
import android.os.IInterface;
|
||||
import android.os.Parcel;
|
||||
import android.os.RemoteException;
|
||||
import androidx.core.app.unusedapprestrictions.IUnusedAppRestrictionsBackportCallback;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IUnusedAppRestrictionsBackportService extends IInterface {
|
||||
public static final String DESCRIPTOR = "androidx.core.app.unusedapprestrictions.IUnusedAppRestrictionsBackportService";
|
||||
|
||||
public static class Default implements IUnusedAppRestrictionsBackportService {
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.unusedapprestrictions.IUnusedAppRestrictionsBackportService
|
||||
public void isPermissionRevocationEnabledForApp(IUnusedAppRestrictionsBackportCallback iUnusedAppRestrictionsBackportCallback) throws RemoteException {
|
||||
}
|
||||
}
|
||||
|
||||
void isPermissionRevocationEnabledForApp(IUnusedAppRestrictionsBackportCallback iUnusedAppRestrictionsBackportCallback) throws RemoteException;
|
||||
|
||||
public static abstract class Stub extends Binder implements IUnusedAppRestrictionsBackportService {
|
||||
static final int TRANSACTION_isPermissionRevocationEnabledForApp = 1;
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Stub() {
|
||||
attachInterface(this, IUnusedAppRestrictionsBackportService.DESCRIPTOR);
|
||||
}
|
||||
|
||||
public static IUnusedAppRestrictionsBackportService asInterface(IBinder iBinder) {
|
||||
if (iBinder == null) {
|
||||
return null;
|
||||
}
|
||||
IInterface queryLocalInterface = iBinder.queryLocalInterface(IUnusedAppRestrictionsBackportService.DESCRIPTOR);
|
||||
if (queryLocalInterface != null && (queryLocalInterface instanceof IUnusedAppRestrictionsBackportService)) {
|
||||
return (IUnusedAppRestrictionsBackportService) queryLocalInterface;
|
||||
}
|
||||
return new Proxy(iBinder);
|
||||
}
|
||||
|
||||
@Override // android.os.Binder
|
||||
public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException {
|
||||
if (i >= 1 && i <= 16777215) {
|
||||
parcel.enforceInterface(IUnusedAppRestrictionsBackportService.DESCRIPTOR);
|
||||
}
|
||||
if (i == 1598968902) {
|
||||
parcel2.writeString(IUnusedAppRestrictionsBackportService.DESCRIPTOR);
|
||||
return true;
|
||||
}
|
||||
if (i == 1) {
|
||||
isPermissionRevocationEnabledForApp(IUnusedAppRestrictionsBackportCallback.Stub.asInterface(parcel.readStrongBinder()));
|
||||
return true;
|
||||
}
|
||||
return super.onTransact(i, parcel, parcel2, i2);
|
||||
}
|
||||
|
||||
private static class Proxy implements IUnusedAppRestrictionsBackportService {
|
||||
private IBinder mRemote;
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this.mRemote;
|
||||
}
|
||||
|
||||
public String getInterfaceDescriptor() {
|
||||
return IUnusedAppRestrictionsBackportService.DESCRIPTOR;
|
||||
}
|
||||
|
||||
Proxy(IBinder iBinder) {
|
||||
this.mRemote = iBinder;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.unusedapprestrictions.IUnusedAppRestrictionsBackportService
|
||||
public void isPermissionRevocationEnabledForApp(IUnusedAppRestrictionsBackportCallback iUnusedAppRestrictionsBackportCallback) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken(IUnusedAppRestrictionsBackportService.DESCRIPTOR);
|
||||
obtain.writeStrongInterface(iUnusedAppRestrictionsBackportCallback);
|
||||
this.mRemote.transact(1, obtain, null, 1);
|
||||
} finally {
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user