ADD week 5

This commit is contained in:
2025-03-31 16:33:42 +02:00
parent 86f265f22d
commit bf645048e6
4927 changed files with 544053 additions and 0 deletions

View File

@ -0,0 +1,255 @@
package androidx.core;
/* loaded from: classes.dex */
public final class R {
public static final class attr {
public static final int alpha = 0x7f03002e;
public static final int font = 0x7f0301fb;
public static final int fontProviderAuthority = 0x7f0301fd;
public static final int fontProviderCerts = 0x7f0301fe;
public static final int fontProviderFetchStrategy = 0x7f0301ff;
public static final int fontProviderFetchTimeout = 0x7f030200;
public static final int fontProviderPackage = 0x7f030201;
public static final int fontProviderQuery = 0x7f030202;
public static final int fontProviderSystemFontFamily = 0x7f030203;
public static final int fontStyle = 0x7f030204;
public static final int fontVariationSettings = 0x7f030205;
public static final int fontWeight = 0x7f030206;
public static final int lStar = 0x7f030263;
public static final int nestedScrollViewStyle = 0x7f030350;
public static final int queryPatterns = 0x7f03038c;
public static final int shortcutMatchRequired = 0x7f0303bb;
public static final int ttcIndex = 0x7f0304b6;
private attr() {
}
}
public static final class color {
public static final int androidx_core_ripple_material_light = 0x7f05001b;
public static final int androidx_core_secondary_text_default_material_light = 0x7f05001c;
public static final int notification_action_color_filter = 0x7f0502e9;
public static final int notification_icon_bg_color = 0x7f0502ea;
private color() {
}
}
public static final class dimen {
public static final int compat_button_inset_horizontal_material = 0x7f060058;
public static final int compat_button_inset_vertical_material = 0x7f060059;
public static final int compat_button_padding_horizontal_material = 0x7f06005a;
public static final int compat_button_padding_vertical_material = 0x7f06005b;
public static final int compat_control_corner_material = 0x7f06005c;
public static final int compat_notification_large_icon_max_height = 0x7f06005d;
public static final int compat_notification_large_icon_max_width = 0x7f06005e;
public static final int notification_action_icon_size = 0x7f060307;
public static final int notification_action_text_size = 0x7f060308;
public static final int notification_big_circle_margin = 0x7f060309;
public static final int notification_content_margin_start = 0x7f06030a;
public static final int notification_large_icon_height = 0x7f06030b;
public static final int notification_large_icon_width = 0x7f06030c;
public static final int notification_main_column_padding_top = 0x7f06030d;
public static final int notification_media_narrow_margin = 0x7f06030e;
public static final int notification_right_icon_size = 0x7f06030f;
public static final int notification_right_side_padding_top = 0x7f060310;
public static final int notification_small_icon_background_padding = 0x7f060311;
public static final int notification_small_icon_size_as_large = 0x7f060312;
public static final int notification_subtext_size = 0x7f060313;
public static final int notification_top_pad = 0x7f060314;
public static final int notification_top_pad_large_text = 0x7f060315;
private dimen() {
}
}
public static final class drawable {
public static final int notification_action_background = 0x7f0700d0;
public static final int notification_bg = 0x7f0700d1;
public static final int notification_bg_low = 0x7f0700d2;
public static final int notification_bg_low_normal = 0x7f0700d3;
public static final int notification_bg_low_pressed = 0x7f0700d4;
public static final int notification_bg_normal = 0x7f0700d5;
public static final int notification_bg_normal_pressed = 0x7f0700d6;
public static final int notification_icon_background = 0x7f0700d7;
public static final int notification_template_icon_bg = 0x7f0700d8;
public static final int notification_template_icon_low_bg = 0x7f0700d9;
public static final int notification_tile_bg = 0x7f0700da;
public static final int notify_panel_notification_icon_bg = 0x7f0700db;
private drawable() {
}
}
public static final class id {
public static final int accessibility_action_clickable_span = 0x7f08000f;
public static final int accessibility_custom_action_0 = 0x7f080010;
public static final int accessibility_custom_action_1 = 0x7f080011;
public static final int accessibility_custom_action_10 = 0x7f080012;
public static final int accessibility_custom_action_11 = 0x7f080013;
public static final int accessibility_custom_action_12 = 0x7f080014;
public static final int accessibility_custom_action_13 = 0x7f080015;
public static final int accessibility_custom_action_14 = 0x7f080016;
public static final int accessibility_custom_action_15 = 0x7f080017;
public static final int accessibility_custom_action_16 = 0x7f080018;
public static final int accessibility_custom_action_17 = 0x7f080019;
public static final int accessibility_custom_action_18 = 0x7f08001a;
public static final int accessibility_custom_action_19 = 0x7f08001b;
public static final int accessibility_custom_action_2 = 0x7f08001c;
public static final int accessibility_custom_action_20 = 0x7f08001d;
public static final int accessibility_custom_action_21 = 0x7f08001e;
public static final int accessibility_custom_action_22 = 0x7f08001f;
public static final int accessibility_custom_action_23 = 0x7f080020;
public static final int accessibility_custom_action_24 = 0x7f080021;
public static final int accessibility_custom_action_25 = 0x7f080022;
public static final int accessibility_custom_action_26 = 0x7f080023;
public static final int accessibility_custom_action_27 = 0x7f080024;
public static final int accessibility_custom_action_28 = 0x7f080025;
public static final int accessibility_custom_action_29 = 0x7f080026;
public static final int accessibility_custom_action_3 = 0x7f080027;
public static final int accessibility_custom_action_30 = 0x7f080028;
public static final int accessibility_custom_action_31 = 0x7f080029;
public static final int accessibility_custom_action_4 = 0x7f08002a;
public static final int accessibility_custom_action_5 = 0x7f08002b;
public static final int accessibility_custom_action_6 = 0x7f08002c;
public static final int accessibility_custom_action_7 = 0x7f08002d;
public static final int accessibility_custom_action_8 = 0x7f08002e;
public static final int accessibility_custom_action_9 = 0x7f08002f;
public static final int action_container = 0x7f08003a;
public static final int action_divider = 0x7f08003c;
public static final int action_image = 0x7f08003d;
public static final int action_text = 0x7f080043;
public static final int actions = 0x7f080044;
public static final int async = 0x7f080052;
public static final int blocking = 0x7f08005c;
public static final int chronometer = 0x7f080071;
public static final int dialog_button = 0x7f080095;
public static final int forever = 0x7f0800c2;
public static final int icon = 0x7f0800d4;
public static final int icon_group = 0x7f0800d5;
public static final int info = 0x7f0800dd;
public static final int italic = 0x7f0800e0;
public static final int line1 = 0x7f0800e9;
public static final int line3 = 0x7f0800ea;
public static final int normal = 0x7f080139;
public static final int notification_background = 0x7f08013b;
public static final int notification_main_column = 0x7f08013c;
public static final int notification_main_column_container = 0x7f08013d;
public static final int right_icon = 0x7f08016b;
public static final int right_side = 0x7f08016c;
public static final int tag_accessibility_actions = 0x7f0801ad;
public static final int tag_accessibility_clickable_spans = 0x7f0801ae;
public static final int tag_accessibility_heading = 0x7f0801af;
public static final int tag_accessibility_pane_title = 0x7f0801b0;
public static final int tag_on_apply_window_listener = 0x7f0801b1;
public static final int tag_on_receive_content_listener = 0x7f0801b2;
public static final int tag_on_receive_content_mime_types = 0x7f0801b3;
public static final int tag_screen_reader_focusable = 0x7f0801b4;
public static final int tag_state_description = 0x7f0801b5;
public static final int tag_transition_group = 0x7f0801b6;
public static final int tag_unhandled_key_event_manager = 0x7f0801b7;
public static final int tag_unhandled_key_listeners = 0x7f0801b8;
public static final int tag_window_insets_animation_callback = 0x7f0801b9;
public static final int text = 0x7f0801ba;
public static final int text2 = 0x7f0801bb;
public static final int time = 0x7f0801ca;
public static final int title = 0x7f0801cb;
private id() {
}
}
public static final class integer {
public static final int status_bar_notification_info_maxnum = 0x7f090043;
private integer() {
}
}
public static final class layout {
public static final int custom_dialog = 0x7f0b001d;
public static final int notification_action = 0x7f0b0060;
public static final int notification_action_tombstone = 0x7f0b0061;
public static final int notification_template_custom_big = 0x7f0b0062;
public static final int notification_template_icon_group = 0x7f0b0063;
public static final int notification_template_part_chronometer = 0x7f0b0064;
public static final int notification_template_part_time = 0x7f0b0065;
private layout() {
}
}
public static final class string {
public static final int status_bar_notification_info_overflow = 0x7f0f00a8;
private string() {
}
}
public static final class style {
public static final int TextAppearance_Compat_Notification = 0x7f1001c3;
public static final int TextAppearance_Compat_Notification_Info = 0x7f1001c4;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f1001c5;
public static final int TextAppearance_Compat_Notification_Time = 0x7f1001c6;
public static final int TextAppearance_Compat_Notification_Title = 0x7f1001c7;
public static final int Widget_Compat_NotificationActionContainer = 0x7f10032d;
public static final int Widget_Compat_NotificationActionText = 0x7f10032e;
private style() {
}
}
public static final class styleable {
public static final int Capability_queryPatterns = 0x00000000;
public static final int Capability_shortcutMatchRequired = 0x00000001;
public static final int ColorStateListItem_alpha = 0x00000003;
public static final int ColorStateListItem_android_alpha = 0x00000001;
public static final int ColorStateListItem_android_color = 0x00000000;
public static final int ColorStateListItem_android_lStar = 0x00000002;
public static final int ColorStateListItem_lStar = 0x00000004;
public static final int FontFamilyFont_android_font = 0x00000000;
public static final int FontFamilyFont_android_fontStyle = 0x00000002;
public static final int FontFamilyFont_android_fontVariationSettings = 0x00000004;
public static final int FontFamilyFont_android_fontWeight = 0x00000001;
public static final int FontFamilyFont_android_ttcIndex = 0x00000003;
public static final int FontFamilyFont_font = 0x00000005;
public static final int FontFamilyFont_fontStyle = 0x00000006;
public static final int FontFamilyFont_fontVariationSettings = 0x00000007;
public static final int FontFamilyFont_fontWeight = 0x00000008;
public static final int FontFamilyFont_ttcIndex = 0x00000009;
public static final int FontFamily_fontProviderAuthority = 0x00000000;
public static final int FontFamily_fontProviderCerts = 0x00000001;
public static final int FontFamily_fontProviderFetchStrategy = 0x00000002;
public static final int FontFamily_fontProviderFetchTimeout = 0x00000003;
public static final int FontFamily_fontProviderPackage = 0x00000004;
public static final int FontFamily_fontProviderQuery = 0x00000005;
public static final int FontFamily_fontProviderSystemFontFamily = 0x00000006;
public static final int GradientColorItem_android_color = 0x00000000;
public static final int GradientColorItem_android_offset = 0x00000001;
public static final int GradientColor_android_centerColor = 0x00000007;
public static final int GradientColor_android_centerX = 0x00000003;
public static final int GradientColor_android_centerY = 0x00000004;
public static final int GradientColor_android_endColor = 0x00000001;
public static final int GradientColor_android_endX = 0x0000000a;
public static final int GradientColor_android_endY = 0x0000000b;
public static final int GradientColor_android_gradientRadius = 0x00000005;
public static final int GradientColor_android_startColor = 0x00000000;
public static final int GradientColor_android_startX = 0x00000008;
public static final int GradientColor_android_startY = 0x00000009;
public static final int GradientColor_android_tileMode = 0x00000006;
public static final int GradientColor_android_type = 0x00000002;
public static final int[] Capability = {ch.mod_p.sre24.e5.R.attr.queryPatterns, ch.mod_p.sre24.e5.R.attr.shortcutMatchRequired};
public static final int[] ColorStateListItem = {android.R.attr.color, android.R.attr.alpha, android.R.attr.lStar, ch.mod_p.sre24.e5.R.attr.alpha, ch.mod_p.sre24.e5.R.attr.lStar};
public static final int[] FontFamily = {ch.mod_p.sre24.e5.R.attr.fontProviderAuthority, ch.mod_p.sre24.e5.R.attr.fontProviderCerts, ch.mod_p.sre24.e5.R.attr.fontProviderFetchStrategy, ch.mod_p.sre24.e5.R.attr.fontProviderFetchTimeout, ch.mod_p.sre24.e5.R.attr.fontProviderPackage, ch.mod_p.sre24.e5.R.attr.fontProviderQuery, ch.mod_p.sre24.e5.R.attr.fontProviderSystemFontFamily};
public static final int[] FontFamilyFont = {android.R.attr.font, android.R.attr.fontWeight, android.R.attr.fontStyle, android.R.attr.ttcIndex, android.R.attr.fontVariationSettings, ch.mod_p.sre24.e5.R.attr.font, ch.mod_p.sre24.e5.R.attr.fontStyle, ch.mod_p.sre24.e5.R.attr.fontVariationSettings, ch.mod_p.sre24.e5.R.attr.fontWeight, ch.mod_p.sre24.e5.R.attr.ttcIndex};
public static final int[] GradientColor = {android.R.attr.startColor, android.R.attr.endColor, android.R.attr.type, android.R.attr.centerX, android.R.attr.centerY, android.R.attr.gradientRadius, android.R.attr.tileMode, android.R.attr.centerColor, android.R.attr.startX, android.R.attr.startY, android.R.attr.endX, android.R.attr.endY};
public static final int[] GradientColorItem = {android.R.attr.color, android.R.attr.offset};
private styleable() {
}
}
private R() {
}
}

View File

@ -0,0 +1,81 @@
package androidx.core.accessibilityservice;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.content.pm.PackageManager;
/* loaded from: classes.dex */
public final class AccessibilityServiceInfoCompat {
public static final int CAPABILITY_CAN_FILTER_KEY_EVENTS = 8;
public static final int CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY = 4;
public static final int CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION = 2;
public static final int CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT = 1;
public static final int FEEDBACK_ALL_MASK = -1;
public static final int FEEDBACK_BRAILLE = 32;
public static final int FLAG_INCLUDE_NOT_IMPORTANT_VIEWS = 2;
public static final int FLAG_REPORT_VIEW_IDS = 16;
public static final int FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY = 8;
public static final int FLAG_REQUEST_FILTER_KEY_EVENTS = 32;
public static final int FLAG_REQUEST_TOUCH_EXPLORATION_MODE = 4;
public static String capabilityToString(int i) {
return i != 1 ? i != 2 ? i != 4 ? i != 8 ? "UNKNOWN" : "CAPABILITY_CAN_FILTER_KEY_EVENTS" : "CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY" : "CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION" : "CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT";
}
public static String flagToString(int i) {
if (i == 1) {
return "DEFAULT";
}
if (i == 2) {
return "FLAG_INCLUDE_NOT_IMPORTANT_VIEWS";
}
if (i == 4) {
return "FLAG_REQUEST_TOUCH_EXPLORATION_MODE";
}
if (i == 8) {
return "FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY";
}
if (i == 16) {
return "FLAG_REPORT_VIEW_IDS";
}
if (i != 32) {
return null;
}
return "FLAG_REQUEST_FILTER_KEY_EVENTS";
}
private AccessibilityServiceInfoCompat() {
}
public static String loadDescription(AccessibilityServiceInfo accessibilityServiceInfo, PackageManager packageManager) {
return accessibilityServiceInfo.loadDescription(packageManager);
}
public static String feedbackTypeToString(int i) {
StringBuilder sb = new StringBuilder();
sb.append("[");
while (i > 0) {
int numberOfTrailingZeros = 1 << Integer.numberOfTrailingZeros(i);
i &= ~numberOfTrailingZeros;
if (sb.length() > 1) {
sb.append(", ");
}
if (numberOfTrailingZeros == 1) {
sb.append("FEEDBACK_SPOKEN");
} else if (numberOfTrailingZeros == 2) {
sb.append("FEEDBACK_HAPTIC");
} else if (numberOfTrailingZeros == 4) {
sb.append("FEEDBACK_AUDIBLE");
} else if (numberOfTrailingZeros == 8) {
sb.append("FEEDBACK_VISUAL");
} else if (numberOfTrailingZeros == 16) {
sb.append("FEEDBACK_GENERIC");
}
}
sb.append("]");
return sb.toString();
}
public static int getCapabilities(AccessibilityServiceInfo accessibilityServiceInfo) {
return accessibilityServiceInfo.getCapabilities();
}
}

View File

@ -0,0 +1,49 @@
package androidx.core.animation;
import android.animation.Animator;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: Animator.kt */
@Metadata(d1 = {"\u0000\u0019\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0010\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H\u0016J\u0010\u0010\u0006\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H\u0016J\u0010\u0010\u0007\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H\u0016J\u0010\u0010\b\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H\u0016¨\u0006\t"}, d2 = {"androidx/core/animation/AnimatorKt$addListener$listener$1", "Landroid/animation/Animator$AnimatorListener;", "onAnimationCancel", "", "animator", "Landroid/animation/Animator;", "onAnimationEnd", "onAnimationRepeat", "onAnimationStart", "core-ktx_release"}, k = 1, mv = {1, 7, 1}, xi = 176)
/* loaded from: classes.dex */
public final class AnimatorKt$addListener$listener$1 implements Animator.AnimatorListener {
final /* synthetic */ Function1<Animator, Unit> $onCancel;
final /* synthetic */ Function1<Animator, Unit> $onEnd;
final /* synthetic */ Function1<Animator, Unit> $onRepeat;
final /* synthetic */ Function1<Animator, Unit> $onStart;
/* JADX WARN: Multi-variable type inference failed */
public AnimatorKt$addListener$listener$1(Function1<? super Animator, Unit> function1, Function1<? super Animator, Unit> function12, Function1<? super Animator, Unit> function13, Function1<? super Animator, Unit> function14) {
this.$onRepeat = function1;
this.$onEnd = function12;
this.$onCancel = function13;
this.$onStart = function14;
}
@Override // android.animation.Animator.AnimatorListener
public void onAnimationRepeat(Animator animator) {
Intrinsics.checkNotNullParameter(animator, "animator");
this.$onRepeat.invoke(animator);
}
@Override // android.animation.Animator.AnimatorListener
public void onAnimationEnd(Animator animator) {
Intrinsics.checkNotNullParameter(animator, "animator");
this.$onEnd.invoke(animator);
}
@Override // android.animation.Animator.AnimatorListener
public void onAnimationCancel(Animator animator) {
Intrinsics.checkNotNullParameter(animator, "animator");
this.$onCancel.invoke(animator);
}
@Override // android.animation.Animator.AnimatorListener
public void onAnimationStart(Animator animator) {
Intrinsics.checkNotNullParameter(animator, "animator");
this.$onStart.invoke(animator);
}
}

View File

@ -0,0 +1,271 @@
package androidx.core.animation;
import android.animation.Animator;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: Animator.kt */
@Metadata(d1 = {"\u0000(\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\n\u001a¤\u0001\u0010\u0000\u001a\u00020\u0001*\u00020\u00022#\b\u0006\u0010\u0003\u001a\u001d\u0012\u0013\u0012\u00110\u0002¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u00042#\b\u0006\u0010\t\u001a\u001d\u0012\u0013\u0012\u00110\u0002¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u00042#\b\u0006\u0010\n\u001a\u001d\u0012\u0013\u0012\u00110\u0002¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u00042#\b\u0006\u0010\u000b\u001a\u001d\u0012\u0013\u0012\u00110\u0002¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u0004H\u0086\\u0001\u0000\u001aV\u0010\f\u001a\u00020\r*\u00020\u00022#\b\u0002\u0010\u000e\u001a\u001d\u0012\u0013\u0012\u00110\u0002¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u00042#\b\u0002\u0010\u000f\u001a\u001d\u0012\u0013\u0012\u00110\u0002¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u0004H\u0007\u001a5\u0010\u0010\u001a\u00020\u0001*\u00020\u00022#\b\u0004\u0010\u0011\u001a\u001d\u0012\u0013\u0012\u00110\u0002¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u0004H\u0086\\u0001\u0000\u001a5\u0010\u0012\u001a\u00020\u0001*\u00020\u00022#\b\u0004\u0010\u0011\u001a\u001d\u0012\u0013\u0012\u00110\u0002¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u0004H\u0086\\u0001\u0000\u001a/\u0010\u0013\u001a\u00020\r*\u00020\u00022!\u0010\u0011\u001a\u001d\u0012\u0013\u0012\u00110\u0002¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u0004H\u0007\u001a5\u0010\u0014\u001a\u00020\u0001*\u00020\u00022#\b\u0004\u0010\u0011\u001a\u001d\u0012\u0013\u0012\u00110\u0002¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u0004H\u0086\\u0001\u0000\u001a/\u0010\u0015\u001a\u00020\r*\u00020\u00022!\u0010\u0011\u001a\u001d\u0012\u0013\u0012\u00110\u0002¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u0004H\u0007\u001a5\u0010\u0016\u001a\u00020\u0001*\u00020\u00022#\b\u0004\u0010\u0011\u001a\u001d\u0012\u0013\u0012\u00110\u0002¢\u0006\f\b\u0005\u0012\b\b\u0006\u0012\u0004\b\b(\u0007\u0012\u0004\u0012\u00020\b0\u0004H\u0086\\u0001\u0000\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006\u0017"}, d2 = {"addListener", "Landroid/animation/Animator$AnimatorListener;", "Landroid/animation/Animator;", "onEnd", "Lkotlin/Function1;", "Lkotlin/ParameterName;", "name", "animator", "", "onStart", "onCancel", "onRepeat", "addPauseListener", "Landroid/animation/Animator$AnimatorPauseListener;", "onResume", "onPause", "doOnCancel", "action", "doOnEnd", "doOnPause", "doOnRepeat", "doOnResume", "doOnStart", "core-ktx_release"}, k = 2, mv = {1, 7, 1}, xi = 48)
/* loaded from: classes.dex */
public final class AnimatorKt {
public static final Animator.AnimatorPauseListener doOnResume(Animator animator, Function1<? super Animator, Unit> action) {
Intrinsics.checkNotNullParameter(animator, "<this>");
Intrinsics.checkNotNullParameter(action, "action");
return addPauseListener$default(animator, action, null, 2, null);
}
public static final Animator.AnimatorPauseListener doOnPause(Animator animator, Function1<? super Animator, Unit> action) {
Intrinsics.checkNotNullParameter(animator, "<this>");
Intrinsics.checkNotNullParameter(action, "action");
return addPauseListener$default(animator, null, action, 1, null);
}
public static /* synthetic */ Animator.AnimatorListener addListener$default(Animator animator, Function1 onEnd, Function1 onStart, Function1 onCancel, Function1 onRepeat, int i, Object obj) {
if ((i & 1) != 0) {
onEnd = new Function1<Animator, Unit>() { // from class: androidx.core.animation.AnimatorKt$addListener$1
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public final void invoke2(Animator it) {
Intrinsics.checkNotNullParameter(it, "it");
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Animator animator2) {
invoke2(animator2);
return Unit.INSTANCE;
}
};
}
if ((i & 2) != 0) {
onStart = new Function1<Animator, Unit>() { // from class: androidx.core.animation.AnimatorKt$addListener$2
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public final void invoke2(Animator it) {
Intrinsics.checkNotNullParameter(it, "it");
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Animator animator2) {
invoke2(animator2);
return Unit.INSTANCE;
}
};
}
if ((i & 4) != 0) {
onCancel = new Function1<Animator, Unit>() { // from class: androidx.core.animation.AnimatorKt$addListener$3
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public final void invoke2(Animator it) {
Intrinsics.checkNotNullParameter(it, "it");
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Animator animator2) {
invoke2(animator2);
return Unit.INSTANCE;
}
};
}
if ((i & 8) != 0) {
onRepeat = new Function1<Animator, Unit>() { // from class: androidx.core.animation.AnimatorKt$addListener$4
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public final void invoke2(Animator it) {
Intrinsics.checkNotNullParameter(it, "it");
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Animator animator2) {
invoke2(animator2);
return Unit.INSTANCE;
}
};
}
Intrinsics.checkNotNullParameter(animator, "<this>");
Intrinsics.checkNotNullParameter(onEnd, "onEnd");
Intrinsics.checkNotNullParameter(onStart, "onStart");
Intrinsics.checkNotNullParameter(onCancel, "onCancel");
Intrinsics.checkNotNullParameter(onRepeat, "onRepeat");
AnimatorKt$addListener$listener$1 animatorKt$addListener$listener$1 = new AnimatorKt$addListener$listener$1(onRepeat, onEnd, onCancel, onStart);
animator.addListener(animatorKt$addListener$listener$1);
return animatorKt$addListener$listener$1;
}
public static final Animator.AnimatorListener addListener(Animator animator, Function1<? super Animator, Unit> onEnd, Function1<? super Animator, Unit> onStart, Function1<? super Animator, Unit> onCancel, Function1<? super Animator, Unit> onRepeat) {
Intrinsics.checkNotNullParameter(animator, "<this>");
Intrinsics.checkNotNullParameter(onEnd, "onEnd");
Intrinsics.checkNotNullParameter(onStart, "onStart");
Intrinsics.checkNotNullParameter(onCancel, "onCancel");
Intrinsics.checkNotNullParameter(onRepeat, "onRepeat");
AnimatorKt$addListener$listener$1 animatorKt$addListener$listener$1 = new AnimatorKt$addListener$listener$1(onRepeat, onEnd, onCancel, onStart);
animator.addListener(animatorKt$addListener$listener$1);
return animatorKt$addListener$listener$1;
}
public static /* synthetic */ Animator.AnimatorPauseListener addPauseListener$default(Animator animator, Function1 function1, Function1 function12, int i, Object obj) {
if ((i & 1) != 0) {
function1 = new Function1<Animator, Unit>() { // from class: androidx.core.animation.AnimatorKt$addPauseListener$1
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public final void invoke2(Animator it) {
Intrinsics.checkNotNullParameter(it, "it");
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Animator animator2) {
invoke2(animator2);
return Unit.INSTANCE;
}
};
}
if ((i & 2) != 0) {
function12 = new Function1<Animator, Unit>() { // from class: androidx.core.animation.AnimatorKt$addPauseListener$2
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public final void invoke2(Animator it) {
Intrinsics.checkNotNullParameter(it, "it");
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Animator animator2) {
invoke2(animator2);
return Unit.INSTANCE;
}
};
}
return addPauseListener(animator, function1, function12);
}
public static final Animator.AnimatorPauseListener addPauseListener(Animator animator, final Function1<? super Animator, Unit> onResume, final Function1<? super Animator, Unit> onPause) {
Intrinsics.checkNotNullParameter(animator, "<this>");
Intrinsics.checkNotNullParameter(onResume, "onResume");
Intrinsics.checkNotNullParameter(onPause, "onPause");
Animator.AnimatorPauseListener animatorPauseListener = new Animator.AnimatorPauseListener() { // from class: androidx.core.animation.AnimatorKt$addPauseListener$listener$1
@Override // android.animation.Animator.AnimatorPauseListener
public void onAnimationPause(Animator animator2) {
Intrinsics.checkNotNullParameter(animator2, "animator");
onPause.invoke(animator2);
}
@Override // android.animation.Animator.AnimatorPauseListener
public void onAnimationResume(Animator animator2) {
Intrinsics.checkNotNullParameter(animator2, "animator");
onResume.invoke(animator2);
}
};
Api19Impl.addPauseListener(animator, animatorPauseListener);
return animatorPauseListener;
}
public static final Animator.AnimatorListener doOnEnd(Animator animator, final Function1<? super Animator, Unit> action) {
Intrinsics.checkNotNullParameter(animator, "<this>");
Intrinsics.checkNotNullParameter(action, "action");
Animator.AnimatorListener animatorListener = new Animator.AnimatorListener() { // from class: androidx.core.animation.AnimatorKt$doOnEnd$$inlined$addListener$default$1
@Override // android.animation.Animator.AnimatorListener
public void onAnimationCancel(Animator animator2) {
Intrinsics.checkNotNullParameter(animator2, "animator");
}
@Override // android.animation.Animator.AnimatorListener
public void onAnimationRepeat(Animator animator2) {
Intrinsics.checkNotNullParameter(animator2, "animator");
}
@Override // android.animation.Animator.AnimatorListener
public void onAnimationStart(Animator animator2) {
Intrinsics.checkNotNullParameter(animator2, "animator");
}
@Override // android.animation.Animator.AnimatorListener
public void onAnimationEnd(Animator animator2) {
Intrinsics.checkNotNullParameter(animator2, "animator");
Function1.this.invoke(animator2);
}
};
animator.addListener(animatorListener);
return animatorListener;
}
public static final Animator.AnimatorListener doOnStart(Animator animator, final Function1<? super Animator, Unit> action) {
Intrinsics.checkNotNullParameter(animator, "<this>");
Intrinsics.checkNotNullParameter(action, "action");
Animator.AnimatorListener animatorListener = new Animator.AnimatorListener() { // from class: androidx.core.animation.AnimatorKt$doOnStart$$inlined$addListener$default$1
@Override // android.animation.Animator.AnimatorListener
public void onAnimationCancel(Animator animator2) {
Intrinsics.checkNotNullParameter(animator2, "animator");
}
@Override // android.animation.Animator.AnimatorListener
public void onAnimationEnd(Animator animator2) {
Intrinsics.checkNotNullParameter(animator2, "animator");
}
@Override // android.animation.Animator.AnimatorListener
public void onAnimationRepeat(Animator animator2) {
Intrinsics.checkNotNullParameter(animator2, "animator");
}
@Override // android.animation.Animator.AnimatorListener
public void onAnimationStart(Animator animator2) {
Intrinsics.checkNotNullParameter(animator2, "animator");
Function1.this.invoke(animator2);
}
};
animator.addListener(animatorListener);
return animatorListener;
}
public static final Animator.AnimatorListener doOnCancel(Animator animator, final Function1<? super Animator, Unit> action) {
Intrinsics.checkNotNullParameter(animator, "<this>");
Intrinsics.checkNotNullParameter(action, "action");
Animator.AnimatorListener animatorListener = new Animator.AnimatorListener() { // from class: androidx.core.animation.AnimatorKt$doOnCancel$$inlined$addListener$default$1
@Override // android.animation.Animator.AnimatorListener
public void onAnimationEnd(Animator animator2) {
Intrinsics.checkNotNullParameter(animator2, "animator");
}
@Override // android.animation.Animator.AnimatorListener
public void onAnimationRepeat(Animator animator2) {
Intrinsics.checkNotNullParameter(animator2, "animator");
}
@Override // android.animation.Animator.AnimatorListener
public void onAnimationStart(Animator animator2) {
Intrinsics.checkNotNullParameter(animator2, "animator");
}
@Override // android.animation.Animator.AnimatorListener
public void onAnimationCancel(Animator animator2) {
Intrinsics.checkNotNullParameter(animator2, "animator");
Function1.this.invoke(animator2);
}
};
animator.addListener(animatorListener);
return animatorListener;
}
public static final Animator.AnimatorListener doOnRepeat(Animator animator, final Function1<? super Animator, Unit> action) {
Intrinsics.checkNotNullParameter(animator, "<this>");
Intrinsics.checkNotNullParameter(action, "action");
Animator.AnimatorListener animatorListener = new Animator.AnimatorListener() { // from class: androidx.core.animation.AnimatorKt$doOnRepeat$$inlined$addListener$default$1
@Override // android.animation.Animator.AnimatorListener
public void onAnimationCancel(Animator animator2) {
Intrinsics.checkNotNullParameter(animator2, "animator");
}
@Override // android.animation.Animator.AnimatorListener
public void onAnimationEnd(Animator animator2) {
Intrinsics.checkNotNullParameter(animator2, "animator");
}
@Override // android.animation.Animator.AnimatorListener
public void onAnimationStart(Animator animator2) {
Intrinsics.checkNotNullParameter(animator2, "animator");
}
@Override // android.animation.Animator.AnimatorListener
public void onAnimationRepeat(Animator animator2) {
Intrinsics.checkNotNullParameter(animator2, "animator");
Function1.this.invoke(animator2);
}
};
animator.addListener(animatorListener);
return animatorListener;
}
}

View File

@ -0,0 +1,23 @@
package androidx.core.animation;
import android.animation.Animator;
import kotlin.Metadata;
import kotlin.jvm.JvmStatic;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: Animator.kt */
@Metadata(d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0018\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\bH\u0007¨\u0006\t"}, d2 = {"Landroidx/core/animation/Api19Impl;", "", "()V", "addPauseListener", "", "animator", "Landroid/animation/Animator;", "listener", "Landroid/animation/Animator$AnimatorPauseListener;", "core-ktx_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
/* loaded from: classes.dex */
final class Api19Impl {
public static final Api19Impl INSTANCE = new Api19Impl();
private Api19Impl() {
}
@JvmStatic
public static final void addPauseListener(Animator animator, Animator.AnimatorPauseListener listener) {
Intrinsics.checkNotNullParameter(animator, "animator");
Intrinsics.checkNotNullParameter(listener, "listener");
animator.addPauseListener(listener);
}
}

View 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();
}
}
}

View File

@ -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();
}
}

View 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();
}
}
}

View 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;
}
}
}

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View 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() {
}
}

View 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);
}
}
}

View 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);
}
}
}

View 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;
}
}
}

View File

@ -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;
}
}

View 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);
}
}
}

View File

@ -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;
}
}
}

View File

@ -0,0 +1,6 @@
package androidx.core.app;
/* compiled from: D8$$SyntheticClass */
/* loaded from: classes.dex */
public final /* synthetic */ class JobIntentService$JobServiceEngineImpl$$ExternalSyntheticApiModelOutline0 {
}

View 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);
}
}
}

View File

@ -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();
}
}
}

View File

@ -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?");
}
}

View 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();
}
}
}

View File

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

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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() {
}
}

File diff suppressed because it is too large Load Diff

View File

@ -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;
}
}

View File

@ -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() {
}
}

View File

@ -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() {
}
}

View File

@ -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);
}
}

View File

@ -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 + "]";
}
}
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View 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();
}
}
}

View File

@ -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?");
}
}

View 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);
}
}
}

View File

@ -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);
}
}

View 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);
}
}
}

View 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);
}
}
}

View 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("&lt;");
} else if (charAt == '>') {
sb.append("&gt;");
} else if (charAt == '&') {
sb.append("&amp;");
} 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("&nbsp;");
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);
}
}
}

View 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();
}
}

View 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);
}
}
}

View File

@ -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();
}
}
}
}
}

View File

@ -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();
}
}
}
}
}

View File

@ -0,0 +1,18 @@
package androidx.core.content;
import android.content.ContentProvider;
import android.content.Context;
/* loaded from: classes.dex */
public final class ContentProviderCompat {
private ContentProviderCompat() {
}
public static Context requireContext(ContentProvider contentProvider) {
Context context = contentProvider.getContext();
if (context != null) {
return context;
}
throw new IllegalStateException("Cannot find context from the provider.");
}
}

View File

@ -0,0 +1,39 @@
package androidx.core.content;
import android.content.ContentResolver;
import android.database.Cursor;
import android.net.Uri;
import android.os.OperationCanceledException;
import androidx.core.os.CancellationSignal;
/* loaded from: classes.dex */
public final class ContentResolverCompat {
private ContentResolverCompat() {
}
public static Cursor query(ContentResolver contentResolver, Uri uri, String[] strArr, String str, String[] strArr2, String str2, CancellationSignal cancellationSignal) {
Object cancellationSignalObject;
if (cancellationSignal != null) {
try {
cancellationSignalObject = cancellationSignal.getCancellationSignalObject();
} catch (Exception e) {
if (e instanceof OperationCanceledException) {
throw new androidx.core.os.OperationCanceledException();
}
throw e;
}
} else {
cancellationSignalObject = null;
}
return Api16Impl.query(contentResolver, uri, strArr, str, strArr2, str2, (android.os.CancellationSignal) cancellationSignalObject);
}
static class Api16Impl {
private Api16Impl() {
}
static Cursor query(ContentResolver contentResolver, Uri uri, String[] strArr, String str, String[] strArr2, String str2, android.os.CancellationSignal cancellationSignal) {
return contentResolver.query(uri, strArr, str, strArr2, str2, cancellationSignal);
}
}
}

View File

@ -0,0 +1,46 @@
package androidx.core.content;
import android.content.ContentValues;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.Typography;
/* compiled from: ContentValues.kt */
@Metadata(d1 = {"\u0000\u001c\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\u0010\u0000\n\u0002\b\u0002\u001a;\u0010\u0000\u001a\u00020\u00012.\u0010\u0002\u001a\u0018\u0012\u0014\b\u0001\u0012\u0010\u0012\u0004\u0012\u00020\u0005\u0012\u0006\u0012\u0004\u0018\u00010\u00060\u00040\u0003\"\u0010\u0012\u0004\u0012\u00020\u0005\u0012\u0006\u0012\u0004\u0018\u00010\u00060\u0004¢\u0006\u0002\u0010\u0007¨\u0006\b"}, d2 = {"contentValuesOf", "Landroid/content/ContentValues;", "pairs", "", "Lkotlin/Pair;", "", "", "([Lkotlin/Pair;)Landroid/content/ContentValues;", "core-ktx_release"}, k = 2, mv = {1, 7, 1}, xi = 48)
/* loaded from: classes.dex */
public final class ContentValuesKt {
public static final ContentValues contentValuesOf(Pair<String, ? extends Object>... pairs) {
Intrinsics.checkNotNullParameter(pairs, "pairs");
ContentValues contentValues = new ContentValues(pairs.length);
for (Pair<String, ? extends Object> pair : pairs) {
String component1 = pair.component1();
Object component2 = pair.component2();
if (component2 == null) {
contentValues.putNull(component1);
} else if (component2 instanceof String) {
contentValues.put(component1, (String) component2);
} else if (component2 instanceof Integer) {
contentValues.put(component1, (Integer) component2);
} else if (component2 instanceof Long) {
contentValues.put(component1, (Long) component2);
} else if (component2 instanceof Boolean) {
contentValues.put(component1, (Boolean) component2);
} else if (component2 instanceof Float) {
contentValues.put(component1, (Float) component2);
} else if (component2 instanceof Double) {
contentValues.put(component1, (Double) component2);
} else if (component2 instanceof byte[]) {
contentValues.put(component1, (byte[]) component2);
} else if (component2 instanceof Byte) {
contentValues.put(component1, (Byte) component2);
} else {
if (!(component2 instanceof Short)) {
throw new IllegalArgumentException("Illegal value type " + component2.getClass().getCanonicalName() + " for key \"" + component1 + Typography.quote);
}
contentValues.put(component1, (Short) component2);
}
}
return contentValues;
}
}

View File

@ -0,0 +1,459 @@
package androidx.core.content;
import android.accounts.AccountManager;
import android.app.ActivityManager;
import android.app.AlarmManager;
import android.app.AppOpsManager;
import android.app.DownloadManager;
import android.app.KeyguardManager;
import android.app.NotificationManager;
import android.app.SearchManager;
import android.app.UiModeManager;
import android.app.WallpaperManager;
import android.app.admin.DevicePolicyManager;
import android.app.job.JobScheduler;
import android.app.usage.UsageStatsManager;
import android.appwidget.AppWidgetManager;
import android.bluetooth.BluetoothManager;
import android.content.BroadcastReceiver;
import android.content.ClipboardManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.RestrictionsManager;
import android.content.pm.LauncherApps;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.hardware.ConsumerIrManager;
import android.hardware.SensorManager;
import android.hardware.camera2.CameraManager;
import android.hardware.display.DisplayManager;
import android.hardware.input.InputManager;
import android.hardware.usb.UsbManager;
import android.location.LocationManager;
import android.media.AudioManager;
import android.media.MediaRouter;
import android.media.projection.MediaProjectionManager;
import android.media.session.MediaSessionManager;
import android.media.tv.TvInputManager;
import android.net.ConnectivityManager;
import android.net.nsd.NsdManager;
import android.net.wifi.WifiManager;
import android.net.wifi.p2p.WifiP2pManager;
import android.nfc.NfcManager;
import android.os.BatteryManager;
import android.os.Build;
import android.os.Bundle;
import android.os.DropBoxManager;
import android.os.Handler;
import android.os.PowerManager;
import android.os.Process;
import android.os.UserManager;
import android.os.Vibrator;
import android.os.storage.StorageManager;
import android.print.PrintManager;
import android.telecom.TelecomManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.CaptioningManager;
import android.view.inputmethod.InputMethodManager;
import android.view.textservice.TextServicesManager;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationCompat$Style$$ExternalSyntheticApiModelOutline0;
import androidx.core.app.NotificationManagerCompat;
import androidx.core.content.res.ResourcesCompat;
import androidx.core.os.BuildCompat;
import androidx.core.os.ExecutorCompat;
import androidx.core.util.ObjectsCompat;
import java.io.File;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.HashMap;
import java.util.concurrent.Executor;
/* loaded from: classes.dex */
public class ContextCompat {
private static final String DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION_SUFFIX = ".DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION";
public static final int RECEIVER_EXPORTED = 2;
public static final int RECEIVER_NOT_EXPORTED = 4;
public static final int RECEIVER_VISIBLE_TO_INSTANT_APPS = 1;
private static final String TAG = "ContextCompat";
private static final Object sLock = new Object();
private static final Object sSync = new Object();
private static TypedValue sTempValue;
@Retention(RetentionPolicy.SOURCE)
public @interface RegisterReceiverFlags {
}
protected ContextCompat() {
}
public static String getAttributionTag(Context context) {
if (Build.VERSION.SDK_INT >= 30) {
return Api30Impl.getAttributionTag(context);
}
return null;
}
public static boolean startActivities(Context context, Intent[] intentArr) {
return startActivities(context, intentArr, null);
}
public static boolean startActivities(Context context, Intent[] intentArr, Bundle bundle) {
Api16Impl.startActivities(context, intentArr, bundle);
return true;
}
public static void startActivity(Context context, Intent intent, Bundle bundle) {
Api16Impl.startActivity(context, intent, bundle);
}
public static File getDataDir(Context context) {
if (Build.VERSION.SDK_INT >= 24) {
return Api24Impl.getDataDir(context);
}
String str = context.getApplicationInfo().dataDir;
if (str != null) {
return new File(str);
}
return null;
}
public static File[] getObbDirs(Context context) {
return Api19Impl.getObbDirs(context);
}
public static File[] getExternalFilesDirs(Context context, String str) {
return Api19Impl.getExternalFilesDirs(context, str);
}
public static File[] getExternalCacheDirs(Context context) {
return Api19Impl.getExternalCacheDirs(context);
}
public static Drawable getDrawable(Context context, int i) {
return Api21Impl.getDrawable(context, i);
}
public static ColorStateList getColorStateList(Context context, int i) {
return ResourcesCompat.getColorStateList(context.getResources(), i, context.getTheme());
}
public static int getColor(Context context, int i) {
if (Build.VERSION.SDK_INT >= 23) {
return Api23Impl.getColor(context, i);
}
return context.getResources().getColor(i);
}
public static int checkSelfPermission(Context context, String str) {
ObjectsCompat.requireNonNull(str, "permission must be non-null");
if (BuildCompat.isAtLeastT() || !TextUtils.equals("android.permission.POST_NOTIFICATIONS", str)) {
return context.checkPermission(str, Process.myPid(), Process.myUid());
}
return NotificationManagerCompat.from(context).areNotificationsEnabled() ? 0 : -1;
}
public static File getNoBackupFilesDir(Context context) {
return Api21Impl.getNoBackupFilesDir(context);
}
public static File getCodeCacheDir(Context context) {
return Api21Impl.getCodeCacheDir(context);
}
private static File createFilesDir(File file) {
synchronized (sSync) {
if (!file.exists()) {
if (file.mkdirs()) {
return file;
}
Log.w(TAG, "Unable to create files subdir " + file.getPath());
}
return file;
}
}
public static Context createDeviceProtectedStorageContext(Context context) {
if (Build.VERSION.SDK_INT >= 24) {
return Api24Impl.createDeviceProtectedStorageContext(context);
}
return null;
}
public static boolean isDeviceProtectedStorage(Context context) {
if (Build.VERSION.SDK_INT >= 24) {
return Api24Impl.isDeviceProtectedStorage(context);
}
return false;
}
public static Executor getMainExecutor(Context context) {
if (Build.VERSION.SDK_INT >= 28) {
return Api28Impl.getMainExecutor(context);
}
return ExecutorCompat.create(new Handler(context.getMainLooper()));
}
public static void startForegroundService(Context context, Intent intent) {
if (Build.VERSION.SDK_INT >= 26) {
Api26Impl.startForegroundService(context, intent);
} else {
context.startService(intent);
}
}
public static <T> T getSystemService(Context context, Class<T> cls) {
if (Build.VERSION.SDK_INT >= 23) {
return (T) Api23Impl.getSystemService(context, cls);
}
String systemServiceName = getSystemServiceName(context, cls);
if (systemServiceName != null) {
return (T) context.getSystemService(systemServiceName);
}
return null;
}
public static Intent registerReceiver(Context context, BroadcastReceiver broadcastReceiver, IntentFilter intentFilter, int i) {
return registerReceiver(context, broadcastReceiver, intentFilter, null, null, i);
}
public static Intent registerReceiver(Context context, BroadcastReceiver broadcastReceiver, IntentFilter intentFilter, String str, Handler handler, int i) {
int i2 = i & 1;
if (i2 != 0 && (i & 4) != 0) {
throw new IllegalArgumentException("Cannot specify both RECEIVER_VISIBLE_TO_INSTANT_APPS and RECEIVER_NOT_EXPORTED");
}
if (i2 != 0) {
i |= 2;
}
int i3 = i;
int i4 = i3 & 2;
if (i4 == 0 && (i3 & 4) == 0) {
throw new IllegalArgumentException("One of either RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED is required");
}
if (i4 != 0 && (i3 & 4) != 0) {
throw new IllegalArgumentException("Cannot specify both RECEIVER_EXPORTED and RECEIVER_NOT_EXPORTED");
}
if (BuildCompat.isAtLeastT()) {
return Api33Impl.registerReceiver(context, broadcastReceiver, intentFilter, str, handler, i3);
}
if (Build.VERSION.SDK_INT >= 26) {
return Api26Impl.registerReceiver(context, broadcastReceiver, intentFilter, str, handler, i3);
}
if ((i3 & 4) != 0 && str == null) {
return context.registerReceiver(broadcastReceiver, intentFilter, obtainAndCheckReceiverPermission(context), handler);
}
return context.registerReceiver(broadcastReceiver, intentFilter, str, handler);
}
public static String getSystemServiceName(Context context, Class<?> cls) {
if (Build.VERSION.SDK_INT >= 23) {
return Api23Impl.getSystemServiceName(context, cls);
}
return LegacyServiceMapHolder.SERVICES.get(cls);
}
static String obtainAndCheckReceiverPermission(Context context) {
String str = context.getPackageName() + DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION_SUFFIX;
if (PermissionChecker.checkSelfPermission(context, str) == 0) {
return str;
}
throw new RuntimeException("Permission " + str + " is required by your application to receive broadcasts, please add it to your manifest");
}
private static final class LegacyServiceMapHolder {
static final HashMap<Class<?>, String> SERVICES;
private LegacyServiceMapHolder() {
}
static {
HashMap<Class<?>, String> hashMap = new HashMap<>();
SERVICES = hashMap;
if (Build.VERSION.SDK_INT >= 22) {
hashMap.put(NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$2(), "telephony_subscription_service");
hashMap.put(UsageStatsManager.class, "usagestats");
}
hashMap.put(AppWidgetManager.class, "appwidget");
hashMap.put(BatteryManager.class, "batterymanager");
hashMap.put(CameraManager.class, "camera");
hashMap.put(JobScheduler.class, "jobscheduler");
hashMap.put(LauncherApps.class, "launcherapps");
hashMap.put(MediaProjectionManager.class, "media_projection");
hashMap.put(MediaSessionManager.class, "media_session");
hashMap.put(RestrictionsManager.class, "restrictions");
hashMap.put(TelecomManager.class, "telecom");
hashMap.put(TvInputManager.class, "tv_input");
hashMap.put(AppOpsManager.class, "appops");
hashMap.put(CaptioningManager.class, "captioning");
hashMap.put(ConsumerIrManager.class, "consumer_ir");
hashMap.put(PrintManager.class, "print");
hashMap.put(BluetoothManager.class, "bluetooth");
hashMap.put(DisplayManager.class, "display");
hashMap.put(UserManager.class, "user");
hashMap.put(InputManager.class, "input");
hashMap.put(MediaRouter.class, "media_router");
hashMap.put(NsdManager.class, "servicediscovery");
hashMap.put(AccessibilityManager.class, "accessibility");
hashMap.put(AccountManager.class, "account");
hashMap.put(ActivityManager.class, "activity");
hashMap.put(AlarmManager.class, NotificationCompat.CATEGORY_ALARM);
hashMap.put(AudioManager.class, "audio");
hashMap.put(ClipboardManager.class, "clipboard");
hashMap.put(ConnectivityManager.class, "connectivity");
hashMap.put(DevicePolicyManager.class, "device_policy");
hashMap.put(DownloadManager.class, "download");
hashMap.put(DropBoxManager.class, "dropbox");
hashMap.put(InputMethodManager.class, "input_method");
hashMap.put(KeyguardManager.class, "keyguard");
hashMap.put(LayoutInflater.class, "layout_inflater");
hashMap.put(LocationManager.class, "location");
hashMap.put(NfcManager.class, "nfc");
hashMap.put(NotificationManager.class, "notification");
hashMap.put(PowerManager.class, "power");
hashMap.put(SearchManager.class, "search");
hashMap.put(SensorManager.class, "sensor");
hashMap.put(StorageManager.class, "storage");
hashMap.put(TelephonyManager.class, "phone");
hashMap.put(TextServicesManager.class, "textservices");
hashMap.put(UiModeManager.class, "uimode");
hashMap.put(UsbManager.class, "usb");
hashMap.put(Vibrator.class, "vibrator");
hashMap.put(WallpaperManager.class, "wallpaper");
hashMap.put(WifiP2pManager.class, "wifip2p");
hashMap.put(WifiManager.class, "wifi");
hashMap.put(WindowManager.class, "window");
}
}
static class Api16Impl {
private Api16Impl() {
}
static void startActivities(Context context, Intent[] intentArr, Bundle bundle) {
context.startActivities(intentArr, bundle);
}
static void startActivity(Context context, Intent intent, Bundle bundle) {
context.startActivity(intent, bundle);
}
}
static class Api19Impl {
private Api19Impl() {
}
static File[] getExternalCacheDirs(Context context) {
return context.getExternalCacheDirs();
}
static File[] getExternalFilesDirs(Context context, String str) {
return context.getExternalFilesDirs(str);
}
static File[] getObbDirs(Context context) {
return context.getObbDirs();
}
}
static class Api21Impl {
private Api21Impl() {
}
static Drawable getDrawable(Context context, int i) {
return context.getDrawable(i);
}
static File getNoBackupFilesDir(Context context) {
return context.getNoBackupFilesDir();
}
static File getCodeCacheDir(Context context) {
return context.getCodeCacheDir();
}
}
static class Api23Impl {
private Api23Impl() {
}
static int getColor(Context context, int i) {
return context.getColor(i);
}
static <T> T getSystemService(Context context, Class<T> cls) {
return (T) context.getSystemService(cls);
}
static String getSystemServiceName(Context context, Class<?> cls) {
return context.getSystemServiceName(cls);
}
}
static class Api24Impl {
private Api24Impl() {
}
static File getDataDir(Context context) {
return context.getDataDir();
}
static Context createDeviceProtectedStorageContext(Context context) {
return context.createDeviceProtectedStorageContext();
}
static boolean isDeviceProtectedStorage(Context context) {
return context.isDeviceProtectedStorage();
}
}
static class Api26Impl {
private Api26Impl() {
}
static Intent registerReceiver(Context context, BroadcastReceiver broadcastReceiver, IntentFilter intentFilter, String str, Handler handler, int i) {
if ((i & 4) != 0 && str == null) {
return context.registerReceiver(broadcastReceiver, intentFilter, ContextCompat.obtainAndCheckReceiverPermission(context), handler);
}
return context.registerReceiver(broadcastReceiver, intentFilter, str, handler, i & 1);
}
static ComponentName startForegroundService(Context context, Intent intent) {
return context.startForegroundService(intent);
}
}
static class Api28Impl {
private Api28Impl() {
}
static Executor getMainExecutor(Context context) {
return context.getMainExecutor();
}
}
static class Api30Impl {
private Api30Impl() {
}
static String getAttributionTag(Context context) {
return context.getAttributionTag();
}
}
static class Api33Impl {
private Api33Impl() {
}
static Intent registerReceiver(Context context, BroadcastReceiver broadcastReceiver, IntentFilter intentFilter, String str, Handler handler, int i) {
return context.registerReceiver(broadcastReceiver, intentFilter, str, handler, i);
}
}
}

View File

@ -0,0 +1,59 @@
package androidx.core.content;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: Context.kt */
@Metadata(d1 = {"\u0000:\n\u0002\b\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0015\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a \u0010\u0000\u001a\u0004\u0018\u0001H\u0001\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0002*\u00020\u0003H\u0086\\u0006\u0002\u0010\u0004\u001aQ\u0010\u0005\u001a\u00020\u0006*\u00020\u00032\n\b\u0002\u0010\u0007\u001a\u0004\u0018\u00010\b2\u0006\u0010\t\u001a\u00020\n2\b\b\u0003\u0010\u000b\u001a\u00020\f2\b\b\u0003\u0010\r\u001a\u00020\f2\u0017\u0010\u000e\u001a\u0013\u0012\u0004\u0012\u00020\u0010\u0012\u0004\u0012\u00020\u00060\u000f¢\u0006\u0002\b\u0011H\u0086\\u0001\u0000\u001a;\u0010\u0005\u001a\u00020\u0006*\u00020\u00032\b\b\u0001\u0010\u0012\u001a\u00020\f2\u0006\u0010\t\u001a\u00020\n2\u0017\u0010\u000e\u001a\u0013\u0012\u0004\u0012\u00020\u0010\u0012\u0004\u0012\u00020\u00060\u000f¢\u0006\u0002\b\u0011H\u0086\\u0001\u0000\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006\u0013"}, d2 = {"getSystemService", "T", "", "Landroid/content/Context;", "(Landroid/content/Context;)Ljava/lang/Object;", "withStyledAttributes", "", "set", "Landroid/util/AttributeSet;", "attrs", "", "defStyleAttr", "", "defStyleRes", "block", "Lkotlin/Function1;", "Landroid/content/res/TypedArray;", "Lkotlin/ExtensionFunctionType;", "resourceId", "core-ktx_release"}, k = 2, mv = {1, 7, 1}, xi = 48)
/* loaded from: classes.dex */
public final class ContextKt {
public static final /* synthetic */ <T> T getSystemService(Context context) {
Intrinsics.checkNotNullParameter(context, "<this>");
Intrinsics.reifiedOperationMarker(4, "T");
return (T) ContextCompat.getSystemService(context, Object.class);
}
public static /* synthetic */ void withStyledAttributes$default(Context context, AttributeSet attributeSet, int[] attrs, int i, int i2, Function1 block, int i3, Object obj) {
if ((i3 & 1) != 0) {
attributeSet = null;
}
if ((i3 & 4) != 0) {
i = 0;
}
if ((i3 & 8) != 0) {
i2 = 0;
}
Intrinsics.checkNotNullParameter(context, "<this>");
Intrinsics.checkNotNullParameter(attrs, "attrs");
Intrinsics.checkNotNullParameter(block, "block");
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, attrs, i, i2);
Intrinsics.checkNotNullExpressionValue(obtainStyledAttributes, "obtainStyledAttributes(s…efStyleAttr, defStyleRes)");
block.invoke(obtainStyledAttributes);
obtainStyledAttributes.recycle();
}
public static final void withStyledAttributes(Context context, AttributeSet attributeSet, int[] attrs, int i, int i2, Function1<? super TypedArray, Unit> block) {
Intrinsics.checkNotNullParameter(context, "<this>");
Intrinsics.checkNotNullParameter(attrs, "attrs");
Intrinsics.checkNotNullParameter(block, "block");
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, attrs, i, i2);
Intrinsics.checkNotNullExpressionValue(obtainStyledAttributes, "obtainStyledAttributes(s…efStyleAttr, defStyleRes)");
block.invoke(obtainStyledAttributes);
obtainStyledAttributes.recycle();
}
public static final void withStyledAttributes(Context context, int i, int[] attrs, Function1<? super TypedArray, Unit> block) {
Intrinsics.checkNotNullParameter(context, "<this>");
Intrinsics.checkNotNullParameter(attrs, "attrs");
Intrinsics.checkNotNullParameter(block, "block");
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(i, attrs);
Intrinsics.checkNotNullExpressionValue(obtainStyledAttributes, "obtainStyledAttributes(resourceId, attrs)");
block.invoke(obtainStyledAttributes);
obtainStyledAttributes.recycle();
}
}

View File

@ -0,0 +1,344 @@
package androidx.core.content;
import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.Context;
import android.content.pm.ProviderInfo;
import android.content.res.XmlResourceParser;
import android.database.Cursor;
import android.database.MatrixCursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.os.ParcelFileDescriptor;
import android.text.TextUtils;
import android.webkit.MimeTypeMap;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.xmlpull.v1.XmlPullParserException;
/* loaded from: classes.dex */
public class FileProvider extends ContentProvider {
private static final String ATTR_NAME = "name";
private static final String ATTR_PATH = "path";
private static final String DISPLAYNAME_FIELD = "displayName";
private static final String META_DATA_FILE_PROVIDER_PATHS = "android.support.FILE_PROVIDER_PATHS";
private static final String TAG_CACHE_PATH = "cache-path";
private static final String TAG_EXTERNAL = "external-path";
private static final String TAG_EXTERNAL_CACHE = "external-cache-path";
private static final String TAG_EXTERNAL_FILES = "external-files-path";
private static final String TAG_EXTERNAL_MEDIA = "external-media-path";
private static final String TAG_FILES_PATH = "files-path";
private static final String TAG_ROOT_PATH = "root-path";
private int mResourceId;
private PathStrategy mStrategy;
private static final String[] COLUMNS = {"_display_name", "_size"};
private static final File DEVICE_ROOT = new File("/");
private static final HashMap<String, PathStrategy> sCache = new HashMap<>();
interface PathStrategy {
File getFileForUri(Uri uri);
Uri getUriForFile(File file);
}
@Override // android.content.ContentProvider
public boolean onCreate() {
return true;
}
public FileProvider() {
this.mResourceId = 0;
}
protected FileProvider(int i) {
this.mResourceId = i;
}
@Override // android.content.ContentProvider
public void attachInfo(Context context, ProviderInfo providerInfo) {
super.attachInfo(context, providerInfo);
if (providerInfo.exported) {
throw new SecurityException("Provider must not be exported");
}
if (!providerInfo.grantUriPermissions) {
throw new SecurityException("Provider must grant uri permissions");
}
String str = providerInfo.authority.split(";")[0];
HashMap<String, PathStrategy> hashMap = sCache;
synchronized (hashMap) {
hashMap.remove(str);
}
this.mStrategy = getPathStrategy(context, str, this.mResourceId);
}
public static Uri getUriForFile(Context context, String str, File file) {
return getPathStrategy(context, str, 0).getUriForFile(file);
}
public static Uri getUriForFile(Context context, String str, File file, String str2) {
return getUriForFile(context, str, file).buildUpon().appendQueryParameter(DISPLAYNAME_FIELD, str2).build();
}
@Override // android.content.ContentProvider
public Cursor query(Uri uri, String[] strArr, String str, String[] strArr2, String str2) {
int i;
File fileForUri = this.mStrategy.getFileForUri(uri);
String queryParameter = uri.getQueryParameter(DISPLAYNAME_FIELD);
if (strArr == null) {
strArr = COLUMNS;
}
String[] strArr3 = new String[strArr.length];
Object[] objArr = new Object[strArr.length];
int i2 = 0;
for (String str3 : strArr) {
if ("_display_name".equals(str3)) {
strArr3[i2] = "_display_name";
i = i2 + 1;
objArr[i2] = queryParameter == null ? fileForUri.getName() : queryParameter;
} else if ("_size".equals(str3)) {
strArr3[i2] = "_size";
i = i2 + 1;
objArr[i2] = Long.valueOf(fileForUri.length());
}
i2 = i;
}
String[] copyOf = copyOf(strArr3, i2);
Object[] copyOf2 = copyOf(objArr, i2);
MatrixCursor matrixCursor = new MatrixCursor(copyOf, 1);
matrixCursor.addRow(copyOf2);
return matrixCursor;
}
@Override // android.content.ContentProvider
public String getType(Uri uri) {
File fileForUri = this.mStrategy.getFileForUri(uri);
int lastIndexOf = fileForUri.getName().lastIndexOf(46);
if (lastIndexOf < 0) {
return "application/octet-stream";
}
String mimeTypeFromExtension = MimeTypeMap.getSingleton().getMimeTypeFromExtension(fileForUri.getName().substring(lastIndexOf + 1));
return mimeTypeFromExtension != null ? mimeTypeFromExtension : "application/octet-stream";
}
@Override // android.content.ContentProvider
public Uri insert(Uri uri, ContentValues contentValues) {
throw new UnsupportedOperationException("No external inserts");
}
@Override // android.content.ContentProvider
public int update(Uri uri, ContentValues contentValues, String str, String[] strArr) {
throw new UnsupportedOperationException("No external updates");
}
@Override // android.content.ContentProvider
public int delete(Uri uri, String str, String[] strArr) {
return this.mStrategy.getFileForUri(uri).delete() ? 1 : 0;
}
@Override // android.content.ContentProvider
public ParcelFileDescriptor openFile(Uri uri, String str) throws FileNotFoundException {
return ParcelFileDescriptor.open(this.mStrategy.getFileForUri(uri), modeToMode(str));
}
private static PathStrategy getPathStrategy(Context context, String str, int i) {
PathStrategy pathStrategy;
HashMap<String, PathStrategy> hashMap = sCache;
synchronized (hashMap) {
pathStrategy = hashMap.get(str);
if (pathStrategy == null) {
try {
try {
pathStrategy = parsePathStrategy(context, str, i);
hashMap.put(str, pathStrategy);
} catch (XmlPullParserException e) {
throw new IllegalArgumentException("Failed to parse android.support.FILE_PROVIDER_PATHS meta-data", e);
}
} catch (IOException e2) {
throw new IllegalArgumentException("Failed to parse android.support.FILE_PROVIDER_PATHS meta-data", e2);
}
}
}
return pathStrategy;
}
static XmlResourceParser getFileProviderPathsMetaData(Context context, String str, ProviderInfo providerInfo, int i) {
if (providerInfo == null) {
throw new IllegalArgumentException("Couldn't find meta-data for provider with authority " + str);
}
if (providerInfo.metaData == null && i != 0) {
providerInfo.metaData = new Bundle(1);
providerInfo.metaData.putInt(META_DATA_FILE_PROVIDER_PATHS, i);
}
XmlResourceParser loadXmlMetaData = providerInfo.loadXmlMetaData(context.getPackageManager(), META_DATA_FILE_PROVIDER_PATHS);
if (loadXmlMetaData != null) {
return loadXmlMetaData;
}
throw new IllegalArgumentException("Missing android.support.FILE_PROVIDER_PATHS meta-data");
}
private static PathStrategy parsePathStrategy(Context context, String str, int i) throws IOException, XmlPullParserException {
SimplePathStrategy simplePathStrategy = new SimplePathStrategy(str);
XmlResourceParser fileProviderPathsMetaData = getFileProviderPathsMetaData(context, str, context.getPackageManager().resolveContentProvider(str, 128), i);
while (true) {
int next = fileProviderPathsMetaData.next();
if (next == 1) {
return simplePathStrategy;
}
if (next == 2) {
String name = fileProviderPathsMetaData.getName();
File file = null;
String attributeValue = fileProviderPathsMetaData.getAttributeValue(null, ATTR_NAME);
String attributeValue2 = fileProviderPathsMetaData.getAttributeValue(null, ATTR_PATH);
if (TAG_ROOT_PATH.equals(name)) {
file = DEVICE_ROOT;
} else if (TAG_FILES_PATH.equals(name)) {
file = context.getFilesDir();
} else if (TAG_CACHE_PATH.equals(name)) {
file = context.getCacheDir();
} else if (TAG_EXTERNAL.equals(name)) {
file = Environment.getExternalStorageDirectory();
} else if (TAG_EXTERNAL_FILES.equals(name)) {
File[] externalFilesDirs = ContextCompat.getExternalFilesDirs(context, null);
if (externalFilesDirs.length > 0) {
file = externalFilesDirs[0];
}
} else if (TAG_EXTERNAL_CACHE.equals(name)) {
File[] externalCacheDirs = ContextCompat.getExternalCacheDirs(context);
if (externalCacheDirs.length > 0) {
file = externalCacheDirs[0];
}
} else if (TAG_EXTERNAL_MEDIA.equals(name)) {
File[] externalMediaDirs = Api21Impl.getExternalMediaDirs(context);
if (externalMediaDirs.length > 0) {
file = externalMediaDirs[0];
}
}
if (file != null) {
simplePathStrategy.addRoot(attributeValue, buildPath(file, attributeValue2));
}
}
}
}
static class SimplePathStrategy implements PathStrategy {
private final String mAuthority;
private final HashMap<String, File> mRoots = new HashMap<>();
SimplePathStrategy(String str) {
this.mAuthority = str;
}
void addRoot(String str, File file) {
if (TextUtils.isEmpty(str)) {
throw new IllegalArgumentException("Name must not be empty");
}
try {
this.mRoots.put(str, file.getCanonicalFile());
} catch (IOException e) {
throw new IllegalArgumentException("Failed to resolve canonical path for " + file, e);
}
}
@Override // androidx.core.content.FileProvider.PathStrategy
public Uri getUriForFile(File file) {
String substring;
try {
String canonicalPath = file.getCanonicalPath();
Map.Entry<String, File> entry = null;
for (Map.Entry<String, File> entry2 : this.mRoots.entrySet()) {
String path = entry2.getValue().getPath();
if (canonicalPath.startsWith(path) && (entry == null || path.length() > entry.getValue().getPath().length())) {
entry = entry2;
}
}
if (entry == null) {
throw new IllegalArgumentException("Failed to find configured root that contains " + canonicalPath);
}
String path2 = entry.getValue().getPath();
if (path2.endsWith("/")) {
substring = canonicalPath.substring(path2.length());
} else {
substring = canonicalPath.substring(path2.length() + 1);
}
return new Uri.Builder().scheme("content").authority(this.mAuthority).encodedPath(Uri.encode(entry.getKey()) + '/' + Uri.encode(substring, "/")).build();
} catch (IOException unused) {
throw new IllegalArgumentException("Failed to resolve canonical path for " + file);
}
}
@Override // androidx.core.content.FileProvider.PathStrategy
public File getFileForUri(Uri uri) {
String encodedPath = uri.getEncodedPath();
int indexOf = encodedPath.indexOf(47, 1);
String decode = Uri.decode(encodedPath.substring(1, indexOf));
String decode2 = Uri.decode(encodedPath.substring(indexOf + 1));
File file = this.mRoots.get(decode);
if (file == null) {
throw new IllegalArgumentException("Unable to find configured root for " + uri);
}
File file2 = new File(file, decode2);
try {
File canonicalFile = file2.getCanonicalFile();
if (canonicalFile.getPath().startsWith(file.getPath())) {
return canonicalFile;
}
throw new SecurityException("Resolved path jumped beyond configured root");
} catch (IOException unused) {
throw new IllegalArgumentException("Failed to resolve canonical path for " + file2);
}
}
}
private static int modeToMode(String str) {
if ("r".equals(str)) {
return 268435456;
}
if ("w".equals(str) || "wt".equals(str)) {
return 738197504;
}
if ("wa".equals(str)) {
return 704643072;
}
if ("rw".equals(str)) {
return 939524096;
}
if ("rwt".equals(str)) {
return 1006632960;
}
throw new IllegalArgumentException("Invalid mode: " + str);
}
private static File buildPath(File file, String... strArr) {
for (String str : strArr) {
if (str != null) {
file = new File(file, str);
}
}
return file;
}
private static String[] copyOf(String[] strArr, int i) {
String[] strArr2 = new String[i];
System.arraycopy(strArr, 0, strArr2, 0, i);
return strArr2;
}
private static Object[] copyOf(Object[] objArr, int i) {
Object[] objArr2 = new Object[i];
System.arraycopy(objArr, 0, objArr2, 0, i);
return objArr2;
}
static class Api21Impl {
private Api21Impl() {
}
static File[] getExternalMediaDirs(Context context) {
return context.getExternalMediaDirs();
}
}
}

View File

@ -0,0 +1,43 @@
package androidx.core.content;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import androidx.core.util.Preconditions;
/* loaded from: classes.dex */
public final class IntentCompat {
public static final String ACTION_CREATE_REMINDER = "android.intent.action.CREATE_REMINDER";
public static final String CATEGORY_LEANBACK_LAUNCHER = "android.intent.category.LEANBACK_LAUNCHER";
public static final String EXTRA_HTML_TEXT = "android.intent.extra.HTML_TEXT";
public static final String EXTRA_START_PLAYBACK = "android.intent.extra.START_PLAYBACK";
public static final String EXTRA_TIME = "android.intent.extra.TIME";
private IntentCompat() {
}
public static Intent makeMainSelectorActivity(String str, String str2) {
return Api15Impl.makeMainSelectorActivity(str, str2);
}
public static Intent createManageUnusedAppRestrictionsIntent(Context context, String str) {
if (!PackageManagerCompat.areUnusedAppRestrictionsAvailable(context.getPackageManager())) {
throw new UnsupportedOperationException("Unused App Restriction features are not available on this device");
}
if (Build.VERSION.SDK_INT >= 31) {
return new Intent("android.settings.APPLICATION_DETAILS_SETTINGS").setData(Uri.fromParts("package", str, null));
}
Intent data = new Intent(PackageManagerCompat.ACTION_PERMISSION_REVOCATION_SETTINGS).setData(Uri.fromParts("package", str, null));
return Build.VERSION.SDK_INT >= 30 ? data : data.setPackage((String) Preconditions.checkNotNull(PackageManagerCompat.getPermissionRevocationVerifierApp(context.getPackageManager())));
}
static class Api15Impl {
private Api15Impl() {
}
static Intent makeMainSelectorActivity(String str, String str2) {
return Intent.makeMainSelectorActivity(str, str2);
}
}
}

View File

@ -0,0 +1,29 @@
package androidx.core.content;
import androidx.core.util.Predicate;
/* compiled from: D8$$SyntheticClass */
/* loaded from: classes.dex */
public final /* synthetic */ class IntentSanitizer$Builder$$ExternalSyntheticLambda2 implements Predicate {
public final /* synthetic */ String f$0;
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate) {
return Predicate.CC.$default$and(this, predicate);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate) {
return Predicate.CC.$default$or(this, predicate);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
return this.f$0.equals((String) obj);
}
}

View File

@ -0,0 +1,986 @@
package androidx.core.content;
import android.content.ClipData;
import android.content.ComponentName;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.view.textclassifier.TextLinks;
import androidx.core.content.IntentSanitizer;
import androidx.core.util.Consumer;
import androidx.core.util.Preconditions;
import androidx.core.util.Predicate;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
/* loaded from: classes.dex */
public class IntentSanitizer {
private static final String TAG = "IntentSanitizer";
private boolean mAllowAnyComponent;
private boolean mAllowClipDataText;
private boolean mAllowIdentifier;
private boolean mAllowSelector;
private boolean mAllowSourceBounds;
private Predicate<String> mAllowedActions;
private Predicate<String> mAllowedCategories;
private Predicate<ClipData> mAllowedClipData;
private Predicate<Uri> mAllowedClipDataUri;
private Predicate<ComponentName> mAllowedComponents;
private Predicate<Uri> mAllowedData;
private Map<String, Predicate<Object>> mAllowedExtras;
private int mAllowedFlags;
private Predicate<String> mAllowedPackages;
private Predicate<String> mAllowedTypes;
static /* synthetic */ void lambda$sanitizeByFiltering$0(String str) {
}
private IntentSanitizer() {
}
public Intent sanitizeByFiltering(Intent intent) {
return sanitize(intent, new Consumer() { // from class: androidx.core.content.IntentSanitizer$$ExternalSyntheticLambda0
@Override // androidx.core.util.Consumer
public final void accept(Object obj) {
IntentSanitizer.lambda$sanitizeByFiltering$0((String) obj);
}
});
}
public Intent sanitizeByThrowing(Intent intent) {
return sanitize(intent, new Consumer() { // from class: androidx.core.content.IntentSanitizer$$ExternalSyntheticLambda1
@Override // androidx.core.util.Consumer
public final void accept(Object obj) {
IntentSanitizer.lambda$sanitizeByThrowing$1((String) obj);
}
});
}
static /* synthetic */ void lambda$sanitizeByThrowing$1(String str) {
throw new SecurityException(str);
}
public Intent sanitize(Intent intent, Consumer<String> consumer) {
Intent intent2 = new Intent();
ComponentName component = intent.getComponent();
if ((this.mAllowAnyComponent && component == null) || this.mAllowedComponents.test(component)) {
intent2.setComponent(component);
} else {
consumer.accept("Component is not allowed: " + component);
intent2.setComponent(new ComponentName("android", "java.lang.Void"));
}
String str = intent.getPackage();
if (str == null || this.mAllowedPackages.test(str)) {
intent2.setPackage(str);
} else {
consumer.accept("Package is not allowed: " + str);
}
int flags = this.mAllowedFlags | intent.getFlags();
int i = this.mAllowedFlags;
if (flags == i) {
intent2.setFlags(intent.getFlags());
} else {
intent2.setFlags(intent.getFlags() & i);
consumer.accept("The intent contains flags that are not allowed: 0x" + Integer.toHexString(intent.getFlags() & (~this.mAllowedFlags)));
}
String action = intent.getAction();
if (action == null || this.mAllowedActions.test(action)) {
intent2.setAction(action);
} else {
consumer.accept("Action is not allowed: " + action);
}
Uri data = intent.getData();
if (data == null || this.mAllowedData.test(data)) {
intent2.setData(data);
} else {
consumer.accept("Data is not allowed: " + data);
}
String type = intent.getType();
if (type == null || this.mAllowedTypes.test(type)) {
intent2.setDataAndType(intent2.getData(), type);
} else {
consumer.accept("Type is not allowed: " + type);
}
Set<String> categories = intent.getCategories();
if (categories != null) {
for (String str2 : categories) {
if (this.mAllowedCategories.test(str2)) {
intent2.addCategory(str2);
} else {
consumer.accept("Category is not allowed: " + str2);
}
}
}
Bundle extras = intent.getExtras();
if (extras != null) {
for (String str3 : extras.keySet()) {
if (str3.equals("android.intent.extra.STREAM") && (this.mAllowedFlags & 1) == 0) {
consumer.accept("Allowing Extra Stream requires also allowing at least FLAG_GRANT_READ_URI_PERMISSION Flag.");
} else if (str3.equals("output") && ((~this.mAllowedFlags) & 3) != 0) {
consumer.accept("Allowing Extra Output requires also allowing FLAG_GRANT_READ_URI_PERMISSION and FLAG_GRANT_WRITE_URI_PERMISSION Flags.");
} else {
Object obj = extras.get(str3);
Predicate<Object> predicate = this.mAllowedExtras.get(str3);
if (predicate != null && predicate.test(obj)) {
putExtra(intent2, str3, obj);
} else {
consumer.accept("Extra is not allowed. Key: " + str3 + ". Value: " + obj);
}
}
}
}
Api16Impl.sanitizeClipData(intent, intent2, this.mAllowedClipData, this.mAllowClipDataText, this.mAllowedClipDataUri, consumer);
if (Build.VERSION.SDK_INT >= 29) {
if (this.mAllowIdentifier) {
Api29Impl.setIdentifier(intent2, Api29Impl.getIdentifier(intent));
} else if (Api29Impl.getIdentifier(intent) != null) {
consumer.accept("Identifier is not allowed: " + Api29Impl.getIdentifier(intent));
}
}
if (this.mAllowSelector) {
Api15Impl.setSelector(intent2, Api15Impl.getSelector(intent));
} else if (Api15Impl.getSelector(intent) != null) {
consumer.accept("Selector is not allowed: " + Api15Impl.getSelector(intent));
}
if (this.mAllowSourceBounds) {
intent2.setSourceBounds(intent.getSourceBounds());
} else if (intent.getSourceBounds() != null) {
consumer.accept("SourceBounds is not allowed: " + intent.getSourceBounds());
}
return intent2;
}
private void putExtra(Intent intent, String str, Object obj) {
if (obj == null) {
intent.getExtras().putString(str, null);
return;
}
if (obj instanceof Parcelable) {
intent.putExtra(str, (Parcelable) obj);
return;
}
if (obj instanceof Parcelable[]) {
intent.putExtra(str, (Parcelable[]) obj);
} else if (obj instanceof Serializable) {
intent.putExtra(str, (Serializable) obj);
} else {
throw new IllegalArgumentException("Unsupported type " + obj.getClass());
}
}
public static final class Builder {
private static final int HISTORY_STACK_FLAGS = 2112614400;
private static final int RECEIVER_FLAGS = 2015363072;
private boolean mAllowAnyComponent;
private boolean mAllowIdentifier;
private boolean mAllowSelector;
private boolean mAllowSomeComponents;
private boolean mAllowSourceBounds;
private int mAllowedFlags;
private Predicate<String> mAllowedActions = new Predicate() { // from class: androidx.core.content.IntentSanitizer$Builder$$ExternalSyntheticLambda11
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate) {
return Predicate.CC.$default$and(this, predicate);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate) {
return Predicate.CC.$default$or(this, predicate);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
return IntentSanitizer.Builder.lambda$new$0((String) obj);
}
};
private Predicate<Uri> mAllowedData = new Predicate() { // from class: androidx.core.content.IntentSanitizer$Builder$$ExternalSyntheticLambda12
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate) {
return Predicate.CC.$default$and(this, predicate);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate) {
return Predicate.CC.$default$or(this, predicate);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
return IntentSanitizer.Builder.lambda$new$1((Uri) obj);
}
};
private Predicate<String> mAllowedTypes = new Predicate() { // from class: androidx.core.content.IntentSanitizer$Builder$$ExternalSyntheticLambda13
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate) {
return Predicate.CC.$default$and(this, predicate);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate) {
return Predicate.CC.$default$or(this, predicate);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
return IntentSanitizer.Builder.lambda$new$2((String) obj);
}
};
private Predicate<String> mAllowedCategories = new Predicate() { // from class: androidx.core.content.IntentSanitizer$Builder$$ExternalSyntheticLambda14
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate) {
return Predicate.CC.$default$and(this, predicate);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate) {
return Predicate.CC.$default$or(this, predicate);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
return IntentSanitizer.Builder.lambda$new$3((String) obj);
}
};
private Predicate<String> mAllowedPackages = new Predicate() { // from class: androidx.core.content.IntentSanitizer$Builder$$ExternalSyntheticLambda15
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate) {
return Predicate.CC.$default$and(this, predicate);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate) {
return Predicate.CC.$default$or(this, predicate);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
return IntentSanitizer.Builder.lambda$new$4((String) obj);
}
};
private Predicate<ComponentName> mAllowedComponents = new Predicate() { // from class: androidx.core.content.IntentSanitizer$Builder$$ExternalSyntheticLambda16
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate) {
return Predicate.CC.$default$and(this, predicate);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate) {
return Predicate.CC.$default$or(this, predicate);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
return IntentSanitizer.Builder.lambda$new$5((ComponentName) obj);
}
};
private Map<String, Predicate<Object>> mAllowedExtras = new HashMap();
private boolean mAllowClipDataText = false;
private Predicate<Uri> mAllowedClipDataUri = new Predicate() { // from class: androidx.core.content.IntentSanitizer$Builder$$ExternalSyntheticLambda17
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate) {
return Predicate.CC.$default$and(this, predicate);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate) {
return Predicate.CC.$default$or(this, predicate);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
return IntentSanitizer.Builder.lambda$new$6((Uri) obj);
}
};
private Predicate<ClipData> mAllowedClipData = new Predicate() { // from class: androidx.core.content.IntentSanitizer$Builder$$ExternalSyntheticLambda18
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate) {
return Predicate.CC.$default$and(this, predicate);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate) {
return Predicate.CC.$default$or(this, predicate);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
return IntentSanitizer.Builder.lambda$new$7((ClipData) obj);
}
};
static /* synthetic */ boolean lambda$allowAnyComponent$10(ComponentName componentName) {
return true;
}
static /* synthetic */ boolean lambda$allowExtra$12(Object obj) {
return true;
}
static /* synthetic */ boolean lambda$allowExtra$14(Object obj) {
return false;
}
static /* synthetic */ boolean lambda$new$0(String str) {
return false;
}
static /* synthetic */ boolean lambda$new$1(Uri uri) {
return false;
}
static /* synthetic */ boolean lambda$new$2(String str) {
return false;
}
static /* synthetic */ boolean lambda$new$3(String str) {
return false;
}
static /* synthetic */ boolean lambda$new$4(String str) {
return false;
}
static /* synthetic */ boolean lambda$new$5(ComponentName componentName) {
return false;
}
static /* synthetic */ boolean lambda$new$6(Uri uri) {
return false;
}
static /* synthetic */ boolean lambda$new$7(ClipData clipData) {
return false;
}
public Builder allowClipDataText() {
this.mAllowClipDataText = true;
return this;
}
public Builder allowFlags(int i) {
this.mAllowedFlags = i | this.mAllowedFlags;
return this;
}
public Builder allowHistoryStackFlags() {
this.mAllowedFlags |= HISTORY_STACK_FLAGS;
return this;
}
public Builder allowIdentifier() {
this.mAllowIdentifier = true;
return this;
}
public Builder allowReceiverFlags() {
this.mAllowedFlags |= RECEIVER_FLAGS;
return this;
}
public Builder allowSelector() {
this.mAllowSelector = true;
return this;
}
public Builder allowSourceBounds() {
this.mAllowSourceBounds = true;
return this;
}
public Builder allowAction(String str) {
Preconditions.checkNotNull(str);
Objects.requireNonNull(str);
allowAction(new IntentSanitizer$Builder$$ExternalSyntheticLambda2(str));
return this;
}
public Builder allowAction(Predicate<String> predicate) {
Preconditions.checkNotNull(predicate);
this.mAllowedActions = this.mAllowedActions.or(predicate);
return this;
}
public Builder allowDataWithAuthority(final String str) {
Preconditions.checkNotNull(str);
allowData(new Predicate() { // from class: androidx.core.content.IntentSanitizer$Builder$$ExternalSyntheticLambda7
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate) {
return Predicate.CC.$default$and(this, predicate);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate) {
return Predicate.CC.$default$or(this, predicate);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
boolean equals;
equals = str.equals(((Uri) obj).getAuthority());
return equals;
}
});
return this;
}
public Builder allowData(Predicate<Uri> predicate) {
Preconditions.checkNotNull(predicate);
this.mAllowedData = this.mAllowedData.or(predicate);
return this;
}
public Builder allowType(String str) {
Preconditions.checkNotNull(str);
Objects.requireNonNull(str);
return allowType(new IntentSanitizer$Builder$$ExternalSyntheticLambda2(str));
}
public Builder allowType(Predicate<String> predicate) {
Preconditions.checkNotNull(predicate);
this.mAllowedTypes = this.mAllowedTypes.or(predicate);
return this;
}
public Builder allowCategory(String str) {
Preconditions.checkNotNull(str);
Objects.requireNonNull(str);
return allowCategory(new IntentSanitizer$Builder$$ExternalSyntheticLambda2(str));
}
public Builder allowCategory(Predicate<String> predicate) {
Preconditions.checkNotNull(predicate);
this.mAllowedCategories = this.mAllowedCategories.or(predicate);
return this;
}
public Builder allowPackage(String str) {
Preconditions.checkNotNull(str);
Objects.requireNonNull(str);
return allowPackage(new IntentSanitizer$Builder$$ExternalSyntheticLambda2(str));
}
public Builder allowPackage(Predicate<String> predicate) {
Preconditions.checkNotNull(predicate);
this.mAllowedPackages = this.mAllowedPackages.or(predicate);
return this;
}
public Builder allowComponent(final ComponentName componentName) {
Preconditions.checkNotNull(componentName);
Objects.requireNonNull(componentName);
return allowComponent(new Predicate() { // from class: androidx.core.content.IntentSanitizer$Builder$$ExternalSyntheticLambda9
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate) {
return Predicate.CC.$default$and(this, predicate);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate) {
return Predicate.CC.$default$or(this, predicate);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
return componentName.equals((ComponentName) obj);
}
});
}
public Builder allowComponent(Predicate<ComponentName> predicate) {
Preconditions.checkNotNull(predicate);
this.mAllowSomeComponents = true;
this.mAllowedComponents = this.mAllowedComponents.or(predicate);
return this;
}
public Builder allowComponentWithPackage(final String str) {
Preconditions.checkNotNull(str);
return allowComponent(new Predicate() { // from class: androidx.core.content.IntentSanitizer$Builder$$ExternalSyntheticLambda6
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate) {
return Predicate.CC.$default$and(this, predicate);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate) {
return Predicate.CC.$default$or(this, predicate);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
boolean equals;
equals = str.equals(((ComponentName) obj).getPackageName());
return equals;
}
});
}
public Builder allowAnyComponent() {
this.mAllowAnyComponent = true;
this.mAllowedComponents = new Predicate() { // from class: androidx.core.content.IntentSanitizer$Builder$$ExternalSyntheticLambda4
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate) {
return Predicate.CC.$default$and(this, predicate);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate) {
return Predicate.CC.$default$or(this, predicate);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
return IntentSanitizer.Builder.lambda$allowAnyComponent$10((ComponentName) obj);
}
};
return this;
}
public Builder allowClipDataUriWithAuthority(final String str) {
Preconditions.checkNotNull(str);
return allowClipDataUri(new Predicate() { // from class: androidx.core.content.IntentSanitizer$Builder$$ExternalSyntheticLambda1
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate) {
return Predicate.CC.$default$and(this, predicate);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate) {
return Predicate.CC.$default$or(this, predicate);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
boolean equals;
equals = str.equals(((Uri) obj).getAuthority());
return equals;
}
});
}
public Builder allowClipDataUri(Predicate<Uri> predicate) {
Preconditions.checkNotNull(predicate);
this.mAllowedClipDataUri = this.mAllowedClipDataUri.or(predicate);
return this;
}
public Builder allowClipData(Predicate<ClipData> predicate) {
Preconditions.checkNotNull(predicate);
this.mAllowedClipData = this.mAllowedClipData.or(predicate);
return this;
}
public Builder allowExtra(String str, Class<?> cls) {
return allowExtra(str, cls, new Predicate() { // from class: androidx.core.content.IntentSanitizer$Builder$$ExternalSyntheticLambda10
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate) {
return Predicate.CC.$default$and(this, predicate);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate) {
return Predicate.CC.$default$or(this, predicate);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
return IntentSanitizer.Builder.lambda$allowExtra$12(obj);
}
});
}
public <T> Builder allowExtra(String str, final Class<T> cls, final Predicate<T> predicate) {
Preconditions.checkNotNull(str);
Preconditions.checkNotNull(cls);
Preconditions.checkNotNull(predicate);
return allowExtra(str, new Predicate() { // from class: androidx.core.content.IntentSanitizer$Builder$$ExternalSyntheticLambda5
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate2) {
return Predicate.CC.$default$and(this, predicate2);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate2) {
return Predicate.CC.$default$or(this, predicate2);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
return IntentSanitizer.Builder.lambda$allowExtra$13(cls, predicate, obj);
}
});
}
static /* synthetic */ boolean lambda$allowExtra$13(Class cls, Predicate predicate, Object obj) {
return cls.isInstance(obj) && predicate.test(cls.cast(obj));
}
public Builder allowExtra(String str, Predicate<Object> predicate) {
Preconditions.checkNotNull(str);
Preconditions.checkNotNull(predicate);
Predicate<Object> predicate2 = this.mAllowedExtras.get(str);
if (predicate2 == null) {
predicate2 = new Predicate() { // from class: androidx.core.content.IntentSanitizer$Builder$$ExternalSyntheticLambda0
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate3) {
return Predicate.CC.$default$and(this, predicate3);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate3) {
return Predicate.CC.$default$or(this, predicate3);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
return IntentSanitizer.Builder.lambda$allowExtra$14(obj);
}
};
}
this.mAllowedExtras.put(str, predicate2.or(predicate));
return this;
}
public Builder allowExtraStreamUriWithAuthority(final String str) {
Preconditions.checkNotNull(str);
allowExtra("android.intent.extra.STREAM", Uri.class, new Predicate() { // from class: androidx.core.content.IntentSanitizer$Builder$$ExternalSyntheticLambda3
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate) {
return Predicate.CC.$default$and(this, predicate);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate) {
return Predicate.CC.$default$or(this, predicate);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
boolean equals;
equals = str.equals(((Uri) obj).getAuthority());
return equals;
}
});
return this;
}
public Builder allowExtraStream(Predicate<Uri> predicate) {
allowExtra("android.intent.extra.STREAM", Uri.class, predicate);
return this;
}
public Builder allowExtraOutput(final String str) {
allowExtra("output", Uri.class, new Predicate() { // from class: androidx.core.content.IntentSanitizer$Builder$$ExternalSyntheticLambda8
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate) {
return Predicate.CC.$default$and(this, predicate);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate) {
return Predicate.CC.$default$or(this, predicate);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
boolean equals;
equals = str.equals(((Uri) obj).getAuthority());
return equals;
}
});
return this;
}
public Builder allowExtraOutput(Predicate<Uri> predicate) {
allowExtra("output", Uri.class, predicate);
return this;
}
public IntentSanitizer build() {
boolean z = this.mAllowAnyComponent;
if ((z && this.mAllowSomeComponents) || (!z && !this.mAllowSomeComponents)) {
throw new SecurityException("You must call either allowAnyComponent or one or more of the allowComponent methods; but not both.");
}
IntentSanitizer intentSanitizer = new IntentSanitizer();
intentSanitizer.mAllowedFlags = this.mAllowedFlags;
intentSanitizer.mAllowedActions = this.mAllowedActions;
intentSanitizer.mAllowedData = this.mAllowedData;
intentSanitizer.mAllowedTypes = this.mAllowedTypes;
intentSanitizer.mAllowedCategories = this.mAllowedCategories;
intentSanitizer.mAllowedPackages = this.mAllowedPackages;
intentSanitizer.mAllowAnyComponent = this.mAllowAnyComponent;
intentSanitizer.mAllowedComponents = this.mAllowedComponents;
intentSanitizer.mAllowedExtras = this.mAllowedExtras;
intentSanitizer.mAllowClipDataText = this.mAllowClipDataText;
intentSanitizer.mAllowedClipDataUri = this.mAllowedClipDataUri;
intentSanitizer.mAllowedClipData = this.mAllowedClipData;
intentSanitizer.mAllowIdentifier = this.mAllowIdentifier;
intentSanitizer.mAllowSelector = this.mAllowSelector;
intentSanitizer.mAllowSourceBounds = this.mAllowSourceBounds;
return intentSanitizer;
}
}
private static class Api15Impl {
private Api15Impl() {
}
static void setSelector(Intent intent, Intent intent2) {
intent.setSelector(intent2);
}
static Intent getSelector(Intent intent) {
return intent.getSelector();
}
}
private static class Api16Impl {
private Api16Impl() {
}
/* JADX WARN: Removed duplicated region for block: B:29:0x00b5 */
/* JADX WARN: Removed duplicated region for block: B:31:0x00c4 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
static void sanitizeClipData(android.content.Intent r7, android.content.Intent r8, androidx.core.util.Predicate<android.content.ClipData> r9, boolean r10, androidx.core.util.Predicate<android.net.Uri> r11, androidx.core.util.Consumer<java.lang.String> r12) {
/*
android.content.ClipData r7 = r7.getClipData()
if (r7 != 0) goto L7
return
L7:
if (r9 == 0) goto L14
boolean r9 = r9.test(r7)
if (r9 == 0) goto L14
r8.setClipData(r7)
goto Ld5
L14:
r9 = 0
r0 = 0
r1 = r9
L17:
int r2 = r7.getItemCount()
if (r0 >= r2) goto Ld0
android.content.ClipData$Item r2 = r7.getItemAt(r0)
int r3 = android.os.Build.VERSION.SDK_INT
r4 = 31
if (r3 < r4) goto L2b
androidx.core.content.IntentSanitizer.Api16Impl.Api31Impl.checkOtherMembers(r0, r2, r12)
goto L2e
L2b:
checkOtherMembers(r0, r2, r12)
L2e:
if (r10 == 0) goto L35
java.lang.CharSequence r3 = r2.getText()
goto L59
L35:
java.lang.CharSequence r3 = r2.getText()
if (r3 == 0) goto L58
java.lang.StringBuilder r3 = new java.lang.StringBuilder
java.lang.String r4 = "Item text cannot contain value. Item position: "
r3.<init>(r4)
r3.append(r0)
java.lang.String r4 = ". Text: "
r3.append(r4)
java.lang.CharSequence r4 = r2.getText()
r3.append(r4)
java.lang.String r3 = r3.toString()
r12.accept(r3)
L58:
r3 = r9
L59:
java.lang.String r4 = ". URI: "
java.lang.String r5 = "Item URI is not allowed. Item position: "
if (r11 != 0) goto L7f
android.net.Uri r6 = r2.getUri()
if (r6 == 0) goto La9
java.lang.StringBuilder r6 = new java.lang.StringBuilder
r6.<init>(r5)
r6.append(r0)
r6.append(r4)
android.net.Uri r2 = r2.getUri()
r6.append(r2)
java.lang.String r2 = r6.toString()
r12.accept(r2)
goto La9
L7f:
android.net.Uri r6 = r2.getUri()
if (r6 == 0) goto Lab
android.net.Uri r6 = r2.getUri()
boolean r6 = r11.test(r6)
if (r6 == 0) goto L90
goto Lab
L90:
java.lang.StringBuilder r6 = new java.lang.StringBuilder
r6.<init>(r5)
r6.append(r0)
r6.append(r4)
android.net.Uri r2 = r2.getUri()
r6.append(r2)
java.lang.String r2 = r6.toString()
r12.accept(r2)
La9:
r2 = r9
goto Laf
Lab:
android.net.Uri r2 = r2.getUri()
Laf:
if (r3 != 0) goto Lb3
if (r2 == 0) goto Lcc
Lb3:
if (r1 != 0) goto Lc4
android.content.ClipData r1 = new android.content.ClipData
android.content.ClipDescription r4 = r7.getDescription()
android.content.ClipData$Item r5 = new android.content.ClipData$Item
r5.<init>(r3, r9, r2)
r1.<init>(r4, r5)
goto Lcc
Lc4:
android.content.ClipData$Item r4 = new android.content.ClipData$Item
r4.<init>(r3, r9, r2)
r1.addItem(r4)
Lcc:
int r0 = r0 + 1
goto L17
Ld0:
if (r1 == 0) goto Ld5
r8.setClipData(r1)
Ld5:
return
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.core.content.IntentSanitizer.Api16Impl.sanitizeClipData(android.content.Intent, android.content.Intent, androidx.core.util.Predicate, boolean, androidx.core.util.Predicate, androidx.core.util.Consumer):void");
}
private static void checkOtherMembers(int i, ClipData.Item item, Consumer<String> consumer) {
if (item.getHtmlText() == null && item.getIntent() == null) {
return;
}
consumer.accept("ClipData item at position " + i + " contains htmlText, textLinks or intent: " + item);
}
private static class Api31Impl {
private Api31Impl() {
}
static void checkOtherMembers(int i, ClipData.Item item, Consumer<String> consumer) {
TextLinks textLinks;
if (item.getHtmlText() == null && item.getIntent() == null) {
textLinks = item.getTextLinks();
if (textLinks == null) {
return;
}
}
consumer.accept("ClipData item at position " + i + " contains htmlText, textLinks or intent: " + item);
}
}
}
private static class Api29Impl {
private Api29Impl() {
}
static Intent setIdentifier(Intent intent, String str) {
return intent.setIdentifier(str);
}
static String getIdentifier(Intent intent) {
return intent.getIdentifier();
}
}
}

View File

@ -0,0 +1,74 @@
package androidx.core.content;
import android.content.LocusId;
import android.os.Build;
import androidx.core.util.Preconditions;
/* loaded from: classes.dex */
public final class LocusIdCompat {
private final String mId;
private final LocusId mWrapped;
public String getId() {
return this.mId;
}
public LocusId toLocusId() {
return this.mWrapped;
}
public LocusIdCompat(String str) {
this.mId = (String) Preconditions.checkStringNotEmpty(str, "id cannot be empty");
if (Build.VERSION.SDK_INT >= 29) {
this.mWrapped = Api29Impl.create(str);
} else {
this.mWrapped = null;
}
}
public int hashCode() {
String str = this.mId;
return 31 + (str == null ? 0 : str.hashCode());
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
LocusIdCompat locusIdCompat = (LocusIdCompat) obj;
String str = this.mId;
if (str == null) {
return locusIdCompat.mId == null;
}
return str.equals(locusIdCompat.mId);
}
public String toString() {
return "LocusIdCompat[" + getSanitizedId() + "]";
}
public static LocusIdCompat toLocusIdCompat(LocusId locusId) {
Preconditions.checkNotNull(locusId, "locusId cannot be null");
return new LocusIdCompat((String) Preconditions.checkStringNotEmpty(Api29Impl.getId(locusId), "id cannot be empty"));
}
private String getSanitizedId() {
return this.mId.length() + "_chars";
}
private static class Api29Impl {
private Api29Impl() {
}
static LocusId create(String str) {
return new LocusId(str);
}
static String getId(LocusId locusId) {
return locusId.getId();
}
}
}

View File

@ -0,0 +1,72 @@
package androidx.core.content;
import java.util.ArrayList;
/* loaded from: classes.dex */
public final class MimeTypeFilter {
private MimeTypeFilter() {
}
private static boolean mimeTypeAgainstFilter(String[] strArr, String[] strArr2) {
if (strArr2.length != 2) {
throw new IllegalArgumentException("Ill-formatted MIME type filter. Must be type/subtype.");
}
if (strArr2[0].isEmpty() || strArr2[1].isEmpty()) {
throw new IllegalArgumentException("Ill-formatted MIME type filter. Type or subtype empty.");
}
if (strArr.length != 2) {
return false;
}
if ("*".equals(strArr2[0]) || strArr2[0].equals(strArr[0])) {
return "*".equals(strArr2[1]) || strArr2[1].equals(strArr[1]);
}
return false;
}
public static boolean matches(String str, String str2) {
if (str == null) {
return false;
}
return mimeTypeAgainstFilter(str.split("/"), str2.split("/"));
}
public static String matches(String str, String[] strArr) {
if (str == null) {
return null;
}
String[] split = str.split("/");
for (String str2 : strArr) {
if (mimeTypeAgainstFilter(split, str2.split("/"))) {
return str2;
}
}
return null;
}
public static String matches(String[] strArr, String str) {
if (strArr == null) {
return null;
}
String[] split = str.split("/");
for (String str2 : strArr) {
if (mimeTypeAgainstFilter(str2.split("/"), split)) {
return str2;
}
}
return null;
}
public static String[] matchesMany(String[] strArr, String str) {
if (strArr == null) {
return new String[0];
}
ArrayList arrayList = new ArrayList();
String[] split = str.split("/");
for (String str2 : strArr) {
if (mimeTypeAgainstFilter(str2.split("/"), split)) {
arrayList.add(str2);
}
}
return (String[]) arrayList.toArray(new String[arrayList.size()]);
}
}

View File

@ -0,0 +1,11 @@
package androidx.core.content;
import android.content.res.Configuration;
import androidx.core.util.Consumer;
/* loaded from: classes.dex */
public interface OnConfigurationChangedProvider {
void addOnConfigurationChangedListener(Consumer<Configuration> consumer);
void removeOnConfigurationChangedListener(Consumer<Configuration> consumer);
}

View File

@ -0,0 +1,10 @@
package androidx.core.content;
import androidx.core.util.Consumer;
/* loaded from: classes.dex */
public interface OnTrimMemoryProvider {
void addOnTrimMemoryListener(Consumer<Integer> consumer);
void removeOnTrimMemoryListener(Consumer<Integer> consumer);
}

View File

@ -0,0 +1,103 @@
package androidx.core.content;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Build;
import android.util.Log;
import androidx.concurrent.futures.ResolvableFuture;
import androidx.core.os.UserManagerCompat;
import com.google.common.util.concurrent.ListenableFuture;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Iterator;
import java.util.concurrent.Executors;
/* loaded from: classes.dex */
public final class PackageManagerCompat {
public static final String ACTION_PERMISSION_REVOCATION_SETTINGS = "android.intent.action.AUTO_REVOKE_PERMISSIONS";
public static final String LOG_TAG = "PackageManagerCompat";
@Retention(RetentionPolicy.SOURCE)
public @interface UnusedAppRestrictionsStatus {
}
private PackageManagerCompat() {
}
public static ListenableFuture<Integer> getUnusedAppRestrictionsStatus(Context context) {
ResolvableFuture<Integer> create = ResolvableFuture.create();
if (!UserManagerCompat.isUserUnlocked(context)) {
create.set(0);
Log.e(LOG_TAG, "User is in locked direct boot mode");
return create;
}
if (!areUnusedAppRestrictionsAvailable(context.getPackageManager())) {
create.set(1);
return create;
}
int i = context.getApplicationInfo().targetSdkVersion;
if (i < 30) {
create.set(0);
Log.e(LOG_TAG, "Target SDK version below API 30");
return create;
}
if (Build.VERSION.SDK_INT >= 31) {
if (Api30Impl.areUnusedAppRestrictionsEnabled(context)) {
create.set(Integer.valueOf(i >= 31 ? 5 : 4));
} else {
create.set(2);
}
return create;
}
if (Build.VERSION.SDK_INT == 30) {
create.set(Integer.valueOf(Api30Impl.areUnusedAppRestrictionsEnabled(context) ? 4 : 2));
return create;
}
final UnusedAppRestrictionsBackportServiceConnection unusedAppRestrictionsBackportServiceConnection = new UnusedAppRestrictionsBackportServiceConnection(context);
create.addListener(new Runnable() { // from class: androidx.core.content.PackageManagerCompat$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
UnusedAppRestrictionsBackportServiceConnection.this.disconnectFromService();
}
}, Executors.newSingleThreadExecutor());
unusedAppRestrictionsBackportServiceConnection.connectAndFetchResult(create);
return create;
}
public static boolean areUnusedAppRestrictionsAvailable(PackageManager packageManager) {
boolean z = Build.VERSION.SDK_INT >= 30;
boolean z2 = Build.VERSION.SDK_INT >= 23 && Build.VERSION.SDK_INT < 30;
boolean z3 = getPermissionRevocationVerifierApp(packageManager) != null;
if (z) {
return true;
}
return z2 && z3;
}
public static String getPermissionRevocationVerifierApp(PackageManager packageManager) {
String str = null;
Iterator<ResolveInfo> it = packageManager.queryIntentActivities(new Intent(ACTION_PERMISSION_REVOCATION_SETTINGS).setData(Uri.fromParts("package", "com.example", null)), 0).iterator();
while (it.hasNext()) {
String str2 = it.next().activityInfo.packageName;
if (packageManager.checkPermission("android.permission.PACKAGE_VERIFICATION_AGENT", str2) == 0) {
if (str != null) {
return str;
}
str = str2;
}
}
return str;
}
private static class Api30Impl {
private Api30Impl() {
}
static boolean areUnusedAppRestrictionsEnabled(Context context) {
return !context.getPackageManager().isAutoRevokeWhitelisted();
}
}
}

View File

@ -0,0 +1,64 @@
package androidx.core.content;
import android.content.Context;
import android.os.Binder;
import android.os.Process;
import androidx.core.app.AppOpsManagerCompat;
import androidx.core.util.ObjectsCompat;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/* loaded from: classes.dex */
public final class PermissionChecker {
public static final int PERMISSION_DENIED = -1;
public static final int PERMISSION_DENIED_APP_OP = -2;
public static final int PERMISSION_GRANTED = 0;
@Retention(RetentionPolicy.SOURCE)
public @interface PermissionResult {
}
private PermissionChecker() {
}
public static int checkPermission(Context context, String str, int i, int i2, String str2) {
int noteProxyOpNoThrow;
if (context.checkPermission(str, i, i2) == -1) {
return -1;
}
String permissionToOp = AppOpsManagerCompat.permissionToOp(str);
if (permissionToOp == null) {
return 0;
}
if (str2 == null) {
String[] packagesForUid = context.getPackageManager().getPackagesForUid(i2);
if (packagesForUid == null || packagesForUid.length <= 0) {
return -1;
}
str2 = packagesForUid[0];
}
int myUid = Process.myUid();
String packageName = context.getPackageName();
if (myUid == i2 && ObjectsCompat.equals(packageName, str2)) {
noteProxyOpNoThrow = AppOpsManagerCompat.checkOrNoteProxyOp(context, i2, permissionToOp, str2);
} else {
noteProxyOpNoThrow = AppOpsManagerCompat.noteProxyOpNoThrow(context, permissionToOp, str2);
}
return noteProxyOpNoThrow == 0 ? 0 : -2;
}
public static int checkSelfPermission(Context context, String str) {
return checkPermission(context, str, Process.myPid(), Process.myUid(), context.getPackageName());
}
public static int checkCallingPermission(Context context, String str, String str2) {
if (Binder.getCallingPid() == Process.myPid()) {
return -1;
}
return checkPermission(context, str, Binder.getCallingPid(), Binder.getCallingUid(), str2);
}
public static int checkCallingOrSelfPermission(Context context, String str) {
return checkPermission(context, str, Binder.getCallingPid(), Binder.getCallingUid(), Binder.getCallingPid() == Process.myPid() ? context.getPackageName() : null);
}
}

View File

@ -0,0 +1,46 @@
package androidx.core.content;
import android.content.SharedPreferences;
@Deprecated
/* loaded from: classes.dex */
public final class SharedPreferencesCompat {
@Deprecated
public static final class EditorCompat {
private static EditorCompat sInstance;
private final Helper mHelper = new Helper();
private static class Helper {
Helper() {
}
public void apply(SharedPreferences.Editor editor) {
try {
editor.apply();
} catch (AbstractMethodError unused) {
editor.commit();
}
}
}
private EditorCompat() {
}
@Deprecated
public static EditorCompat getInstance() {
if (sInstance == null) {
sInstance = new EditorCompat();
}
return sInstance;
}
@Deprecated
public void apply(SharedPreferences.Editor editor) {
this.mHelper.apply(editor);
}
}
private SharedPreferencesCompat() {
}
}

View File

@ -0,0 +1,41 @@
package androidx.core.content;
import android.content.SharedPreferences;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: SharedPreferences.kt */
@Metadata(d1 = {"\u0000 \n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\u001a3\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\b\b\u0002\u0010\u0003\u001a\u00020\u00042\u0017\u0010\u0005\u001a\u0013\u0012\u0004\u0012\u00020\u0007\u0012\u0004\u0012\u00020\u00010\u0006¢\u0006\u0002\b\bH\u0087\\u0001\u0000\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006\t"}, d2 = {"edit", "", "Landroid/content/SharedPreferences;", "commit", "", "action", "Lkotlin/Function1;", "Landroid/content/SharedPreferences$Editor;", "Lkotlin/ExtensionFunctionType;", "core-ktx_release"}, k = 2, mv = {1, 7, 1}, xi = 48)
/* loaded from: classes.dex */
public final class SharedPreferencesKt {
public static /* synthetic */ void edit$default(SharedPreferences sharedPreferences, boolean z, Function1 action, int i, Object obj) {
if ((i & 1) != 0) {
z = false;
}
Intrinsics.checkNotNullParameter(sharedPreferences, "<this>");
Intrinsics.checkNotNullParameter(action, "action");
SharedPreferences.Editor editor = sharedPreferences.edit();
Intrinsics.checkNotNullExpressionValue(editor, "editor");
action.invoke(editor);
if (z) {
editor.commit();
} else {
editor.apply();
}
}
public static final void edit(SharedPreferences sharedPreferences, boolean z, Function1<? super SharedPreferences.Editor, Unit> action) {
Intrinsics.checkNotNullParameter(sharedPreferences, "<this>");
Intrinsics.checkNotNullParameter(action, "action");
SharedPreferences.Editor editor = sharedPreferences.edit();
Intrinsics.checkNotNullExpressionValue(editor, "editor");
action.invoke(editor);
if (z) {
editor.commit();
} else {
editor.apply();
}
}
}

View File

@ -0,0 +1,17 @@
package androidx.core.content;
import android.os.RemoteException;
import androidx.core.app.unusedapprestrictions.IUnusedAppRestrictionsBackportCallback;
/* loaded from: classes.dex */
public class UnusedAppRestrictionsBackportCallback {
private IUnusedAppRestrictionsBackportCallback mCallback;
public UnusedAppRestrictionsBackportCallback(IUnusedAppRestrictionsBackportCallback iUnusedAppRestrictionsBackportCallback) {
this.mCallback = iUnusedAppRestrictionsBackportCallback;
}
public void onResult(boolean z, boolean z2) throws RemoteException {
this.mCallback.onIsPermissionRevocationEnabledForAppResult(z, z2);
}
}

View File

@ -0,0 +1,29 @@
package androidx.core.content;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;
import androidx.core.app.unusedapprestrictions.IUnusedAppRestrictionsBackportCallback;
import androidx.core.app.unusedapprestrictions.IUnusedAppRestrictionsBackportService;
/* loaded from: classes.dex */
public abstract class UnusedAppRestrictionsBackportService extends Service {
public static final String ACTION_UNUSED_APP_RESTRICTIONS_BACKPORT_CONNECTION = "android.support.unusedapprestrictions.action.CustomUnusedAppRestrictionsBackportService";
private IUnusedAppRestrictionsBackportService.Stub mBinder = new IUnusedAppRestrictionsBackportService.Stub() { // from class: androidx.core.content.UnusedAppRestrictionsBackportService.1
@Override // androidx.core.app.unusedapprestrictions.IUnusedAppRestrictionsBackportService
public void isPermissionRevocationEnabledForApp(IUnusedAppRestrictionsBackportCallback iUnusedAppRestrictionsBackportCallback) throws RemoteException {
if (iUnusedAppRestrictionsBackportCallback == null) {
return;
}
UnusedAppRestrictionsBackportService.this.isPermissionRevocationEnabled(new UnusedAppRestrictionsBackportCallback(iUnusedAppRestrictionsBackportCallback));
}
};
protected abstract void isPermissionRevocationEnabled(UnusedAppRestrictionsBackportCallback unusedAppRestrictionsBackportCallback);
@Override // android.app.Service
public IBinder onBind(Intent intent) {
return this.mBinder;
}
}

View File

@ -0,0 +1,73 @@
package androidx.core.content;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;
import androidx.concurrent.futures.ResolvableFuture;
import androidx.core.app.unusedapprestrictions.IUnusedAppRestrictionsBackportCallback;
import androidx.core.app.unusedapprestrictions.IUnusedAppRestrictionsBackportService;
/* loaded from: classes.dex */
class UnusedAppRestrictionsBackportServiceConnection implements ServiceConnection {
private final Context mContext;
ResolvableFuture<Integer> mResultFuture;
IUnusedAppRestrictionsBackportService mUnusedAppRestrictionsService = null;
private boolean mHasBoundService = false;
@Override // android.content.ServiceConnection
public void onServiceDisconnected(ComponentName componentName) {
this.mUnusedAppRestrictionsService = null;
}
UnusedAppRestrictionsBackportServiceConnection(Context context) {
this.mContext = context;
}
@Override // android.content.ServiceConnection
public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
IUnusedAppRestrictionsBackportService asInterface = IUnusedAppRestrictionsBackportService.Stub.asInterface(iBinder);
this.mUnusedAppRestrictionsService = asInterface;
try {
asInterface.isPermissionRevocationEnabledForApp(getBackportCallback());
} catch (RemoteException unused) {
this.mResultFuture.set(0);
}
}
public void connectAndFetchResult(ResolvableFuture<Integer> resolvableFuture) {
if (this.mHasBoundService) {
throw new IllegalStateException("Each UnusedAppRestrictionsBackportServiceConnection can only be bound once.");
}
this.mHasBoundService = true;
this.mResultFuture = resolvableFuture;
this.mContext.bindService(new Intent(UnusedAppRestrictionsBackportService.ACTION_UNUSED_APP_RESTRICTIONS_BACKPORT_CONNECTION).setPackage(PackageManagerCompat.getPermissionRevocationVerifierApp(this.mContext.getPackageManager())), this, 1);
}
public void disconnectFromService() {
if (!this.mHasBoundService) {
throw new IllegalStateException("bindService must be called before unbind");
}
this.mHasBoundService = false;
this.mContext.unbindService(this);
}
private IUnusedAppRestrictionsBackportCallback getBackportCallback() {
return new IUnusedAppRestrictionsBackportCallback.Stub() { // from class: androidx.core.content.UnusedAppRestrictionsBackportServiceConnection.1
@Override // androidx.core.app.unusedapprestrictions.IUnusedAppRestrictionsBackportCallback
public void onIsPermissionRevocationEnabledForAppResult(boolean z, boolean z2) throws RemoteException {
if (!z) {
UnusedAppRestrictionsBackportServiceConnection.this.mResultFuture.set(0);
Log.e(PackageManagerCompat.LOG_TAG, "Unable to retrieve the permission revocation setting from the backport");
} else if (z2) {
UnusedAppRestrictionsBackportServiceConnection.this.mResultFuture.set(3);
} else {
UnusedAppRestrictionsBackportServiceConnection.this.mResultFuture.set(2);
}
}
};
}
}

View File

@ -0,0 +1,14 @@
package androidx.core.content;
/* loaded from: classes.dex */
public final class UnusedAppRestrictionsConstants {
public static final int API_30 = 4;
public static final int API_30_BACKPORT = 3;
public static final int API_31 = 5;
public static final int DISABLED = 2;
public static final int ERROR = 0;
public static final int FEATURE_NOT_AVAILABLE = 1;
private UnusedAppRestrictionsConstants() {
}
}

View File

@ -0,0 +1,39 @@
package androidx.core.content;
import android.content.UriMatcher;
import android.net.Uri;
import androidx.core.util.Predicate;
/* loaded from: classes.dex */
public class UriMatcherCompat {
private UriMatcherCompat() {
}
public static Predicate<Uri> asPredicate(final UriMatcher uriMatcher) {
return new Predicate() { // from class: androidx.core.content.UriMatcherCompat$$ExternalSyntheticLambda0
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate) {
return Predicate.CC.$default$and(this, predicate);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate) {
return Predicate.CC.$default$or(this, predicate);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
return UriMatcherCompat.lambda$asPredicate$0(uriMatcher, (Uri) obj);
}
};
}
static /* synthetic */ boolean lambda$asPredicate$0(UriMatcher uriMatcher, Uri uri) {
return uriMatcher.match(uri) != -1;
}
}

View File

@ -0,0 +1,12 @@
package androidx.core.content.pm;
@Deprecated
/* loaded from: classes.dex */
public final class ActivityInfoCompat {
@Deprecated
public static final int CONFIG_UI_MODE = 512;
private ActivityInfoCompat() {
}
}

View File

@ -0,0 +1,148 @@
package androidx.core.content.pm;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.content.pm.SigningInfo;
import android.os.Build;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
/* loaded from: classes.dex */
public final class PackageInfoCompat {
public static long getLongVersionCode(PackageInfo packageInfo) {
if (Build.VERSION.SDK_INT >= 28) {
return Api28Impl.getLongVersionCode(packageInfo);
}
return packageInfo.versionCode;
}
public static List<Signature> getSignatures(PackageManager packageManager, String str) throws PackageManager.NameNotFoundException {
Signature[] signatureArr;
SigningInfo signingInfo;
if (Build.VERSION.SDK_INT >= 28) {
signingInfo = packageManager.getPackageInfo(str, 134217728).signingInfo;
if (Api28Impl.hasMultipleSigners(signingInfo)) {
signatureArr = Api28Impl.getApkContentsSigners(signingInfo);
} else {
signatureArr = Api28Impl.getSigningCertificateHistory(signingInfo);
}
} else {
signatureArr = packageManager.getPackageInfo(str, 64).signatures;
}
if (signatureArr == null) {
return Collections.emptyList();
}
return Arrays.asList(signatureArr);
}
public static boolean hasSignatures(PackageManager packageManager, String str, Map<byte[], Integer> map, boolean z) throws PackageManager.NameNotFoundException {
byte[][] bArr;
if (map.isEmpty()) {
return false;
}
Set<byte[]> keySet = map.keySet();
for (byte[] bArr2 : keySet) {
if (bArr2 == null) {
throw new IllegalArgumentException("Cert byte array cannot be null when verifying " + str);
}
Integer num = map.get(bArr2);
if (num == null) {
throw new IllegalArgumentException("Type must be specified for cert when verifying " + str);
}
int intValue = num.intValue();
if (intValue != 0 && intValue != 1) {
throw new IllegalArgumentException("Unsupported certificate type " + num + " when verifying " + str);
}
}
List<Signature> signatures = getSignatures(packageManager, str);
if (!z && Build.VERSION.SDK_INT >= 28) {
for (byte[] bArr3 : keySet) {
if (!Api28Impl.hasSigningCertificate(packageManager, str, bArr3, map.get(bArr3).intValue())) {
return false;
}
}
return true;
}
if (signatures.size() != 0 && map.size() <= signatures.size() && (!z || map.size() == signatures.size())) {
if (map.containsValue(1)) {
bArr = new byte[signatures.size()][];
for (int i = 0; i < signatures.size(); i++) {
bArr[i] = computeSHA256Digest(signatures.get(i).toByteArray());
}
} else {
bArr = null;
}
Iterator<byte[]> it = keySet.iterator();
if (it.hasNext()) {
byte[] next = it.next();
Integer num2 = map.get(next);
int intValue2 = num2.intValue();
if (intValue2 != 0) {
if (intValue2 == 1) {
if (!byteArrayContains(bArr, next)) {
return false;
}
} else {
throw new IllegalArgumentException("Unsupported certificate type " + num2);
}
} else if (!signatures.contains(new Signature(next))) {
return false;
}
return true;
}
}
return false;
}
private static boolean byteArrayContains(byte[][] bArr, byte[] bArr2) {
for (byte[] bArr3 : bArr) {
if (Arrays.equals(bArr2, bArr3)) {
return true;
}
}
return false;
}
private static byte[] computeSHA256Digest(byte[] bArr) {
try {
return MessageDigest.getInstance("SHA256").digest(bArr);
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException("Device doesn't support SHA256 cert checking", e);
}
}
private PackageInfoCompat() {
}
private static class Api28Impl {
private Api28Impl() {
}
static boolean hasSigningCertificate(PackageManager packageManager, String str, byte[] bArr, int i) {
return packageManager.hasSigningCertificate(str, bArr, i);
}
static boolean hasMultipleSigners(SigningInfo signingInfo) {
return signingInfo.hasMultipleSigners();
}
static Signature[] getApkContentsSigners(SigningInfo signingInfo) {
return signingInfo.getApkContentsSigners();
}
static Signature[] getSigningCertificateHistory(SigningInfo signingInfo) {
return signingInfo.getSigningCertificateHistory();
}
static long getLongVersionCode(PackageInfo packageInfo) {
return packageInfo.getLongVersionCode();
}
}
}

View File

@ -0,0 +1,48 @@
package androidx.core.content.pm;
import android.content.pm.PermissionInfo;
import android.os.Build;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/* loaded from: classes.dex */
public final class PermissionInfoCompat {
@Retention(RetentionPolicy.SOURCE)
public @interface Protection {
}
@Retention(RetentionPolicy.SOURCE)
public @interface ProtectionFlags {
}
private PermissionInfoCompat() {
}
public static int getProtection(PermissionInfo permissionInfo) {
if (Build.VERSION.SDK_INT >= 28) {
return Api28Impl.getProtection(permissionInfo);
}
return permissionInfo.protectionLevel & 15;
}
public static int getProtectionFlags(PermissionInfo permissionInfo) {
if (Build.VERSION.SDK_INT >= 28) {
return Api28Impl.getProtectionFlags(permissionInfo);
}
return permissionInfo.protectionLevel & (-16);
}
static class Api28Impl {
private Api28Impl() {
}
static int getProtection(PermissionInfo permissionInfo) {
return permissionInfo.getProtection();
}
static int getProtectionFlags(PermissionInfo permissionInfo) {
return permissionInfo.getProtectionFlags();
}
}
}

View File

@ -0,0 +1,21 @@
package androidx.core.content.pm;
import java.util.List;
/* loaded from: classes.dex */
public abstract class ShortcutInfoChangeListener {
public void onAllShortcutsRemoved() {
}
public void onShortcutAdded(List<ShortcutInfoCompat> list) {
}
public void onShortcutRemoved(List<String> list) {
}
public void onShortcutUpdated(List<ShortcutInfoCompat> list) {
}
public void onShortcutUsageReported(List<String> list) {
}
}

View File

@ -0,0 +1,633 @@
package androidx.core.content.pm;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.LocusId;
import android.content.pm.PackageManager;
import android.content.pm.ShortcutInfo;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.os.UserHandle;
import android.text.TextUtils;
import androidx.core.app.NotificationCompat$Style$$ExternalSyntheticApiModelOutline0;
import androidx.core.app.Person;
import androidx.core.content.LocusIdCompat;
import androidx.core.graphics.drawable.IconCompat;
import androidx.core.net.UriCompat;
import androidx.core.util.Preconditions;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Arrays;
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 class ShortcutInfoCompat {
private static final String EXTRA_LOCUS_ID = "extraLocusId";
private static final String EXTRA_LONG_LIVED = "extraLongLived";
private static final String EXTRA_PERSON_ = "extraPerson_";
private static final String EXTRA_PERSON_COUNT = "extraPersonCount";
private static final String EXTRA_SLICE_URI = "extraSliceUri";
public static final int SURFACE_LAUNCHER = 1;
ComponentName mActivity;
Set<String> mCategories;
Context mContext;
CharSequence mDisabledMessage;
int mDisabledReason;
int mExcludedSurfaces;
PersistableBundle mExtras;
boolean mHasKeyFieldsOnly;
IconCompat mIcon;
String mId;
Intent[] mIntents;
boolean mIsAlwaysBadged;
boolean mIsCached;
boolean mIsDeclaredInManifest;
boolean mIsDynamic;
boolean mIsEnabled = true;
boolean mIsImmutable;
boolean mIsLongLived;
boolean mIsPinned;
CharSequence mLabel;
long mLastChangedTimestamp;
LocusIdCompat mLocusId;
CharSequence mLongLabel;
String mPackageName;
Person[] mPersons;
int mRank;
Bundle mTransientExtras;
UserHandle mUser;
@Retention(RetentionPolicy.SOURCE)
public @interface Surface {
}
public ComponentName getActivity() {
return this.mActivity;
}
public Set<String> getCategories() {
return this.mCategories;
}
public CharSequence getDisabledMessage() {
return this.mDisabledMessage;
}
public int getDisabledReason() {
return this.mDisabledReason;
}
public int getExcludedFromSurfaces() {
return this.mExcludedSurfaces;
}
public PersistableBundle getExtras() {
return this.mExtras;
}
public IconCompat getIcon() {
return this.mIcon;
}
public String getId() {
return this.mId;
}
public long getLastChangedTimestamp() {
return this.mLastChangedTimestamp;
}
public LocusIdCompat getLocusId() {
return this.mLocusId;
}
public CharSequence getLongLabel() {
return this.mLongLabel;
}
public String getPackage() {
return this.mPackageName;
}
public int getRank() {
return this.mRank;
}
public CharSequence getShortLabel() {
return this.mLabel;
}
public Bundle getTransientExtras() {
return this.mTransientExtras;
}
public UserHandle getUserHandle() {
return this.mUser;
}
public boolean hasKeyFieldsOnly() {
return this.mHasKeyFieldsOnly;
}
public boolean isCached() {
return this.mIsCached;
}
public boolean isDeclaredInManifest() {
return this.mIsDeclaredInManifest;
}
public boolean isDynamic() {
return this.mIsDynamic;
}
public boolean isEnabled() {
return this.mIsEnabled;
}
public boolean isExcludedFromSurfaces(int i) {
return (i & this.mExcludedSurfaces) != 0;
}
public boolean isImmutable() {
return this.mIsImmutable;
}
public boolean isPinned() {
return this.mIsPinned;
}
ShortcutInfoCompat() {
}
public ShortcutInfo toShortcutInfo() {
ShortcutInfo.Builder shortLabel;
ShortcutInfo.Builder intents;
ShortcutInfo build;
NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$4();
shortLabel = NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m56m(this.mContext, this.mId).setShortLabel(this.mLabel);
intents = shortLabel.setIntents(this.mIntents);
IconCompat iconCompat = this.mIcon;
if (iconCompat != null) {
intents.setIcon(iconCompat.toIcon(this.mContext));
}
if (!TextUtils.isEmpty(this.mLongLabel)) {
intents.setLongLabel(this.mLongLabel);
}
if (!TextUtils.isEmpty(this.mDisabledMessage)) {
intents.setDisabledMessage(this.mDisabledMessage);
}
ComponentName componentName = this.mActivity;
if (componentName != null) {
intents.setActivity(componentName);
}
Set<String> set = this.mCategories;
if (set != null) {
intents.setCategories(set);
}
intents.setRank(this.mRank);
PersistableBundle persistableBundle = this.mExtras;
if (persistableBundle != null) {
intents.setExtras(persistableBundle);
}
if (Build.VERSION.SDK_INT >= 29) {
Person[] personArr = this.mPersons;
if (personArr != null && personArr.length > 0) {
int length = personArr.length;
android.app.Person[] personArr2 = new android.app.Person[length];
for (int i = 0; i < length; i++) {
personArr2[i] = this.mPersons[i].toAndroidPerson();
}
intents.setPersons(personArr2);
}
LocusIdCompat locusIdCompat = this.mLocusId;
if (locusIdCompat != null) {
intents.setLocusId(locusIdCompat.toLocusId());
}
intents.setLongLived(this.mIsLongLived);
} else {
intents.setExtras(buildLegacyExtrasBundle());
}
build = intents.build();
return build;
}
private PersistableBundle buildLegacyExtrasBundle() {
if (this.mExtras == null) {
this.mExtras = new PersistableBundle();
}
Person[] personArr = this.mPersons;
if (personArr != null && personArr.length > 0) {
this.mExtras.putInt(EXTRA_PERSON_COUNT, personArr.length);
int i = 0;
while (i < this.mPersons.length) {
PersistableBundle persistableBundle = this.mExtras;
StringBuilder sb = new StringBuilder(EXTRA_PERSON_);
int i2 = i + 1;
sb.append(i2);
persistableBundle.putPersistableBundle(sb.toString(), this.mPersons[i].toPersistableBundle());
i = i2;
}
}
LocusIdCompat locusIdCompat = this.mLocusId;
if (locusIdCompat != null) {
this.mExtras.putString(EXTRA_LOCUS_ID, locusIdCompat.getId());
}
this.mExtras.putBoolean(EXTRA_LONG_LIVED, this.mIsLongLived);
return this.mExtras;
}
Intent addToIntent(Intent intent) {
intent.putExtra("android.intent.extra.shortcut.INTENT", this.mIntents[r0.length - 1]).putExtra("android.intent.extra.shortcut.NAME", this.mLabel.toString());
if (this.mIcon != null) {
Drawable drawable = null;
if (this.mIsAlwaysBadged) {
PackageManager packageManager = this.mContext.getPackageManager();
ComponentName componentName = this.mActivity;
if (componentName != null) {
try {
drawable = packageManager.getActivityIcon(componentName);
} catch (PackageManager.NameNotFoundException unused) {
}
}
if (drawable == null) {
drawable = this.mContext.getApplicationInfo().loadIcon(packageManager);
}
}
this.mIcon.addToShortcutIntent(intent, drawable, this.mContext);
}
return intent;
}
public Intent getIntent() {
return this.mIntents[r0.length - 1];
}
public Intent[] getIntents() {
Intent[] intentArr = this.mIntents;
return (Intent[]) Arrays.copyOf(intentArr, intentArr.length);
}
static Person[] getPersonsFromExtra(PersistableBundle persistableBundle) {
if (persistableBundle == null || !persistableBundle.containsKey(EXTRA_PERSON_COUNT)) {
return null;
}
int i = persistableBundle.getInt(EXTRA_PERSON_COUNT);
Person[] personArr = new Person[i];
int i2 = 0;
while (i2 < i) {
StringBuilder sb = new StringBuilder(EXTRA_PERSON_);
int i3 = i2 + 1;
sb.append(i3);
personArr[i2] = Person.fromPersistableBundle(persistableBundle.getPersistableBundle(sb.toString()));
i2 = i3;
}
return personArr;
}
static boolean getLongLivedFromExtra(PersistableBundle persistableBundle) {
boolean z;
if (persistableBundle == null || !persistableBundle.containsKey(EXTRA_LONG_LIVED)) {
return false;
}
z = persistableBundle.getBoolean(EXTRA_LONG_LIVED);
return z;
}
static List<ShortcutInfoCompat> fromShortcuts(Context context, List<ShortcutInfo> list) {
ArrayList arrayList = new ArrayList(list.size());
Iterator<ShortcutInfo> it = list.iterator();
while (it.hasNext()) {
arrayList.add(new Builder(context, NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m57m((Object) it.next())).build());
}
return arrayList;
}
static LocusIdCompat getLocusId(ShortcutInfo shortcutInfo) {
PersistableBundle extras;
LocusId locusId;
LocusId locusId2;
if (Build.VERSION.SDK_INT >= 29) {
locusId = shortcutInfo.getLocusId();
if (locusId == null) {
return null;
}
locusId2 = shortcutInfo.getLocusId();
return LocusIdCompat.toLocusIdCompat(locusId2);
}
extras = shortcutInfo.getExtras();
return getLocusIdFromExtra(extras);
}
private static LocusIdCompat getLocusIdFromExtra(PersistableBundle persistableBundle) {
String string;
if (persistableBundle == null || (string = persistableBundle.getString(EXTRA_LOCUS_ID)) == null) {
return null;
}
return new LocusIdCompat(string);
}
public static class Builder {
private Map<String, Map<String, List<String>>> mCapabilityBindingParams;
private Set<String> mCapabilityBindings;
private final ShortcutInfoCompat mInfo;
private boolean mIsConversation;
private Uri mSliceUri;
public Builder setIsConversation() {
this.mIsConversation = true;
return this;
}
public Builder setSliceUri(Uri uri) {
this.mSliceUri = uri;
return this;
}
public Builder(Context context, String str) {
ShortcutInfoCompat shortcutInfoCompat = new ShortcutInfoCompat();
this.mInfo = shortcutInfoCompat;
shortcutInfoCompat.mContext = context;
shortcutInfoCompat.mId = str;
}
public Builder(ShortcutInfoCompat shortcutInfoCompat) {
ShortcutInfoCompat shortcutInfoCompat2 = new ShortcutInfoCompat();
this.mInfo = shortcutInfoCompat2;
shortcutInfoCompat2.mContext = shortcutInfoCompat.mContext;
shortcutInfoCompat2.mId = shortcutInfoCompat.mId;
shortcutInfoCompat2.mPackageName = shortcutInfoCompat.mPackageName;
shortcutInfoCompat2.mIntents = (Intent[]) Arrays.copyOf(shortcutInfoCompat.mIntents, shortcutInfoCompat.mIntents.length);
shortcutInfoCompat2.mActivity = shortcutInfoCompat.mActivity;
shortcutInfoCompat2.mLabel = shortcutInfoCompat.mLabel;
shortcutInfoCompat2.mLongLabel = shortcutInfoCompat.mLongLabel;
shortcutInfoCompat2.mDisabledMessage = shortcutInfoCompat.mDisabledMessage;
shortcutInfoCompat2.mDisabledReason = shortcutInfoCompat.mDisabledReason;
shortcutInfoCompat2.mIcon = shortcutInfoCompat.mIcon;
shortcutInfoCompat2.mIsAlwaysBadged = shortcutInfoCompat.mIsAlwaysBadged;
shortcutInfoCompat2.mUser = shortcutInfoCompat.mUser;
shortcutInfoCompat2.mLastChangedTimestamp = shortcutInfoCompat.mLastChangedTimestamp;
shortcutInfoCompat2.mIsCached = shortcutInfoCompat.mIsCached;
shortcutInfoCompat2.mIsDynamic = shortcutInfoCompat.mIsDynamic;
shortcutInfoCompat2.mIsPinned = shortcutInfoCompat.mIsPinned;
shortcutInfoCompat2.mIsDeclaredInManifest = shortcutInfoCompat.mIsDeclaredInManifest;
shortcutInfoCompat2.mIsImmutable = shortcutInfoCompat.mIsImmutable;
shortcutInfoCompat2.mIsEnabled = shortcutInfoCompat.mIsEnabled;
shortcutInfoCompat2.mLocusId = shortcutInfoCompat.mLocusId;
shortcutInfoCompat2.mIsLongLived = shortcutInfoCompat.mIsLongLived;
shortcutInfoCompat2.mHasKeyFieldsOnly = shortcutInfoCompat.mHasKeyFieldsOnly;
shortcutInfoCompat2.mRank = shortcutInfoCompat.mRank;
if (shortcutInfoCompat.mPersons != null) {
shortcutInfoCompat2.mPersons = (Person[]) Arrays.copyOf(shortcutInfoCompat.mPersons, shortcutInfoCompat.mPersons.length);
}
if (shortcutInfoCompat.mCategories != null) {
shortcutInfoCompat2.mCategories = new HashSet(shortcutInfoCompat.mCategories);
}
if (shortcutInfoCompat.mExtras != null) {
shortcutInfoCompat2.mExtras = shortcutInfoCompat.mExtras;
}
shortcutInfoCompat2.mExcludedSurfaces = shortcutInfoCompat.mExcludedSurfaces;
}
public Builder(Context context, ShortcutInfo shortcutInfo) {
String id;
String str;
Intent[] intents;
ComponentName activity;
CharSequence shortLabel;
CharSequence longLabel;
CharSequence disabledMessage;
boolean isEnabled;
Set<String> categories;
PersistableBundle extras;
UserHandle userHandle;
long lastChangedTimestamp;
boolean isDynamic;
boolean isPinned;
boolean isDeclaredInManifest;
boolean isImmutable;
boolean isEnabled2;
boolean hasKeyFieldsOnly;
int rank;
PersistableBundle extras2;
boolean isCached;
int disabledReason;
ShortcutInfoCompat shortcutInfoCompat = new ShortcutInfoCompat();
this.mInfo = shortcutInfoCompat;
shortcutInfoCompat.mContext = context;
id = shortcutInfo.getId();
shortcutInfoCompat.mId = id;
str = shortcutInfo.getPackage();
shortcutInfoCompat.mPackageName = str;
intents = shortcutInfo.getIntents();
shortcutInfoCompat.mIntents = (Intent[]) Arrays.copyOf(intents, intents.length);
activity = shortcutInfo.getActivity();
shortcutInfoCompat.mActivity = activity;
shortLabel = shortcutInfo.getShortLabel();
shortcutInfoCompat.mLabel = shortLabel;
longLabel = shortcutInfo.getLongLabel();
shortcutInfoCompat.mLongLabel = longLabel;
disabledMessage = shortcutInfo.getDisabledMessage();
shortcutInfoCompat.mDisabledMessage = disabledMessage;
if (Build.VERSION.SDK_INT >= 28) {
disabledReason = shortcutInfo.getDisabledReason();
shortcutInfoCompat.mDisabledReason = disabledReason;
} else {
isEnabled = shortcutInfo.isEnabled();
shortcutInfoCompat.mDisabledReason = isEnabled ? 0 : 3;
}
categories = shortcutInfo.getCategories();
shortcutInfoCompat.mCategories = categories;
extras = shortcutInfo.getExtras();
shortcutInfoCompat.mPersons = ShortcutInfoCompat.getPersonsFromExtra(extras);
userHandle = shortcutInfo.getUserHandle();
shortcutInfoCompat.mUser = userHandle;
lastChangedTimestamp = shortcutInfo.getLastChangedTimestamp();
shortcutInfoCompat.mLastChangedTimestamp = lastChangedTimestamp;
if (Build.VERSION.SDK_INT >= 30) {
isCached = shortcutInfo.isCached();
shortcutInfoCompat.mIsCached = isCached;
}
isDynamic = shortcutInfo.isDynamic();
shortcutInfoCompat.mIsDynamic = isDynamic;
isPinned = shortcutInfo.isPinned();
shortcutInfoCompat.mIsPinned = isPinned;
isDeclaredInManifest = shortcutInfo.isDeclaredInManifest();
shortcutInfoCompat.mIsDeclaredInManifest = isDeclaredInManifest;
isImmutable = shortcutInfo.isImmutable();
shortcutInfoCompat.mIsImmutable = isImmutable;
isEnabled2 = shortcutInfo.isEnabled();
shortcutInfoCompat.mIsEnabled = isEnabled2;
hasKeyFieldsOnly = shortcutInfo.hasKeyFieldsOnly();
shortcutInfoCompat.mHasKeyFieldsOnly = hasKeyFieldsOnly;
shortcutInfoCompat.mLocusId = ShortcutInfoCompat.getLocusId(shortcutInfo);
rank = shortcutInfo.getRank();
shortcutInfoCompat.mRank = rank;
extras2 = shortcutInfo.getExtras();
shortcutInfoCompat.mExtras = extras2;
}
public Builder setShortLabel(CharSequence charSequence) {
this.mInfo.mLabel = charSequence;
return this;
}
public Builder setLongLabel(CharSequence charSequence) {
this.mInfo.mLongLabel = charSequence;
return this;
}
public Builder setDisabledMessage(CharSequence charSequence) {
this.mInfo.mDisabledMessage = charSequence;
return this;
}
public Builder setIntent(Intent intent) {
return setIntents(new Intent[]{intent});
}
public Builder setIntents(Intent[] intentArr) {
this.mInfo.mIntents = intentArr;
return this;
}
public Builder setIcon(IconCompat iconCompat) {
this.mInfo.mIcon = iconCompat;
return this;
}
public Builder setLocusId(LocusIdCompat locusIdCompat) {
this.mInfo.mLocusId = locusIdCompat;
return this;
}
public Builder setActivity(ComponentName componentName) {
this.mInfo.mActivity = componentName;
return this;
}
public Builder setAlwaysBadged() {
this.mInfo.mIsAlwaysBadged = true;
return this;
}
public Builder setPerson(Person person) {
return setPersons(new Person[]{person});
}
public Builder setPersons(Person[] personArr) {
this.mInfo.mPersons = personArr;
return this;
}
public Builder setCategories(Set<String> set) {
this.mInfo.mCategories = set;
return this;
}
@Deprecated
public Builder setLongLived() {
this.mInfo.mIsLongLived = true;
return this;
}
public Builder setLongLived(boolean z) {
this.mInfo.mIsLongLived = z;
return this;
}
public Builder setExcludedFromSurfaces(int i) {
this.mInfo.mExcludedSurfaces = i;
return this;
}
public Builder setRank(int i) {
this.mInfo.mRank = i;
return this;
}
public Builder setExtras(PersistableBundle persistableBundle) {
this.mInfo.mExtras = persistableBundle;
return this;
}
public Builder setTransientExtras(Bundle bundle) {
this.mInfo.mTransientExtras = (Bundle) Preconditions.checkNotNull(bundle);
return this;
}
public Builder addCapabilityBinding(String str) {
if (this.mCapabilityBindings == null) {
this.mCapabilityBindings = new HashSet();
}
this.mCapabilityBindings.add(str);
return this;
}
public Builder addCapabilityBinding(String str, String str2, List<String> list) {
addCapabilityBinding(str);
if (!list.isEmpty()) {
if (this.mCapabilityBindingParams == null) {
this.mCapabilityBindingParams = new HashMap();
}
if (this.mCapabilityBindingParams.get(str) == null) {
this.mCapabilityBindingParams.put(str, new HashMap());
}
this.mCapabilityBindingParams.get(str).put(str2, list);
}
return this;
}
public ShortcutInfoCompat build() {
if (TextUtils.isEmpty(this.mInfo.mLabel)) {
throw new IllegalArgumentException("Shortcut must have a non-empty label");
}
if (this.mInfo.mIntents == null || this.mInfo.mIntents.length == 0) {
throw new IllegalArgumentException("Shortcut must have an intent");
}
if (this.mIsConversation) {
if (this.mInfo.mLocusId == null) {
ShortcutInfoCompat shortcutInfoCompat = this.mInfo;
shortcutInfoCompat.mLocusId = new LocusIdCompat(shortcutInfoCompat.mId);
}
this.mInfo.mIsLongLived = true;
}
if (this.mCapabilityBindings != null) {
if (this.mInfo.mCategories == null) {
this.mInfo.mCategories = new HashSet();
}
this.mInfo.mCategories.addAll(this.mCapabilityBindings);
}
if (this.mCapabilityBindingParams != null) {
if (this.mInfo.mExtras == null) {
this.mInfo.mExtras = new PersistableBundle();
}
for (String str : this.mCapabilityBindingParams.keySet()) {
Map<String, List<String>> map = this.mCapabilityBindingParams.get(str);
this.mInfo.mExtras.putStringArray(str, (String[]) map.keySet().toArray(new String[0]));
for (String str2 : map.keySet()) {
List<String> list = map.get(str2);
this.mInfo.mExtras.putStringArray(str + "/" + str2, list == null ? new String[0] : (String[]) list.toArray(new String[0]));
}
}
}
if (this.mSliceUri != null) {
if (this.mInfo.mExtras == null) {
this.mInfo.mExtras = new PersistableBundle();
}
this.mInfo.mExtras.putString(ShortcutInfoCompat.EXTRA_SLICE_URI, UriCompat.toSafeString(this.mSliceUri));
}
return this.mInfo;
}
}
}

View File

@ -0,0 +1,46 @@
package androidx.core.content.pm;
import java.util.ArrayList;
import java.util.List;
/* loaded from: classes.dex */
public abstract class ShortcutInfoCompatSaver<T> {
public abstract T addShortcuts(List<ShortcutInfoCompat> list);
public abstract T removeAllShortcuts();
public abstract T removeShortcuts(List<String> list);
public List<ShortcutInfoCompat> getShortcuts() throws Exception {
return new ArrayList();
}
public static class NoopImpl extends ShortcutInfoCompatSaver<Void> {
@Override // androidx.core.content.pm.ShortcutInfoCompatSaver
/* renamed from: addShortcuts, reason: avoid collision after fix types in other method */
public Void addShortcuts2(List<ShortcutInfoCompat> list) {
return null;
}
@Override // androidx.core.content.pm.ShortcutInfoCompatSaver
public Void removeAllShortcuts() {
return null;
}
@Override // androidx.core.content.pm.ShortcutInfoCompatSaver
/* renamed from: removeShortcuts, reason: avoid collision after fix types in other method */
public Void removeShortcuts2(List<String> list) {
return null;
}
@Override // androidx.core.content.pm.ShortcutInfoCompatSaver
public /* bridge */ /* synthetic */ Void addShortcuts(List list) {
return addShortcuts2((List<ShortcutInfoCompat>) list);
}
@Override // androidx.core.content.pm.ShortcutInfoCompatSaver
public /* bridge */ /* synthetic */ Void removeShortcuts(List list) {
return removeShortcuts2((List<String>) list);
}
}
}

View File

@ -0,0 +1,599 @@
package androidx.core.content.pm;
import android.app.ActivityManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.ShortcutInfo;
import android.content.pm.ShortcutManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import androidx.core.app.NotificationCompat$Style$$ExternalSyntheticApiModelOutline0;
import androidx.core.content.ContextCompat;
import androidx.core.content.pm.ShortcutInfoCompat;
import androidx.core.content.pm.ShortcutInfoCompatSaver;
import androidx.core.graphics.drawable.IconCompat;
import androidx.core.util.Preconditions;
import java.io.InputStream;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
/* loaded from: classes.dex */
public class ShortcutManagerCompat {
static final String ACTION_INSTALL_SHORTCUT = "com.android.launcher.action.INSTALL_SHORTCUT";
private static final int DEFAULT_MAX_ICON_DIMENSION_DP = 96;
private static final int DEFAULT_MAX_ICON_DIMENSION_LOWRAM_DP = 48;
public static final String EXTRA_SHORTCUT_ID = "android.intent.extra.shortcut.ID";
public static final int FLAG_MATCH_CACHED = 8;
public static final int FLAG_MATCH_DYNAMIC = 2;
public static final int FLAG_MATCH_MANIFEST = 1;
public static final int FLAG_MATCH_PINNED = 4;
static final String INSTALL_SHORTCUT_PERMISSION = "com.android.launcher.permission.INSTALL_SHORTCUT";
private static final String SHORTCUT_LISTENER_INTENT_FILTER_ACTION = "androidx.core.content.pm.SHORTCUT_LISTENER";
private static final String SHORTCUT_LISTENER_META_DATA_KEY = "androidx.core.content.pm.shortcut_listener_impl";
private static volatile List<ShortcutInfoChangeListener> sShortcutInfoChangeListeners;
private static volatile ShortcutInfoCompatSaver<?> sShortcutInfoCompatSaver;
@Retention(RetentionPolicy.SOURCE)
public @interface ShortcutMatchFlags {
}
static List<ShortcutInfoChangeListener> getShortcutInfoChangeListeners() {
return sShortcutInfoChangeListeners;
}
static void setShortcutInfoChangeListeners(List<ShortcutInfoChangeListener> list) {
sShortcutInfoChangeListeners = list;
}
static void setShortcutInfoCompatSaver(ShortcutInfoCompatSaver<Void> shortcutInfoCompatSaver) {
sShortcutInfoCompatSaver = shortcutInfoCompatSaver;
}
private ShortcutManagerCompat() {
}
public static boolean isRequestPinShortcutSupported(Context context) {
Object systemService;
boolean isRequestPinShortcutSupported;
if (Build.VERSION.SDK_INT >= 26) {
systemService = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
isRequestPinShortcutSupported = NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService).isRequestPinShortcutSupported();
return isRequestPinShortcutSupported;
}
if (ContextCompat.checkSelfPermission(context, INSTALL_SHORTCUT_PERMISSION) != 0) {
return false;
}
Iterator<ResolveInfo> it = context.getPackageManager().queryBroadcastReceivers(new Intent(ACTION_INSTALL_SHORTCUT), 0).iterator();
while (it.hasNext()) {
String str = it.next().activityInfo.permission;
if (TextUtils.isEmpty(str) || INSTALL_SHORTCUT_PERMISSION.equals(str)) {
return true;
}
}
return false;
}
public static boolean requestPinShortcut(Context context, ShortcutInfoCompat shortcutInfoCompat, final IntentSender intentSender) {
Object systemService;
boolean requestPinShortcut;
if (Build.VERSION.SDK_INT <= 31 && shortcutInfoCompat.isExcludedFromSurfaces(1)) {
return false;
}
if (Build.VERSION.SDK_INT >= 26) {
systemService = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
requestPinShortcut = NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService).requestPinShortcut(shortcutInfoCompat.toShortcutInfo(), intentSender);
return requestPinShortcut;
}
if (!isRequestPinShortcutSupported(context)) {
return false;
}
Intent addToIntent = shortcutInfoCompat.addToIntent(new Intent(ACTION_INSTALL_SHORTCUT));
if (intentSender == null) {
context.sendBroadcast(addToIntent);
return true;
}
context.sendOrderedBroadcast(addToIntent, null, new BroadcastReceiver() { // from class: androidx.core.content.pm.ShortcutManagerCompat.1
@Override // android.content.BroadcastReceiver
public void onReceive(Context context2, Intent intent) {
try {
intentSender.sendIntent(context2, 0, null, null, null);
} catch (IntentSender.SendIntentException unused) {
}
}
}, null, -1, null, null);
return true;
}
public static Intent createShortcutResultIntent(Context context, ShortcutInfoCompat shortcutInfoCompat) {
Intent intent;
Object systemService;
if (Build.VERSION.SDK_INT >= 26) {
systemService = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
intent = NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService).createShortcutResultIntent(shortcutInfoCompat.toShortcutInfo());
} else {
intent = null;
}
if (intent == null) {
intent = new Intent();
}
return shortcutInfoCompat.addToIntent(intent);
}
public static List<ShortcutInfoCompat> getShortcuts(Context context, int i) {
Object systemService;
List pinnedShortcuts;
List dynamicShortcuts;
List manifestShortcuts;
Object systemService2;
List shortcuts;
if (Build.VERSION.SDK_INT >= 30) {
systemService2 = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
shortcuts = NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService2).getShortcuts(i);
return ShortcutInfoCompat.fromShortcuts(context, shortcuts);
}
if (Build.VERSION.SDK_INT >= 25) {
systemService = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
ShortcutManager m58m = NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService);
ArrayList arrayList = new ArrayList();
if ((i & 1) != 0) {
manifestShortcuts = m58m.getManifestShortcuts();
arrayList.addAll(manifestShortcuts);
}
if ((i & 2) != 0) {
dynamicShortcuts = m58m.getDynamicShortcuts();
arrayList.addAll(dynamicShortcuts);
}
if ((i & 4) != 0) {
pinnedShortcuts = m58m.getPinnedShortcuts();
arrayList.addAll(pinnedShortcuts);
}
return ShortcutInfoCompat.fromShortcuts(context, arrayList);
}
if ((i & 2) != 0) {
try {
return getShortcutInfoSaverInstance(context).getShortcuts();
} catch (Exception unused) {
}
}
return Collections.emptyList();
}
public static boolean addDynamicShortcuts(Context context, List<ShortcutInfoCompat> list) {
Object systemService;
boolean addDynamicShortcuts;
List<ShortcutInfoCompat> removeShortcutsExcludedFromSurface = removeShortcutsExcludedFromSurface(list, 1);
if (Build.VERSION.SDK_INT <= 29) {
convertUriIconsToBitmapIcons(context, removeShortcutsExcludedFromSurface);
}
if (Build.VERSION.SDK_INT >= 25) {
ArrayList arrayList = new ArrayList();
Iterator<ShortcutInfoCompat> it = removeShortcutsExcludedFromSurface.iterator();
while (it.hasNext()) {
arrayList.add(it.next().toShortcutInfo());
}
systemService = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
addDynamicShortcuts = NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService).addDynamicShortcuts(arrayList);
if (!addDynamicShortcuts) {
return false;
}
}
getShortcutInfoSaverInstance(context).addShortcuts(removeShortcutsExcludedFromSurface);
Iterator<ShortcutInfoChangeListener> it2 = getShortcutInfoListeners(context).iterator();
while (it2.hasNext()) {
it2.next().onShortcutAdded(list);
}
return true;
}
public static int getMaxShortcutCountPerActivity(Context context) {
Object systemService;
int maxShortcutCountPerActivity;
Preconditions.checkNotNull(context);
if (Build.VERSION.SDK_INT < 25) {
return 5;
}
systemService = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
maxShortcutCountPerActivity = NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService).getMaxShortcutCountPerActivity();
return maxShortcutCountPerActivity;
}
public static boolean isRateLimitingActive(Context context) {
Object systemService;
boolean isRateLimitingActive;
Preconditions.checkNotNull(context);
if (Build.VERSION.SDK_INT < 25) {
return getShortcuts(context, 3).size() == getMaxShortcutCountPerActivity(context);
}
systemService = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
isRateLimitingActive = NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService).isRateLimitingActive();
return isRateLimitingActive;
}
public static int getIconMaxWidth(Context context) {
Object systemService;
int iconMaxWidth;
Preconditions.checkNotNull(context);
if (Build.VERSION.SDK_INT >= 25) {
systemService = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
iconMaxWidth = NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService).getIconMaxWidth();
return iconMaxWidth;
}
return getIconDimensionInternal(context, true);
}
public static int getIconMaxHeight(Context context) {
Object systemService;
int iconMaxHeight;
Preconditions.checkNotNull(context);
if (Build.VERSION.SDK_INT >= 25) {
systemService = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
iconMaxHeight = NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService).getIconMaxHeight();
return iconMaxHeight;
}
return getIconDimensionInternal(context, false);
}
public static void reportShortcutUsed(Context context, String str) {
Object systemService;
Preconditions.checkNotNull(context);
Preconditions.checkNotNull(str);
if (Build.VERSION.SDK_INT >= 25) {
systemService = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService).reportShortcutUsed(str);
}
Iterator<ShortcutInfoChangeListener> it = getShortcutInfoListeners(context).iterator();
while (it.hasNext()) {
it.next().onShortcutUsageReported(Collections.singletonList(str));
}
}
public static boolean setDynamicShortcuts(Context context, List<ShortcutInfoCompat> list) {
Object systemService;
boolean dynamicShortcuts;
Preconditions.checkNotNull(context);
Preconditions.checkNotNull(list);
List<ShortcutInfoCompat> removeShortcutsExcludedFromSurface = removeShortcutsExcludedFromSurface(list, 1);
if (Build.VERSION.SDK_INT >= 25) {
ArrayList arrayList = new ArrayList(removeShortcutsExcludedFromSurface.size());
Iterator<ShortcutInfoCompat> it = removeShortcutsExcludedFromSurface.iterator();
while (it.hasNext()) {
arrayList.add(it.next().toShortcutInfo());
}
systemService = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
dynamicShortcuts = NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService).setDynamicShortcuts(arrayList);
if (!dynamicShortcuts) {
return false;
}
}
getShortcutInfoSaverInstance(context).removeAllShortcuts();
getShortcutInfoSaverInstance(context).addShortcuts(removeShortcutsExcludedFromSurface);
for (ShortcutInfoChangeListener shortcutInfoChangeListener : getShortcutInfoListeners(context)) {
shortcutInfoChangeListener.onAllShortcutsRemoved();
shortcutInfoChangeListener.onShortcutAdded(list);
}
return true;
}
public static List<ShortcutInfoCompat> getDynamicShortcuts(Context context) {
Object systemService;
List dynamicShortcuts;
if (Build.VERSION.SDK_INT >= 25) {
systemService = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
dynamicShortcuts = NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService).getDynamicShortcuts();
ArrayList arrayList = new ArrayList(dynamicShortcuts.size());
Iterator it = dynamicShortcuts.iterator();
while (it.hasNext()) {
arrayList.add(new ShortcutInfoCompat.Builder(context, NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m57m(it.next())).build());
}
return arrayList;
}
try {
return getShortcutInfoSaverInstance(context).getShortcuts();
} catch (Exception unused) {
return new ArrayList();
}
}
public static boolean updateShortcuts(Context context, List<ShortcutInfoCompat> list) {
Object systemService;
boolean updateShortcuts;
List<ShortcutInfoCompat> removeShortcutsExcludedFromSurface = removeShortcutsExcludedFromSurface(list, 1);
if (Build.VERSION.SDK_INT <= 29) {
convertUriIconsToBitmapIcons(context, removeShortcutsExcludedFromSurface);
}
if (Build.VERSION.SDK_INT >= 25) {
ArrayList arrayList = new ArrayList();
Iterator<ShortcutInfoCompat> it = removeShortcutsExcludedFromSurface.iterator();
while (it.hasNext()) {
arrayList.add(it.next().toShortcutInfo());
}
systemService = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
updateShortcuts = NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService).updateShortcuts(arrayList);
if (!updateShortcuts) {
return false;
}
}
getShortcutInfoSaverInstance(context).addShortcuts(removeShortcutsExcludedFromSurface);
Iterator<ShortcutInfoChangeListener> it2 = getShortcutInfoListeners(context).iterator();
while (it2.hasNext()) {
it2.next().onShortcutUpdated(list);
}
return true;
}
static boolean convertUriIconToBitmapIcon(Context context, ShortcutInfoCompat shortcutInfoCompat) {
Bitmap decodeStream;
IconCompat createWithBitmap;
if (shortcutInfoCompat.mIcon == null) {
return false;
}
int i = shortcutInfoCompat.mIcon.mType;
if (i != 6 && i != 4) {
return true;
}
InputStream uriInputStream = shortcutInfoCompat.mIcon.getUriInputStream(context);
if (uriInputStream == null || (decodeStream = BitmapFactory.decodeStream(uriInputStream)) == null) {
return false;
}
if (i == 6) {
createWithBitmap = IconCompat.createWithAdaptiveBitmap(decodeStream);
} else {
createWithBitmap = IconCompat.createWithBitmap(decodeStream);
}
shortcutInfoCompat.mIcon = createWithBitmap;
return true;
}
static void convertUriIconsToBitmapIcons(Context context, List<ShortcutInfoCompat> list) {
for (ShortcutInfoCompat shortcutInfoCompat : new ArrayList(list)) {
if (!convertUriIconToBitmapIcon(context, shortcutInfoCompat)) {
list.remove(shortcutInfoCompat);
}
}
}
public static void disableShortcuts(Context context, List<String> list, CharSequence charSequence) {
Object systemService;
if (Build.VERSION.SDK_INT >= 25) {
systemService = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService).disableShortcuts(list, charSequence);
}
getShortcutInfoSaverInstance(context).removeShortcuts(list);
Iterator<ShortcutInfoChangeListener> it = getShortcutInfoListeners(context).iterator();
while (it.hasNext()) {
it.next().onShortcutRemoved(list);
}
}
public static void enableShortcuts(Context context, List<ShortcutInfoCompat> list) {
Object systemService;
List<ShortcutInfoCompat> removeShortcutsExcludedFromSurface = removeShortcutsExcludedFromSurface(list, 1);
if (Build.VERSION.SDK_INT >= 25) {
ArrayList arrayList = new ArrayList(list.size());
Iterator<ShortcutInfoCompat> it = removeShortcutsExcludedFromSurface.iterator();
while (it.hasNext()) {
arrayList.add(it.next().mId);
}
systemService = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService).enableShortcuts(arrayList);
}
getShortcutInfoSaverInstance(context).addShortcuts(removeShortcutsExcludedFromSurface);
Iterator<ShortcutInfoChangeListener> it2 = getShortcutInfoListeners(context).iterator();
while (it2.hasNext()) {
it2.next().onShortcutAdded(list);
}
}
public static void removeDynamicShortcuts(Context context, List<String> list) {
Object systemService;
if (Build.VERSION.SDK_INT >= 25) {
systemService = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService).removeDynamicShortcuts(list);
}
getShortcutInfoSaverInstance(context).removeShortcuts(list);
Iterator<ShortcutInfoChangeListener> it = getShortcutInfoListeners(context).iterator();
while (it.hasNext()) {
it.next().onShortcutRemoved(list);
}
}
public static void removeAllDynamicShortcuts(Context context) {
Object systemService;
if (Build.VERSION.SDK_INT >= 25) {
systemService = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService).removeAllDynamicShortcuts();
}
getShortcutInfoSaverInstance(context).removeAllShortcuts();
Iterator<ShortcutInfoChangeListener> it = getShortcutInfoListeners(context).iterator();
while (it.hasNext()) {
it.next().onAllShortcutsRemoved();
}
}
public static void removeLongLivedShortcuts(Context context, List<String> list) {
Object systemService;
if (Build.VERSION.SDK_INT < 30) {
removeDynamicShortcuts(context, list);
return;
}
systemService = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService).removeLongLivedShortcuts(list);
getShortcutInfoSaverInstance(context).removeShortcuts(list);
Iterator<ShortcutInfoChangeListener> it = getShortcutInfoListeners(context).iterator();
while (it.hasNext()) {
it.next().onShortcutRemoved(list);
}
}
public static boolean pushDynamicShortcut(Context context, ShortcutInfoCompat shortcutInfoCompat) {
Object systemService;
boolean isRateLimitingActive;
List dynamicShortcuts;
Object systemService2;
Preconditions.checkNotNull(context);
Preconditions.checkNotNull(shortcutInfoCompat);
if (Build.VERSION.SDK_INT <= 31 && shortcutInfoCompat.isExcludedFromSurfaces(1)) {
Iterator<ShortcutInfoChangeListener> it = getShortcutInfoListeners(context).iterator();
while (it.hasNext()) {
it.next().onShortcutAdded(Collections.singletonList(shortcutInfoCompat));
}
return true;
}
int maxShortcutCountPerActivity = getMaxShortcutCountPerActivity(context);
if (maxShortcutCountPerActivity == 0) {
return false;
}
if (Build.VERSION.SDK_INT <= 29) {
convertUriIconToBitmapIcon(context, shortcutInfoCompat);
}
if (Build.VERSION.SDK_INT >= 30) {
systemService2 = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService2).pushDynamicShortcut(shortcutInfoCompat.toShortcutInfo());
} else if (Build.VERSION.SDK_INT >= 25) {
systemService = context.getSystemService((Class<Object>) NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m$3());
ShortcutManager m58m = NotificationCompat$Style$$ExternalSyntheticApiModelOutline0.m58m(systemService);
isRateLimitingActive = m58m.isRateLimitingActive();
if (isRateLimitingActive) {
return false;
}
dynamicShortcuts = m58m.getDynamicShortcuts();
if (dynamicShortcuts.size() >= maxShortcutCountPerActivity) {
m58m.removeDynamicShortcuts(Arrays.asList(Api25Impl.getShortcutInfoWithLowestRank(dynamicShortcuts)));
}
m58m.addDynamicShortcuts(Arrays.asList(shortcutInfoCompat.toShortcutInfo()));
}
ShortcutInfoCompatSaver<?> shortcutInfoSaverInstance = getShortcutInfoSaverInstance(context);
try {
List<ShortcutInfoCompat> shortcuts = shortcutInfoSaverInstance.getShortcuts();
if (shortcuts.size() >= maxShortcutCountPerActivity) {
shortcutInfoSaverInstance.removeShortcuts(Arrays.asList(getShortcutInfoCompatWithLowestRank(shortcuts)));
}
shortcutInfoSaverInstance.addShortcuts(Arrays.asList(shortcutInfoCompat));
Iterator<ShortcutInfoChangeListener> it2 = getShortcutInfoListeners(context).iterator();
while (it2.hasNext()) {
it2.next().onShortcutAdded(Collections.singletonList(shortcutInfoCompat));
}
reportShortcutUsed(context, shortcutInfoCompat.getId());
return true;
} catch (Exception unused) {
Iterator<ShortcutInfoChangeListener> it3 = getShortcutInfoListeners(context).iterator();
while (it3.hasNext()) {
it3.next().onShortcutAdded(Collections.singletonList(shortcutInfoCompat));
}
reportShortcutUsed(context, shortcutInfoCompat.getId());
return false;
} catch (Throwable th) {
Iterator<ShortcutInfoChangeListener> it4 = getShortcutInfoListeners(context).iterator();
while (it4.hasNext()) {
it4.next().onShortcutAdded(Collections.singletonList(shortcutInfoCompat));
}
reportShortcutUsed(context, shortcutInfoCompat.getId());
throw th;
}
}
private static String getShortcutInfoCompatWithLowestRank(List<ShortcutInfoCompat> list) {
int i = -1;
String str = null;
for (ShortcutInfoCompat shortcutInfoCompat : list) {
if (shortcutInfoCompat.getRank() > i) {
str = shortcutInfoCompat.getId();
i = shortcutInfoCompat.getRank();
}
}
return str;
}
private static int getIconDimensionInternal(Context context, boolean z) {
ActivityManager activityManager = (ActivityManager) context.getSystemService("activity");
int max = Math.max(1, activityManager == null || activityManager.isLowRamDevice() ? 48 : 96);
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
return (int) (max * ((z ? displayMetrics.xdpi : displayMetrics.ydpi) / 160.0f));
}
private static ShortcutInfoCompatSaver<?> getShortcutInfoSaverInstance(Context context) {
if (sShortcutInfoCompatSaver == null) {
if (Build.VERSION.SDK_INT >= 23) {
try {
sShortcutInfoCompatSaver = (ShortcutInfoCompatSaver) Class.forName("androidx.sharetarget.ShortcutInfoCompatSaverImpl", false, ShortcutManagerCompat.class.getClassLoader()).getMethod("getInstance", Context.class).invoke(null, context);
} catch (Exception unused) {
}
}
if (sShortcutInfoCompatSaver == null) {
sShortcutInfoCompatSaver = new ShortcutInfoCompatSaver.NoopImpl();
}
}
return sShortcutInfoCompatSaver;
}
private static List<ShortcutInfoChangeListener> getShortcutInfoListeners(Context context) {
Bundle bundle;
String string;
if (sShortcutInfoChangeListeners == null) {
ArrayList arrayList = new ArrayList();
PackageManager packageManager = context.getPackageManager();
Intent intent = new Intent(SHORTCUT_LISTENER_INTENT_FILTER_ACTION);
intent.setPackage(context.getPackageName());
Iterator<ResolveInfo> it = packageManager.queryIntentActivities(intent, 128).iterator();
while (it.hasNext()) {
ActivityInfo activityInfo = it.next().activityInfo;
if (activityInfo != null && (bundle = activityInfo.metaData) != null && (string = bundle.getString(SHORTCUT_LISTENER_META_DATA_KEY)) != null) {
try {
arrayList.add((ShortcutInfoChangeListener) Class.forName(string, false, ShortcutManagerCompat.class.getClassLoader()).getMethod("getInstance", Context.class).invoke(null, context));
} catch (Exception unused) {
}
}
}
if (sShortcutInfoChangeListeners == null) {
sShortcutInfoChangeListeners = arrayList;
}
}
return sShortcutInfoChangeListeners;
}
private static List<ShortcutInfoCompat> removeShortcutsExcludedFromSurface(List<ShortcutInfoCompat> list, int i) {
Objects.requireNonNull(list);
if (Build.VERSION.SDK_INT > 31) {
return list;
}
ArrayList arrayList = new ArrayList(list);
for (ShortcutInfoCompat shortcutInfoCompat : list) {
if (shortcutInfoCompat.isExcludedFromSurfaces(i)) {
arrayList.remove(shortcutInfoCompat);
}
}
return arrayList;
}
private static class Api25Impl {
private Api25Impl() {
}
static String getShortcutInfoWithLowestRank(List<ShortcutInfo> list) {
int i = -1;
String str = null;
for (ShortcutInfo shortcutInfo : list) {
if (shortcutInfo.getRank() > i) {
str = shortcutInfo.getId();
i = shortcutInfo.getRank();
}
}
return str;
}
}
}

View File

@ -0,0 +1,102 @@
package androidx.core.content.pm;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.ResolveInfo;
import android.content.res.XmlResourceParser;
import android.os.Bundle;
import android.util.Log;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
/* loaded from: classes.dex */
public class ShortcutXmlParser {
private static final String ATTR_SHORTCUT_ID = "shortcutId";
private static final Object GET_INSTANCE_LOCK = new Object();
private static final String META_DATA_APP_SHORTCUTS = "android.app.shortcuts";
private static final String TAG = "ShortcutXmlParser";
private static final String TAG_SHORTCUT = "shortcut";
private static volatile ArrayList<String> sShortcutIds;
public static List<String> getShortcutIds(Context context) {
if (sShortcutIds == null) {
synchronized (GET_INSTANCE_LOCK) {
if (sShortcutIds == null) {
sShortcutIds = new ArrayList<>();
sShortcutIds.addAll(parseShortcutIds(context));
}
}
}
return sShortcutIds;
}
private ShortcutXmlParser() {
}
private static Set<String> parseShortcutIds(Context context) {
HashSet hashSet = new HashSet();
Intent intent = new Intent("android.intent.action.MAIN");
intent.addCategory("android.intent.category.LAUNCHER");
intent.setPackage(context.getPackageName());
List<ResolveInfo> queryIntentActivities = context.getPackageManager().queryIntentActivities(intent, 128);
if (queryIntentActivities != null && queryIntentActivities.size() != 0) {
try {
Iterator<ResolveInfo> it = queryIntentActivities.iterator();
while (it.hasNext()) {
ActivityInfo activityInfo = it.next().activityInfo;
Bundle bundle = activityInfo.metaData;
if (bundle != null && bundle.containsKey(META_DATA_APP_SHORTCUTS)) {
XmlResourceParser xmlResourceParser = getXmlResourceParser(context, activityInfo);
try {
hashSet.addAll(parseShortcutIds(xmlResourceParser));
if (xmlResourceParser != null) {
xmlResourceParser.close();
}
} finally {
}
}
}
} catch (Exception e) {
Log.e(TAG, "Failed to parse the Xml resource: ", e);
}
}
return hashSet;
}
private static XmlResourceParser getXmlResourceParser(Context context, ActivityInfo activityInfo) {
XmlResourceParser loadXmlMetaData = activityInfo.loadXmlMetaData(context.getPackageManager(), META_DATA_APP_SHORTCUTS);
if (loadXmlMetaData != null) {
return loadXmlMetaData;
}
throw new IllegalArgumentException("Failed to open android.app.shortcuts meta-data resource of " + activityInfo.name);
}
public static List<String> parseShortcutIds(XmlPullParser xmlPullParser) throws IOException, XmlPullParserException {
String attributeValue;
ArrayList arrayList = new ArrayList(1);
while (true) {
int next = xmlPullParser.next();
if (next == 1 || (next == 3 && xmlPullParser.getDepth() <= 0)) {
break;
}
int depth = xmlPullParser.getDepth();
String name = xmlPullParser.getName();
if (next == 2 && depth == 2 && TAG_SHORTCUT.equals(name) && (attributeValue = getAttributeValue(xmlPullParser, ATTR_SHORTCUT_ID)) != null) {
arrayList.add(attributeValue);
}
}
return arrayList;
}
private static String getAttributeValue(XmlPullParser xmlPullParser, String str) {
String attributeValue = xmlPullParser.getAttributeValue("http://schemas.android.com/apk/res/android", str);
return attributeValue == null ? xmlPullParser.getAttributeValue(null, str) : attributeValue;
}
}

View File

@ -0,0 +1,244 @@
package androidx.core.content.res;
import androidx.core.graphics.ColorUtils;
/* loaded from: classes.dex */
class CamColor {
private static final float CHROMA_SEARCH_ENDPOINT = 0.4f;
private static final float DE_MAX = 1.0f;
private static final float DL_MAX = 0.2f;
private static final float LIGHTNESS_SEARCH_ENDPOINT = 0.01f;
private final float mAstar;
private final float mBstar;
private final float mChroma;
private final float mHue;
private final float mJ;
private final float mJstar;
private final float mM;
private final float mQ;
private final float mS;
float getAStar() {
return this.mAstar;
}
float getBStar() {
return this.mBstar;
}
float getChroma() {
return this.mChroma;
}
float getHue() {
return this.mHue;
}
float getJ() {
return this.mJ;
}
float getJStar() {
return this.mJstar;
}
float getM() {
return this.mM;
}
float getQ() {
return this.mQ;
}
float getS() {
return this.mS;
}
CamColor(float f, float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9) {
this.mHue = f;
this.mChroma = f2;
this.mJ = f3;
this.mQ = f4;
this.mM = f5;
this.mS = f6;
this.mJstar = f7;
this.mAstar = f8;
this.mBstar = f9;
}
static int toColor(float f, float f2, float f3) {
return toColor(f, f2, f3, ViewingConditions.DEFAULT);
}
static CamColor fromColor(int i) {
return fromColorInViewingConditions(i, ViewingConditions.DEFAULT);
}
static CamColor fromColorInViewingConditions(int i, ViewingConditions viewingConditions) {
float[] xyzFromInt = CamUtils.xyzFromInt(i);
float[][] fArr = CamUtils.XYZ_TO_CAM16RGB;
float f = xyzFromInt[0];
float[] fArr2 = fArr[0];
float f2 = fArr2[0] * f;
float f3 = xyzFromInt[1];
float f4 = f2 + (fArr2[1] * f3);
float f5 = xyzFromInt[2];
float f6 = f4 + (fArr2[2] * f5);
float[] fArr3 = fArr[1];
float f7 = (fArr3[0] * f) + (fArr3[1] * f3) + (fArr3[2] * f5);
float[] fArr4 = fArr[2];
float f8 = (f * fArr4[0]) + (f3 * fArr4[1]) + (f5 * fArr4[2]);
float f9 = viewingConditions.getRgbD()[0] * f6;
float f10 = viewingConditions.getRgbD()[1] * f7;
float f11 = viewingConditions.getRgbD()[2] * f8;
float pow = (float) Math.pow((viewingConditions.getFl() * Math.abs(f9)) / 100.0d, 0.42d);
float pow2 = (float) Math.pow((viewingConditions.getFl() * Math.abs(f10)) / 100.0d, 0.42d);
float pow3 = (float) Math.pow((viewingConditions.getFl() * Math.abs(f11)) / 100.0d, 0.42d);
float signum = ((Math.signum(f9) * 400.0f) * pow) / (pow + 27.13f);
float signum2 = ((Math.signum(f10) * 400.0f) * pow2) / (pow2 + 27.13f);
float signum3 = ((Math.signum(f11) * 400.0f) * pow3) / (pow3 + 27.13f);
double d = signum3;
float f12 = ((float) (((signum * 11.0d) + (signum2 * (-12.0d))) + d)) / 11.0f;
float f13 = ((float) ((signum + signum2) - (d * 2.0d))) / 9.0f;
float f14 = signum2 * 20.0f;
float f15 = (((signum * 20.0f) + f14) + (21.0f * signum3)) / 20.0f;
float f16 = (((signum * 40.0f) + f14) + signum3) / 20.0f;
float atan2 = (((float) Math.atan2(f13, f12)) * 180.0f) / 3.1415927f;
if (atan2 < 0.0f) {
atan2 += 360.0f;
} else if (atan2 >= 360.0f) {
atan2 -= 360.0f;
}
float f17 = atan2;
float f18 = (3.1415927f * f17) / 180.0f;
float pow4 = ((float) Math.pow((f16 * viewingConditions.getNbb()) / viewingConditions.getAw(), viewingConditions.getC() * viewingConditions.getZ())) * 100.0f;
float flRoot = viewingConditions.getFlRoot() * (4.0f / viewingConditions.getC()) * ((float) Math.sqrt(pow4 / 100.0f)) * (viewingConditions.getAw() + 4.0f);
float pow5 = ((float) Math.pow(1.64d - Math.pow(0.29d, viewingConditions.getN()), 0.73d)) * ((float) Math.pow((((((((float) (Math.cos((((((double) f17) < 20.14d ? 360.0f + f17 : f17) * 3.141592653589793d) / 180.0d) + 2.0d) + 3.8d)) * 0.25f) * 3846.1538f) * viewingConditions.getNc()) * viewingConditions.getNcb()) * ((float) Math.sqrt((f12 * f12) + (f13 * f13)))) / (f15 + 0.305f), 0.9d)) * ((float) Math.sqrt(pow4 / 100.0d));
float flRoot2 = pow5 * viewingConditions.getFlRoot();
float sqrt = ((float) Math.sqrt((r3 * viewingConditions.getC()) / (viewingConditions.getAw() + 4.0f))) * 50.0f;
float f19 = (1.7f * pow4) / ((0.007f * pow4) + 1.0f);
float log = ((float) Math.log((0.0228f * flRoot2) + 1.0f)) * 43.85965f;
double d2 = f18;
return new CamColor(f17, pow5, pow4, flRoot, flRoot2, sqrt, f19, log * ((float) Math.cos(d2)), log * ((float) Math.sin(d2)));
}
private static CamColor fromJch(float f, float f2, float f3) {
return fromJchInFrame(f, f2, f3, ViewingConditions.DEFAULT);
}
private static CamColor fromJchInFrame(float f, float f2, float f3, ViewingConditions viewingConditions) {
float c = (4.0f / viewingConditions.getC()) * ((float) Math.sqrt(f / 100.0d)) * (viewingConditions.getAw() + 4.0f) * viewingConditions.getFlRoot();
float flRoot = f2 * viewingConditions.getFlRoot();
float sqrt = ((float) Math.sqrt(((f2 / ((float) Math.sqrt(r4))) * viewingConditions.getC()) / (viewingConditions.getAw() + 4.0f))) * 50.0f;
float f4 = (1.7f * f) / ((0.007f * f) + 1.0f);
float log = ((float) Math.log((flRoot * 0.0228d) + 1.0d)) * 43.85965f;
double d = (3.1415927f * f3) / 180.0f;
return new CamColor(f3, f2, f, c, flRoot, sqrt, f4, log * ((float) Math.cos(d)), log * ((float) Math.sin(d)));
}
float distance(CamColor camColor) {
float jStar = getJStar() - camColor.getJStar();
float aStar = getAStar() - camColor.getAStar();
float bStar = getBStar() - camColor.getBStar();
return (float) (Math.pow(Math.sqrt((jStar * jStar) + (aStar * aStar) + (bStar * bStar)), 0.63d) * 1.41d);
}
int viewedInSrgb() {
return viewed(ViewingConditions.DEFAULT);
}
int viewed(ViewingConditions viewingConditions) {
float pow = (float) Math.pow(((((double) getChroma()) == 0.0d || ((double) getJ()) == 0.0d) ? 0.0f : getChroma() / ((float) Math.sqrt(getJ() / 100.0d))) / Math.pow(1.64d - Math.pow(0.29d, viewingConditions.getN()), 0.73d), 1.1111111111111112d);
double hue = (getHue() * 3.1415927f) / 180.0f;
float cos = ((float) (Math.cos(2.0d + hue) + 3.8d)) * 0.25f;
float aw = viewingConditions.getAw() * ((float) Math.pow(getJ() / 100.0d, (1.0d / viewingConditions.getC()) / viewingConditions.getZ()));
float nc = cos * 3846.1538f * viewingConditions.getNc() * viewingConditions.getNcb();
float nbb = aw / viewingConditions.getNbb();
float sin = (float) Math.sin(hue);
float cos2 = (float) Math.cos(hue);
float f = (((0.305f + nbb) * 23.0f) * pow) / (((nc * 23.0f) + ((11.0f * pow) * cos2)) + ((pow * 108.0f) * sin));
float f2 = cos2 * f;
float f3 = f * sin;
float f4 = nbb * 460.0f;
float f5 = (((451.0f * f2) + f4) + (288.0f * f3)) / 1403.0f;
float f6 = ((f4 - (891.0f * f2)) - (261.0f * f3)) / 1403.0f;
float signum = Math.signum(f5) * (100.0f / viewingConditions.getFl()) * ((float) Math.pow((float) Math.max(0.0d, (Math.abs(f5) * 27.13d) / (400.0d - Math.abs(f5))), 2.380952380952381d));
float signum2 = Math.signum(f6) * (100.0f / viewingConditions.getFl()) * ((float) Math.pow((float) Math.max(0.0d, (Math.abs(f6) * 27.13d) / (400.0d - Math.abs(f6))), 2.380952380952381d));
float signum3 = Math.signum(((f4 - (f2 * 220.0f)) - (f3 * 6300.0f)) / 1403.0f) * (100.0f / viewingConditions.getFl()) * ((float) Math.pow((float) Math.max(0.0d, (Math.abs(r8) * 27.13d) / (400.0d - Math.abs(r8))), 2.380952380952381d));
float f7 = signum / viewingConditions.getRgbD()[0];
float f8 = signum2 / viewingConditions.getRgbD()[1];
float f9 = signum3 / viewingConditions.getRgbD()[2];
float[][] fArr = CamUtils.CAM16RGB_TO_XYZ;
float[] fArr2 = fArr[0];
float f10 = (fArr2[0] * f7) + (fArr2[1] * f8) + (fArr2[2] * f9);
float[] fArr3 = fArr[1];
float f11 = (fArr3[0] * f7) + (fArr3[1] * f8) + (fArr3[2] * f9);
float[] fArr4 = fArr[2];
return ColorUtils.XYZToColor(f10, f11, (f7 * fArr4[0]) + (f8 * fArr4[1]) + (f9 * fArr4[2]));
}
static int toColor(float f, float f2, float f3, ViewingConditions viewingConditions) {
if (f2 < 1.0d || Math.round(f3) <= 0.0d || Math.round(f3) >= 100.0d) {
return CamUtils.intFromLStar(f3);
}
float min = f < 0.0f ? 0.0f : Math.min(360.0f, f);
float f4 = f2;
CamColor camColor = null;
float f5 = 0.0f;
boolean z = true;
while (Math.abs(f5 - f2) >= CHROMA_SEARCH_ENDPOINT) {
CamColor findCamByJ = findCamByJ(min, f4, f3);
if (!z) {
if (findCamByJ == null) {
f2 = f4;
} else {
f5 = f4;
camColor = findCamByJ;
}
f4 = ((f2 - f5) / 2.0f) + f5;
} else {
if (findCamByJ != null) {
return findCamByJ.viewed(viewingConditions);
}
f4 = ((f2 - f5) / 2.0f) + f5;
z = false;
}
}
if (camColor == null) {
return CamUtils.intFromLStar(f3);
}
return camColor.viewed(viewingConditions);
}
private static CamColor findCamByJ(float f, float f2, float f3) {
float f4 = 100.0f;
float f5 = 1000.0f;
CamColor camColor = null;
float f6 = 1000.0f;
float f7 = 0.0f;
while (Math.abs(f7 - f4) > LIGHTNESS_SEARCH_ENDPOINT) {
float f8 = ((f4 - f7) / 2.0f) + f7;
int viewedInSrgb = fromJch(f8, f2, f).viewedInSrgb();
float lStarFromInt = CamUtils.lStarFromInt(viewedInSrgb);
float abs = Math.abs(f3 - lStarFromInt);
if (abs < 0.2f) {
CamColor fromColor = fromColor(viewedInSrgb);
float distance = fromColor.distance(fromJch(fromColor.getJ(), fromColor.getChroma(), f));
if (distance <= 1.0f) {
camColor = fromColor;
f5 = abs;
f6 = distance;
}
}
if (f5 == 0.0f && f6 == 0.0f) {
break;
}
if (lStarFromInt < f3) {
f7 = f8;
} else {
f4 = f8;
}
}
return camColor;
}
}

View File

@ -0,0 +1,78 @@
package androidx.core.content.res;
import android.graphics.Color;
import androidx.core.graphics.ColorUtils;
import androidx.core.view.ViewCompat;
/* loaded from: classes.dex */
final class CamUtils {
static final float[][] XYZ_TO_CAM16RGB = {new float[]{0.401288f, 0.650173f, -0.051461f}, new float[]{-0.250268f, 1.204414f, 0.045854f}, new float[]{-0.002079f, 0.048952f, 0.953127f}};
static final float[][] CAM16RGB_TO_XYZ = {new float[]{1.8620678f, -1.0112547f, 0.14918678f}, new float[]{0.38752654f, 0.62144744f, -0.00897398f}, new float[]{-0.0158415f, -0.03412294f, 1.0499644f}};
static final float[] WHITE_POINT_D65 = {95.047f, 100.0f, 108.883f};
static final float[][] SRGB_TO_XYZ = {new float[]{0.41233894f, 0.35762063f, 0.18051042f}, new float[]{0.2126f, 0.7152f, 0.0722f}, new float[]{0.01932141f, 0.11916382f, 0.9503448f}};
static float lerp(float f, float f2, float f3) {
return f + ((f2 - f) * f3);
}
private CamUtils() {
}
static int intFromLStar(float f) {
if (f < 1.0f) {
return ViewCompat.MEASURED_STATE_MASK;
}
if (f > 99.0f) {
return -1;
}
float f2 = (f + 16.0f) / 116.0f;
float f3 = f > 8.0f ? f2 * f2 * f2 : f / 903.2963f;
float f4 = f2 * f2 * f2;
boolean z = f4 > 0.008856452f;
float f5 = z ? f4 : ((f2 * 116.0f) - 16.0f) / 903.2963f;
if (!z) {
f4 = ((f2 * 116.0f) - 16.0f) / 903.2963f;
}
float[] fArr = WHITE_POINT_D65;
return ColorUtils.XYZToColor(f5 * fArr[0], f3 * fArr[1], f4 * fArr[2]);
}
static float lStarFromInt(int i) {
return lStarFromY(yFromInt(i));
}
static float lStarFromY(float f) {
float f2 = f / 100.0f;
return f2 <= 0.008856452f ? f2 * 903.2963f : (((float) Math.cbrt(f2)) * 116.0f) - 16.0f;
}
static float yFromInt(int i) {
float linearized = linearized(Color.red(i));
float linearized2 = linearized(Color.green(i));
float linearized3 = linearized(Color.blue(i));
float[] fArr = SRGB_TO_XYZ[1];
return (linearized * fArr[0]) + (linearized2 * fArr[1]) + (linearized3 * fArr[2]);
}
static float[] xyzFromInt(int i) {
float linearized = linearized(Color.red(i));
float linearized2 = linearized(Color.green(i));
float linearized3 = linearized(Color.blue(i));
float[][] fArr = SRGB_TO_XYZ;
float[] fArr2 = fArr[0];
float f = (fArr2[0] * linearized) + (fArr2[1] * linearized2) + (fArr2[2] * linearized3);
float[] fArr3 = fArr[1];
float f2 = (fArr3[0] * linearized) + (fArr3[1] * linearized2) + (fArr3[2] * linearized3);
float[] fArr4 = fArr[2];
return new float[]{f, f2, (linearized * fArr4[0]) + (linearized2 * fArr4[1]) + (linearized3 * fArr4[2])};
}
static float yFromLStar(float f) {
return (f > 8.0f ? (float) Math.pow((f + 16.0d) / 116.0d, 3.0d) : f / 903.2963f) * 100.0f;
}
static float linearized(int i) {
float f = i / 255.0f;
return (f <= 0.04045f ? f / 12.92f : (float) Math.pow((f + 0.055f) / 1.055f, 2.4000000953674316d)) * 100.0f;
}
}

View File

@ -0,0 +1,163 @@
package androidx.core.content.res;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.os.Build;
import android.util.AttributeSet;
import android.util.Log;
import android.util.StateSet;
import android.util.TypedValue;
import android.util.Xml;
import androidx.core.R;
import androidx.core.math.MathUtils;
import androidx.core.view.ViewCompat;
import java.io.IOException;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
/* loaded from: classes.dex */
public final class ColorStateListInflaterCompat {
private static final ThreadLocal<TypedValue> sTempTypedValue = new ThreadLocal<>();
private ColorStateListInflaterCompat() {
}
public static ColorStateList inflate(Resources resources, int i, Resources.Theme theme) {
try {
return createFromXml(resources, resources.getXml(i), theme);
} catch (Exception e) {
Log.e("CSLCompat", "Failed to inflate ColorStateList.", e);
return null;
}
}
public static ColorStateList createFromXml(Resources resources, XmlPullParser xmlPullParser, Resources.Theme theme) throws XmlPullParserException, IOException {
int next;
AttributeSet asAttributeSet = Xml.asAttributeSet(xmlPullParser);
do {
next = xmlPullParser.next();
if (next == 2) {
break;
}
} while (next != 1);
if (next != 2) {
throw new XmlPullParserException("No start tag found");
}
return createFromXmlInner(resources, xmlPullParser, asAttributeSet, theme);
}
public static ColorStateList createFromXmlInner(Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet, Resources.Theme theme) throws XmlPullParserException, IOException {
String name = xmlPullParser.getName();
if (!name.equals("selector")) {
throw new XmlPullParserException(xmlPullParser.getPositionDescription() + ": invalid color state list tag " + name);
}
return inflate(resources, xmlPullParser, attributeSet, theme);
}
private static ColorStateList inflate(Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet, Resources.Theme theme) throws XmlPullParserException, IOException {
int depth;
int color;
float f;
Resources resources2 = resources;
int i = 1;
int depth2 = xmlPullParser.getDepth() + 1;
int[][] iArr = new int[20][];
int[] iArr2 = new int[20];
int i2 = 0;
while (true) {
int next = xmlPullParser.next();
if (next == i || ((depth = xmlPullParser.getDepth()) < depth2 && next == 3)) {
break;
}
if (next == 2 && depth <= depth2 && xmlPullParser.getName().equals("item")) {
TypedArray obtainAttributes = obtainAttributes(resources2, theme, attributeSet, R.styleable.ColorStateListItem);
int resourceId = obtainAttributes.getResourceId(R.styleable.ColorStateListItem_android_color, -1);
if (resourceId != -1 && !isColorInt(resources2, resourceId)) {
try {
color = createFromXml(resources2, resources2.getXml(resourceId), theme).getDefaultColor();
} catch (Exception unused) {
color = obtainAttributes.getColor(R.styleable.ColorStateListItem_android_color, -65281);
}
} else {
color = obtainAttributes.getColor(R.styleable.ColorStateListItem_android_color, -65281);
}
float f2 = 1.0f;
if (obtainAttributes.hasValue(R.styleable.ColorStateListItem_android_alpha)) {
f2 = obtainAttributes.getFloat(R.styleable.ColorStateListItem_android_alpha, 1.0f);
} else if (obtainAttributes.hasValue(R.styleable.ColorStateListItem_alpha)) {
f2 = obtainAttributes.getFloat(R.styleable.ColorStateListItem_alpha, 1.0f);
}
if (Build.VERSION.SDK_INT >= 31 && obtainAttributes.hasValue(R.styleable.ColorStateListItem_android_lStar)) {
f = obtainAttributes.getFloat(R.styleable.ColorStateListItem_android_lStar, -1.0f);
} else {
f = obtainAttributes.getFloat(R.styleable.ColorStateListItem_lStar, -1.0f);
}
obtainAttributes.recycle();
int attributeCount = attributeSet.getAttributeCount();
int[] iArr3 = new int[attributeCount];
int i3 = 0;
for (int i4 = 0; i4 < attributeCount; i4++) {
int attributeNameResource = attributeSet.getAttributeNameResource(i4);
if (attributeNameResource != 16843173 && attributeNameResource != 16843551 && attributeNameResource != R.attr.alpha && attributeNameResource != R.attr.lStar) {
int i5 = i3 + 1;
if (!attributeSet.getAttributeBooleanValue(i4, false)) {
attributeNameResource = -attributeNameResource;
}
iArr3[i3] = attributeNameResource;
i3 = i5;
}
}
int[] trimStateSet = StateSet.trimStateSet(iArr3, i3);
iArr2 = GrowingArrayUtils.append(iArr2, i2, modulateColorAlpha(color, f2, f));
iArr = (int[][]) GrowingArrayUtils.append(iArr, i2, trimStateSet);
i2++;
}
i = 1;
resources2 = resources;
}
int[] iArr4 = new int[i2];
int[][] iArr5 = new int[i2][];
System.arraycopy(iArr2, 0, iArr4, 0, i2);
System.arraycopy(iArr, 0, iArr5, 0, i2);
return new ColorStateList(iArr5, iArr4);
}
private static boolean isColorInt(Resources resources, int i) {
TypedValue typedValue = getTypedValue();
resources.getValue(i, typedValue, true);
return typedValue.type >= 28 && typedValue.type <= 31;
}
private static TypedValue getTypedValue() {
ThreadLocal<TypedValue> threadLocal = sTempTypedValue;
TypedValue typedValue = threadLocal.get();
if (typedValue != null) {
return typedValue;
}
TypedValue typedValue2 = new TypedValue();
threadLocal.set(typedValue2);
return typedValue2;
}
private static TypedArray obtainAttributes(Resources resources, Resources.Theme theme, AttributeSet attributeSet, int[] iArr) {
if (theme == null) {
return resources.obtainAttributes(attributeSet, iArr);
}
return theme.obtainStyledAttributes(attributeSet, iArr, 0, 0);
}
private static int modulateColorAlpha(int i, float f, float f2) {
boolean z = f2 >= 0.0f && f2 <= 100.0f;
if (f == 1.0f && !z) {
return i;
}
int clamp = MathUtils.clamp((int) ((Color.alpha(i) * f) + 0.5f), 0, 255);
if (z) {
CamColor fromColor = CamColor.fromColor(i);
i = CamColor.toColor(fromColor.getHue(), fromColor.getChroma(), f2);
}
return (i & ViewCompat.MEASURED_SIZE_MASK) | (clamp << 24);
}
}

View File

@ -0,0 +1,107 @@
package androidx.core.content.res;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
import android.graphics.Shader;
import android.util.AttributeSet;
import android.util.Log;
import android.util.Xml;
import java.io.IOException;
import org.xmlpull.v1.XmlPullParserException;
/* loaded from: classes.dex */
public final class ComplexColorCompat {
private static final String LOG_TAG = "ComplexColorCompat";
private int mColor;
private final ColorStateList mColorStateList;
private final Shader mShader;
public int getColor() {
return this.mColor;
}
public Shader getShader() {
return this.mShader;
}
public boolean isGradient() {
return this.mShader != null;
}
public void setColor(int i) {
this.mColor = i;
}
private ComplexColorCompat(Shader shader, ColorStateList colorStateList, int i) {
this.mShader = shader;
this.mColorStateList = colorStateList;
this.mColor = i;
}
static ComplexColorCompat from(Shader shader) {
return new ComplexColorCompat(shader, null, 0);
}
static ComplexColorCompat from(ColorStateList colorStateList) {
return new ComplexColorCompat(null, colorStateList, colorStateList.getDefaultColor());
}
static ComplexColorCompat from(int i) {
return new ComplexColorCompat(null, null, i);
}
public boolean isStateful() {
ColorStateList colorStateList;
return this.mShader == null && (colorStateList = this.mColorStateList) != null && colorStateList.isStateful();
}
public boolean onStateChanged(int[] iArr) {
if (isStateful()) {
ColorStateList colorStateList = this.mColorStateList;
int colorForState = colorStateList.getColorForState(iArr, colorStateList.getDefaultColor());
if (colorForState != this.mColor) {
this.mColor = colorForState;
return true;
}
}
return false;
}
public boolean willDraw() {
return isGradient() || this.mColor != 0;
}
public static ComplexColorCompat inflate(Resources resources, int i, Resources.Theme theme) {
try {
return createFromXml(resources, i, theme);
} catch (Exception e) {
Log.e(LOG_TAG, "Failed to inflate ComplexColor.", e);
return null;
}
}
private static ComplexColorCompat createFromXml(Resources resources, int i, Resources.Theme theme) throws IOException, XmlPullParserException {
int next;
XmlResourceParser xml = resources.getXml(i);
AttributeSet asAttributeSet = Xml.asAttributeSet(xml);
do {
next = xml.next();
if (next == 2) {
break;
}
} while (next != 1);
if (next != 2) {
throw new XmlPullParserException("No start tag found");
}
String name = xml.getName();
name.hashCode();
if (name.equals("gradient")) {
return from(GradientColorInflaterCompat.createFromXmlInner(resources, xml, asAttributeSet, theme));
}
if (name.equals("selector")) {
return from(ColorStateListInflaterCompat.createFromXmlInner(resources, xml, asAttributeSet, theme));
}
throw new XmlPullParserException(xml.getPositionDescription() + ": unsupported complex color tag " + name);
}
}

View File

@ -0,0 +1,13 @@
package androidx.core.content.res;
import android.content.res.Resources;
/* loaded from: classes.dex */
public final class ConfigurationHelper {
private ConfigurationHelper() {
}
public static int getDensityDpi(Resources resources) {
return resources.getConfiguration().densityDpi;
}
}

View File

@ -0,0 +1,283 @@
package androidx.core.content.res;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.util.Base64;
import android.util.Xml;
import androidx.core.R;
import androidx.core.provider.FontRequest;
import java.io.IOException;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
/* loaded from: classes.dex */
public class FontResourcesParserCompat {
private static final int DEFAULT_TIMEOUT_MILLIS = 500;
public static final int FETCH_STRATEGY_ASYNC = 1;
public static final int FETCH_STRATEGY_BLOCKING = 0;
public static final int INFINITE_TIMEOUT_VALUE = -1;
private static final int ITALIC = 1;
private static final int NORMAL_WEIGHT = 400;
public interface FamilyResourceEntry {
}
@Retention(RetentionPolicy.SOURCE)
public @interface FetchStrategy {
}
public static final class ProviderResourceEntry implements FamilyResourceEntry {
private final FontRequest mRequest;
private final int mStrategy;
private final String mSystemFontFamilyName;
private final int mTimeoutMs;
public int getFetchStrategy() {
return this.mStrategy;
}
public FontRequest getRequest() {
return this.mRequest;
}
public String getSystemFontFamilyName() {
return this.mSystemFontFamilyName;
}
public int getTimeout() {
return this.mTimeoutMs;
}
public ProviderResourceEntry(FontRequest fontRequest, int i, int i2, String str) {
this.mRequest = fontRequest;
this.mStrategy = i;
this.mTimeoutMs = i2;
this.mSystemFontFamilyName = str;
}
public ProviderResourceEntry(FontRequest fontRequest, int i, int i2) {
this(fontRequest, i, i2, null);
}
}
public static final class FontFileResourceEntry {
private final String mFileName;
private final boolean mItalic;
private final int mResourceId;
private final int mTtcIndex;
private final String mVariationSettings;
private final int mWeight;
public String getFileName() {
return this.mFileName;
}
public int getResourceId() {
return this.mResourceId;
}
public int getTtcIndex() {
return this.mTtcIndex;
}
public String getVariationSettings() {
return this.mVariationSettings;
}
public int getWeight() {
return this.mWeight;
}
public boolean isItalic() {
return this.mItalic;
}
public FontFileResourceEntry(String str, int i, boolean z, String str2, int i2, int i3) {
this.mFileName = str;
this.mWeight = i;
this.mItalic = z;
this.mVariationSettings = str2;
this.mTtcIndex = i2;
this.mResourceId = i3;
}
}
public static final class FontFamilyFilesResourceEntry implements FamilyResourceEntry {
private final FontFileResourceEntry[] mEntries;
public FontFileResourceEntry[] getEntries() {
return this.mEntries;
}
public FontFamilyFilesResourceEntry(FontFileResourceEntry[] fontFileResourceEntryArr) {
this.mEntries = fontFileResourceEntryArr;
}
}
public static FamilyResourceEntry parse(XmlPullParser xmlPullParser, Resources resources) throws XmlPullParserException, IOException {
int next;
do {
next = xmlPullParser.next();
if (next == 2) {
break;
}
} while (next != 1);
if (next != 2) {
throw new XmlPullParserException("No start tag found");
}
return readFamilies(xmlPullParser, resources);
}
private static FamilyResourceEntry readFamilies(XmlPullParser xmlPullParser, Resources resources) throws XmlPullParserException, IOException {
xmlPullParser.require(2, null, "font-family");
if (xmlPullParser.getName().equals("font-family")) {
return readFamily(xmlPullParser, resources);
}
skip(xmlPullParser);
return null;
}
private static FamilyResourceEntry readFamily(XmlPullParser xmlPullParser, Resources resources) throws XmlPullParserException, IOException {
TypedArray obtainAttributes = resources.obtainAttributes(Xml.asAttributeSet(xmlPullParser), R.styleable.FontFamily);
String string = obtainAttributes.getString(R.styleable.FontFamily_fontProviderAuthority);
String string2 = obtainAttributes.getString(R.styleable.FontFamily_fontProviderPackage);
String string3 = obtainAttributes.getString(R.styleable.FontFamily_fontProviderQuery);
int resourceId = obtainAttributes.getResourceId(R.styleable.FontFamily_fontProviderCerts, 0);
int integer = obtainAttributes.getInteger(R.styleable.FontFamily_fontProviderFetchStrategy, 1);
int integer2 = obtainAttributes.getInteger(R.styleable.FontFamily_fontProviderFetchTimeout, DEFAULT_TIMEOUT_MILLIS);
String string4 = obtainAttributes.getString(R.styleable.FontFamily_fontProviderSystemFontFamily);
obtainAttributes.recycle();
if (string != null && string2 != null && string3 != null) {
while (xmlPullParser.next() != 3) {
skip(xmlPullParser);
}
return new ProviderResourceEntry(new FontRequest(string, string2, string3, readCerts(resources, resourceId)), integer, integer2, string4);
}
ArrayList arrayList = new ArrayList();
while (xmlPullParser.next() != 3) {
if (xmlPullParser.getEventType() == 2) {
if (xmlPullParser.getName().equals("font")) {
arrayList.add(readFont(xmlPullParser, resources));
} else {
skip(xmlPullParser);
}
}
}
if (arrayList.isEmpty()) {
return null;
}
return new FontFamilyFilesResourceEntry((FontFileResourceEntry[]) arrayList.toArray(new FontFileResourceEntry[0]));
}
private static int getType(TypedArray typedArray, int i) {
return Api21Impl.getType(typedArray, i);
}
public static List<List<byte[]>> readCerts(Resources resources, int i) {
if (i == 0) {
return Collections.emptyList();
}
TypedArray obtainTypedArray = resources.obtainTypedArray(i);
try {
if (obtainTypedArray.length() == 0) {
return Collections.emptyList();
}
ArrayList arrayList = new ArrayList();
if (getType(obtainTypedArray, 0) == 1) {
for (int i2 = 0; i2 < obtainTypedArray.length(); i2++) {
int resourceId = obtainTypedArray.getResourceId(i2, 0);
if (resourceId != 0) {
arrayList.add(toByteArrayList(resources.getStringArray(resourceId)));
}
}
} else {
arrayList.add(toByteArrayList(resources.getStringArray(i)));
}
return arrayList;
} finally {
obtainTypedArray.recycle();
}
}
private static List<byte[]> toByteArrayList(String[] strArr) {
ArrayList arrayList = new ArrayList();
for (String str : strArr) {
arrayList.add(Base64.decode(str, 0));
}
return arrayList;
}
private static FontFileResourceEntry readFont(XmlPullParser xmlPullParser, Resources resources) throws XmlPullParserException, IOException {
int i;
int i2;
int i3;
int i4;
int i5;
TypedArray obtainAttributes = resources.obtainAttributes(Xml.asAttributeSet(xmlPullParser), R.styleable.FontFamilyFont);
if (obtainAttributes.hasValue(R.styleable.FontFamilyFont_fontWeight)) {
i = R.styleable.FontFamilyFont_fontWeight;
} else {
i = R.styleable.FontFamilyFont_android_fontWeight;
}
int i6 = obtainAttributes.getInt(i, NORMAL_WEIGHT);
if (obtainAttributes.hasValue(R.styleable.FontFamilyFont_fontStyle)) {
i2 = R.styleable.FontFamilyFont_fontStyle;
} else {
i2 = R.styleable.FontFamilyFont_android_fontStyle;
}
boolean z = 1 == obtainAttributes.getInt(i2, 0);
if (obtainAttributes.hasValue(R.styleable.FontFamilyFont_ttcIndex)) {
i3 = R.styleable.FontFamilyFont_ttcIndex;
} else {
i3 = R.styleable.FontFamilyFont_android_ttcIndex;
}
if (obtainAttributes.hasValue(R.styleable.FontFamilyFont_fontVariationSettings)) {
i4 = R.styleable.FontFamilyFont_fontVariationSettings;
} else {
i4 = R.styleable.FontFamilyFont_android_fontVariationSettings;
}
String string = obtainAttributes.getString(i4);
int i7 = obtainAttributes.getInt(i3, 0);
if (obtainAttributes.hasValue(R.styleable.FontFamilyFont_font)) {
i5 = R.styleable.FontFamilyFont_font;
} else {
i5 = R.styleable.FontFamilyFont_android_font;
}
int resourceId = obtainAttributes.getResourceId(i5, 0);
String string2 = obtainAttributes.getString(i5);
obtainAttributes.recycle();
while (xmlPullParser.next() != 3) {
skip(xmlPullParser);
}
return new FontFileResourceEntry(string2, i6, z, string, i7, resourceId);
}
private static void skip(XmlPullParser xmlPullParser) throws XmlPullParserException, IOException {
int i = 1;
while (i > 0) {
int next = xmlPullParser.next();
if (next == 2) {
i++;
} else if (next == 3) {
i--;
}
}
}
private FontResourcesParserCompat() {
}
static class Api21Impl {
private Api21Impl() {
}
static int getType(TypedArray typedArray, int i) {
return typedArray.getType(i);
}
}
}

View File

@ -0,0 +1,199 @@
package androidx.core.content.res;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.LinearGradient;
import android.graphics.RadialGradient;
import android.graphics.Shader;
import android.graphics.SweepGradient;
import android.util.AttributeSet;
import android.util.Xml;
import androidx.core.R;
import java.io.IOException;
import java.util.List;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
/* loaded from: classes.dex */
final class GradientColorInflaterCompat {
private static final int TILE_MODE_CLAMP = 0;
private static final int TILE_MODE_MIRROR = 2;
private static final int TILE_MODE_REPEAT = 1;
private GradientColorInflaterCompat() {
}
static Shader createFromXml(Resources resources, XmlPullParser xmlPullParser, Resources.Theme theme) throws XmlPullParserException, IOException {
int next;
AttributeSet asAttributeSet = Xml.asAttributeSet(xmlPullParser);
do {
next = xmlPullParser.next();
if (next == 2) {
break;
}
} while (next != 1);
if (next != 2) {
throw new XmlPullParserException("No start tag found");
}
return createFromXmlInner(resources, xmlPullParser, asAttributeSet, theme);
}
static Shader createFromXmlInner(Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet, Resources.Theme theme) throws IOException, XmlPullParserException {
String name = xmlPullParser.getName();
if (!name.equals("gradient")) {
throw new XmlPullParserException(xmlPullParser.getPositionDescription() + ": invalid gradient color tag " + name);
}
TypedArray obtainAttributes = TypedArrayUtils.obtainAttributes(resources, theme, attributeSet, R.styleable.GradientColor);
float namedFloat = TypedArrayUtils.getNamedFloat(obtainAttributes, xmlPullParser, "startX", R.styleable.GradientColor_android_startX, 0.0f);
float namedFloat2 = TypedArrayUtils.getNamedFloat(obtainAttributes, xmlPullParser, "startY", R.styleable.GradientColor_android_startY, 0.0f);
float namedFloat3 = TypedArrayUtils.getNamedFloat(obtainAttributes, xmlPullParser, "endX", R.styleable.GradientColor_android_endX, 0.0f);
float namedFloat4 = TypedArrayUtils.getNamedFloat(obtainAttributes, xmlPullParser, "endY", R.styleable.GradientColor_android_endY, 0.0f);
float namedFloat5 = TypedArrayUtils.getNamedFloat(obtainAttributes, xmlPullParser, "centerX", R.styleable.GradientColor_android_centerX, 0.0f);
float namedFloat6 = TypedArrayUtils.getNamedFloat(obtainAttributes, xmlPullParser, "centerY", R.styleable.GradientColor_android_centerY, 0.0f);
int namedInt = TypedArrayUtils.getNamedInt(obtainAttributes, xmlPullParser, "type", R.styleable.GradientColor_android_type, 0);
int namedColor = TypedArrayUtils.getNamedColor(obtainAttributes, xmlPullParser, "startColor", R.styleable.GradientColor_android_startColor, 0);
boolean hasAttribute = TypedArrayUtils.hasAttribute(xmlPullParser, "centerColor");
int namedColor2 = TypedArrayUtils.getNamedColor(obtainAttributes, xmlPullParser, "centerColor", R.styleable.GradientColor_android_centerColor, 0);
int namedColor3 = TypedArrayUtils.getNamedColor(obtainAttributes, xmlPullParser, "endColor", R.styleable.GradientColor_android_endColor, 0);
int namedInt2 = TypedArrayUtils.getNamedInt(obtainAttributes, xmlPullParser, "tileMode", R.styleable.GradientColor_android_tileMode, 0);
float namedFloat7 = TypedArrayUtils.getNamedFloat(obtainAttributes, xmlPullParser, "gradientRadius", R.styleable.GradientColor_android_gradientRadius, 0.0f);
obtainAttributes.recycle();
ColorStops checkColors = checkColors(inflateChildElements(resources, xmlPullParser, attributeSet, theme), namedColor, namedColor3, hasAttribute, namedColor2);
if (namedInt != 1) {
if (namedInt == 2) {
return new SweepGradient(namedFloat5, namedFloat6, checkColors.mColors, checkColors.mOffsets);
}
return new LinearGradient(namedFloat, namedFloat2, namedFloat3, namedFloat4, checkColors.mColors, checkColors.mOffsets, parseTileMode(namedInt2));
}
if (namedFloat7 <= 0.0f) {
throw new XmlPullParserException("<gradient> tag requires 'gradientRadius' attribute with radial type");
}
return new RadialGradient(namedFloat5, namedFloat6, namedFloat7, checkColors.mColors, checkColors.mOffsets, parseTileMode(namedInt2));
}
/* JADX WARN: Code restructure failed: missing block: B:31:0x0084, code lost:
throw new org.xmlpull.v1.XmlPullParserException(r9.getPositionDescription() + ": <item> tag requires a 'color' attribute and a 'offset' attribute!");
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private static androidx.core.content.res.GradientColorInflaterCompat.ColorStops inflateChildElements(android.content.res.Resources r8, org.xmlpull.v1.XmlPullParser r9, android.util.AttributeSet r10, android.content.res.Resources.Theme r11) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException {
/*
int r0 = r9.getDepth()
r1 = 1
int r0 = r0 + r1
java.util.ArrayList r2 = new java.util.ArrayList
r3 = 20
r2.<init>(r3)
java.util.ArrayList r4 = new java.util.ArrayList
r4.<init>(r3)
L12:
int r3 = r9.next()
if (r3 == r1) goto L85
int r5 = r9.getDepth()
if (r5 >= r0) goto L21
r6 = 3
if (r3 == r6) goto L85
L21:
r6 = 2
if (r3 == r6) goto L25
goto L12
L25:
if (r5 > r0) goto L12
java.lang.String r3 = r9.getName()
java.lang.String r5 = "item"
boolean r3 = r3.equals(r5)
if (r3 != 0) goto L34
goto L12
L34:
int[] r3 = androidx.core.R.styleable.GradientColorItem
android.content.res.TypedArray r3 = androidx.core.content.res.TypedArrayUtils.obtainAttributes(r8, r11, r10, r3)
int r5 = androidx.core.R.styleable.GradientColorItem_android_color
boolean r5 = r3.hasValue(r5)
int r6 = androidx.core.R.styleable.GradientColorItem_android_offset
boolean r6 = r3.hasValue(r6)
if (r5 == 0) goto L6a
if (r6 == 0) goto L6a
int r5 = androidx.core.R.styleable.GradientColorItem_android_color
r6 = 0
int r5 = r3.getColor(r5, r6)
int r6 = androidx.core.R.styleable.GradientColorItem_android_offset
r7 = 0
float r6 = r3.getFloat(r6, r7)
r3.recycle()
java.lang.Integer r3 = java.lang.Integer.valueOf(r5)
r4.add(r3)
java.lang.Float r3 = java.lang.Float.valueOf(r6)
r2.add(r3)
goto L12
L6a:
org.xmlpull.v1.XmlPullParserException r8 = new org.xmlpull.v1.XmlPullParserException
java.lang.StringBuilder r10 = new java.lang.StringBuilder
r10.<init>()
java.lang.String r9 = r9.getPositionDescription()
r10.append(r9)
java.lang.String r9 = ": <item> tag requires a 'color' attribute and a 'offset' attribute!"
r10.append(r9)
java.lang.String r9 = r10.toString()
r8.<init>(r9)
throw r8
L85:
int r8 = r4.size()
if (r8 <= 0) goto L91
androidx.core.content.res.GradientColorInflaterCompat$ColorStops r8 = new androidx.core.content.res.GradientColorInflaterCompat$ColorStops
r8.<init>(r4, r2)
return r8
L91:
r8 = 0
return r8
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.core.content.res.GradientColorInflaterCompat.inflateChildElements(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources$Theme):androidx.core.content.res.GradientColorInflaterCompat$ColorStops");
}
private static ColorStops checkColors(ColorStops colorStops, int i, int i2, boolean z, int i3) {
if (colorStops != null) {
return colorStops;
}
if (z) {
return new ColorStops(i, i3, i2);
}
return new ColorStops(i, i2);
}
private static Shader.TileMode parseTileMode(int i) {
if (i == 1) {
return Shader.TileMode.REPEAT;
}
if (i == 2) {
return Shader.TileMode.MIRROR;
}
return Shader.TileMode.CLAMP;
}
static final class ColorStops {
final int[] mColors;
final float[] mOffsets;
ColorStops(List<Integer> list, List<Float> list2) {
int size = list.size();
this.mColors = new int[size];
this.mOffsets = new float[size];
for (int i = 0; i < size; i++) {
this.mColors[i] = list.get(i).intValue();
this.mOffsets[i] = list2.get(i).floatValue();
}
}
ColorStops(int i, int i2) {
this.mColors = new int[]{i, i2};
this.mOffsets = new float[]{0.0f, 1.0f};
}
ColorStops(int i, int i2, int i3) {
this.mColors = new int[]{i, i2, i3};
this.mOffsets = new float[]{0.0f, 0.5f, 1.0f};
}
}
}

View File

@ -0,0 +1,110 @@
package androidx.core.content.res;
import java.lang.reflect.Array;
/* loaded from: classes.dex */
final class GrowingArrayUtils {
public static int growSize(int i) {
if (i <= 4) {
return 8;
}
return i * 2;
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r0v4, types: [java.lang.Object, java.lang.Object[]] */
public static <T> T[] append(T[] tArr, int i, T t) {
if (i + 1 > tArr.length) {
?? r0 = (Object[]) Array.newInstance(tArr.getClass().getComponentType(), growSize(i));
System.arraycopy(tArr, 0, r0, 0, i);
tArr = r0;
}
tArr[i] = t;
return tArr;
}
public static int[] append(int[] iArr, int i, int i2) {
if (i + 1 > iArr.length) {
int[] iArr2 = new int[growSize(i)];
System.arraycopy(iArr, 0, iArr2, 0, i);
iArr = iArr2;
}
iArr[i] = i2;
return iArr;
}
public static long[] append(long[] jArr, int i, long j) {
if (i + 1 > jArr.length) {
long[] jArr2 = new long[growSize(i)];
System.arraycopy(jArr, 0, jArr2, 0, i);
jArr = jArr2;
}
jArr[i] = j;
return jArr;
}
public static boolean[] append(boolean[] zArr, int i, boolean z) {
if (i + 1 > zArr.length) {
boolean[] zArr2 = new boolean[growSize(i)];
System.arraycopy(zArr, 0, zArr2, 0, i);
zArr = zArr2;
}
zArr[i] = z;
return zArr;
}
public static <T> T[] insert(T[] tArr, int i, int i2, T t) {
if (i + 1 <= tArr.length) {
System.arraycopy(tArr, i2, tArr, i2 + 1, i - i2);
tArr[i2] = t;
return tArr;
}
T[] tArr2 = (T[]) ((Object[]) Array.newInstance(tArr.getClass().getComponentType(), growSize(i)));
System.arraycopy(tArr, 0, tArr2, 0, i2);
tArr2[i2] = t;
System.arraycopy(tArr, i2, tArr2, i2 + 1, tArr.length - i2);
return tArr2;
}
public static int[] insert(int[] iArr, int i, int i2, int i3) {
if (i + 1 <= iArr.length) {
System.arraycopy(iArr, i2, iArr, i2 + 1, i - i2);
iArr[i2] = i3;
return iArr;
}
int[] iArr2 = new int[growSize(i)];
System.arraycopy(iArr, 0, iArr2, 0, i2);
iArr2[i2] = i3;
System.arraycopy(iArr, i2, iArr2, i2 + 1, iArr.length - i2);
return iArr2;
}
public static long[] insert(long[] jArr, int i, int i2, long j) {
if (i + 1 <= jArr.length) {
System.arraycopy(jArr, i2, jArr, i2 + 1, i - i2);
jArr[i2] = j;
return jArr;
}
long[] jArr2 = new long[growSize(i)];
System.arraycopy(jArr, 0, jArr2, 0, i2);
jArr2[i2] = j;
System.arraycopy(jArr, i2, jArr2, i2 + 1, jArr.length - i2);
return jArr2;
}
public static boolean[] insert(boolean[] zArr, int i, int i2, boolean z) {
if (i + 1 <= zArr.length) {
System.arraycopy(zArr, i2, zArr, i2 + 1, i - i2);
zArr[i2] = z;
return zArr;
}
boolean[] zArr2 = new boolean[growSize(i)];
System.arraycopy(zArr, 0, zArr2, 0, i2);
zArr2[i2] = z;
System.arraycopy(zArr, i2, zArr2, i2 + 1, zArr.length - i2);
return zArr2;
}
private GrowingArrayUtils() {
}
}

View File

@ -0,0 +1,473 @@
package androidx.core.content.res;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.util.SparseArray;
import android.util.TypedValue;
import androidx.core.content.res.ResourcesCompat;
import androidx.core.util.ObjectsCompat;
import androidx.core.util.Preconditions;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Iterator;
import java.util.WeakHashMap;
/* loaded from: classes.dex */
public final class ResourcesCompat {
public static final int ID_NULL = 0;
private static final String TAG = "ResourcesCompat";
private static final ThreadLocal<TypedValue> sTempTypedValue = new ThreadLocal<>();
private static final WeakHashMap<ColorStateListCacheKey, SparseArray<ColorStateListCacheEntry>> sColorStateCaches = new WeakHashMap<>(0);
private static final Object sColorStateCacheLock = new Object();
public static void clearCachesForTheme(Resources.Theme theme) {
synchronized (sColorStateCacheLock) {
Iterator<ColorStateListCacheKey> it = sColorStateCaches.keySet().iterator();
while (it.hasNext()) {
ColorStateListCacheKey next = it.next();
if (next != null && theme.equals(next.mTheme)) {
it.remove();
}
}
}
}
public static Drawable getDrawable(Resources resources, int i, Resources.Theme theme) throws Resources.NotFoundException {
return Api21Impl.getDrawable(resources, i, theme);
}
public static Drawable getDrawableForDensity(Resources resources, int i, int i2, Resources.Theme theme) throws Resources.NotFoundException {
return Api21Impl.getDrawableForDensity(resources, i, i2, theme);
}
public static int getColor(Resources resources, int i, Resources.Theme theme) throws Resources.NotFoundException {
if (Build.VERSION.SDK_INT >= 23) {
return Api23Impl.getColor(resources, i, theme);
}
return resources.getColor(i);
}
public static ColorStateList getColorStateList(Resources resources, int i, Resources.Theme theme) throws Resources.NotFoundException {
ColorStateListCacheKey colorStateListCacheKey = new ColorStateListCacheKey(resources, theme);
ColorStateList cachedColorStateList = getCachedColorStateList(colorStateListCacheKey, i);
if (cachedColorStateList != null) {
return cachedColorStateList;
}
ColorStateList inflateColorStateList = inflateColorStateList(resources, i, theme);
if (inflateColorStateList != null) {
addColorStateListToCache(colorStateListCacheKey, i, inflateColorStateList, theme);
return inflateColorStateList;
}
if (Build.VERSION.SDK_INT >= 23) {
return Api23Impl.getColorStateList(resources, i, theme);
}
return resources.getColorStateList(i);
}
private static ColorStateList inflateColorStateList(Resources resources, int i, Resources.Theme theme) {
if (isColorInt(resources, i)) {
return null;
}
try {
return ColorStateListInflaterCompat.createFromXml(resources, resources.getXml(i), theme);
} catch (Exception e) {
Log.w(TAG, "Failed to inflate ColorStateList, leaving it to the framework", e);
return null;
}
}
private static ColorStateList getCachedColorStateList(ColorStateListCacheKey colorStateListCacheKey, int i) {
ColorStateListCacheEntry colorStateListCacheEntry;
synchronized (sColorStateCacheLock) {
SparseArray<ColorStateListCacheEntry> sparseArray = sColorStateCaches.get(colorStateListCacheKey);
if (sparseArray != null && sparseArray.size() > 0 && (colorStateListCacheEntry = sparseArray.get(i)) != null) {
if (colorStateListCacheEntry.mConfiguration.equals(colorStateListCacheKey.mResources.getConfiguration()) && ((colorStateListCacheKey.mTheme == null && colorStateListCacheEntry.mThemeHash == 0) || (colorStateListCacheKey.mTheme != null && colorStateListCacheEntry.mThemeHash == colorStateListCacheKey.mTheme.hashCode()))) {
return colorStateListCacheEntry.mValue;
}
sparseArray.remove(i);
}
return null;
}
}
private static void addColorStateListToCache(ColorStateListCacheKey colorStateListCacheKey, int i, ColorStateList colorStateList, Resources.Theme theme) {
synchronized (sColorStateCacheLock) {
WeakHashMap<ColorStateListCacheKey, SparseArray<ColorStateListCacheEntry>> weakHashMap = sColorStateCaches;
SparseArray<ColorStateListCacheEntry> sparseArray = weakHashMap.get(colorStateListCacheKey);
if (sparseArray == null) {
sparseArray = new SparseArray<>();
weakHashMap.put(colorStateListCacheKey, sparseArray);
}
sparseArray.append(i, new ColorStateListCacheEntry(colorStateList, colorStateListCacheKey.mResources.getConfiguration(), theme));
}
}
private static boolean isColorInt(Resources resources, int i) {
TypedValue typedValue = getTypedValue();
resources.getValue(i, typedValue, true);
return typedValue.type >= 28 && typedValue.type <= 31;
}
private static TypedValue getTypedValue() {
ThreadLocal<TypedValue> threadLocal = sTempTypedValue;
TypedValue typedValue = threadLocal.get();
if (typedValue != null) {
return typedValue;
}
TypedValue typedValue2 = new TypedValue();
threadLocal.set(typedValue2);
return typedValue2;
}
private static final class ColorStateListCacheKey {
final Resources mResources;
final Resources.Theme mTheme;
ColorStateListCacheKey(Resources resources, Resources.Theme theme) {
this.mResources = resources;
this.mTheme = theme;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
ColorStateListCacheKey colorStateListCacheKey = (ColorStateListCacheKey) obj;
return this.mResources.equals(colorStateListCacheKey.mResources) && ObjectsCompat.equals(this.mTheme, colorStateListCacheKey.mTheme);
}
public int hashCode() {
return ObjectsCompat.hash(this.mResources, this.mTheme);
}
}
private static class ColorStateListCacheEntry {
final Configuration mConfiguration;
final int mThemeHash;
final ColorStateList mValue;
ColorStateListCacheEntry(ColorStateList colorStateList, Configuration configuration, Resources.Theme theme) {
this.mValue = colorStateList;
this.mConfiguration = configuration;
this.mThemeHash = theme == null ? 0 : theme.hashCode();
}
}
public static float getFloat(Resources resources, int i) {
if (Build.VERSION.SDK_INT >= 29) {
return Api29Impl.getFloat(resources, i);
}
TypedValue typedValue = getTypedValue();
resources.getValue(i, typedValue, true);
if (typedValue.type == 4) {
return typedValue.getFloat();
}
throw new Resources.NotFoundException("Resource ID #0x" + Integer.toHexString(i) + " type #0x" + Integer.toHexString(typedValue.type) + " is not valid");
}
public static Typeface getFont(Context context, int i) throws Resources.NotFoundException {
if (context.isRestricted()) {
return null;
}
return loadFont(context, i, new TypedValue(), 0, null, null, false, false);
}
public static Typeface getCachedFont(Context context, int i) throws Resources.NotFoundException {
if (context.isRestricted()) {
return null;
}
return loadFont(context, i, new TypedValue(), 0, null, null, false, true);
}
public static abstract class FontCallback {
/* renamed from: onFontRetrievalFailed, reason: merged with bridge method [inline-methods] */
public abstract void m80xb24343b7(int i);
/* renamed from: onFontRetrieved, reason: merged with bridge method [inline-methods] */
public abstract void m81x46c88379(Typeface typeface);
public final void callbackSuccessAsync(final Typeface typeface, Handler handler) {
getHandler(handler).post(new Runnable() { // from class: androidx.core.content.res.ResourcesCompat$FontCallback$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
ResourcesCompat.FontCallback.this.m81x46c88379(typeface);
}
});
}
public final void callbackFailAsync(final int i, Handler handler) {
getHandler(handler).post(new Runnable() { // from class: androidx.core.content.res.ResourcesCompat$FontCallback$$ExternalSyntheticLambda1
@Override // java.lang.Runnable
public final void run() {
ResourcesCompat.FontCallback.this.m80xb24343b7(i);
}
});
}
public static Handler getHandler(Handler handler) {
return handler == null ? new Handler(Looper.getMainLooper()) : handler;
}
}
public static void getFont(Context context, int i, FontCallback fontCallback, Handler handler) throws Resources.NotFoundException {
Preconditions.checkNotNull(fontCallback);
if (context.isRestricted()) {
fontCallback.callbackFailAsync(-4, handler);
} else {
loadFont(context, i, new TypedValue(), 0, fontCallback, handler, false, false);
}
}
public static Typeface getFont(Context context, int i, TypedValue typedValue, int i2, FontCallback fontCallback) throws Resources.NotFoundException {
if (context.isRestricted()) {
return null;
}
return loadFont(context, i, typedValue, i2, fontCallback, null, true, false);
}
private static Typeface loadFont(Context context, int i, TypedValue typedValue, int i2, FontCallback fontCallback, Handler handler, boolean z, boolean z2) {
Resources resources = context.getResources();
resources.getValue(i, typedValue, true);
Typeface loadFont = loadFont(context, resources, typedValue, i, i2, fontCallback, handler, z, z2);
if (loadFont != null || fontCallback != null || z2) {
return loadFont;
}
throw new Resources.NotFoundException("Font resource ID #0x" + Integer.toHexString(i) + " could not be retrieved.");
}
/* JADX WARN: Removed duplicated region for block: B:36:0x00b3 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private static android.graphics.Typeface loadFont(android.content.Context r17, android.content.res.Resources r18, android.util.TypedValue r19, int r20, int r21, androidx.core.content.res.ResourcesCompat.FontCallback r22, android.os.Handler r23, boolean r24, boolean r25) {
/*
r0 = r18
r1 = r19
r4 = r20
r11 = r22
r12 = r23
java.lang.String r13 = "ResourcesCompat"
java.lang.CharSequence r2 = r1.string
if (r2 == 0) goto Lb7
java.lang.CharSequence r2 = r1.string
java.lang.String r14 = r2.toString()
java.lang.String r2 = "res/"
boolean r2 = r14.startsWith(r2)
r15 = -3
r16 = 0
if (r2 != 0) goto L27
if (r11 == 0) goto L26
r11.callbackFailAsync(r15, r12)
L26:
return r16
L27:
int r2 = r1.assetCookie
r7 = r21
android.graphics.Typeface r2 = androidx.core.graphics.TypefaceCompat.findFromCache(r0, r4, r14, r2, r7)
if (r2 == 0) goto L37
if (r11 == 0) goto L36
r11.callbackSuccessAsync(r2, r12)
L36:
return r2
L37:
if (r25 == 0) goto L3a
return r16
L3a:
java.lang.String r2 = r14.toLowerCase() // Catch: java.io.IOException -> L8c org.xmlpull.v1.XmlPullParserException -> L9f
java.lang.String r3 = ".xml"
boolean r2 = r2.endsWith(r3) // Catch: java.io.IOException -> L8c org.xmlpull.v1.XmlPullParserException -> L9f
if (r2 == 0) goto L71
android.content.res.XmlResourceParser r2 = r0.getXml(r4) // Catch: java.io.IOException -> L8c org.xmlpull.v1.XmlPullParserException -> L9f
androidx.core.content.res.FontResourcesParserCompat$FamilyResourceEntry r2 = androidx.core.content.res.FontResourcesParserCompat.parse(r2, r0) // Catch: java.io.IOException -> L8c org.xmlpull.v1.XmlPullParserException -> L9f
if (r2 != 0) goto L5b
java.lang.String r0 = "Failed to find font-family tag"
android.util.Log.e(r13, r0) // Catch: java.io.IOException -> L8c org.xmlpull.v1.XmlPullParserException -> L9f
if (r11 == 0) goto L5a
r11.callbackFailAsync(r15, r12) // Catch: java.io.IOException -> L8c org.xmlpull.v1.XmlPullParserException -> L9f
L5a:
return r16
L5b:
int r6 = r1.assetCookie // Catch: java.io.IOException -> L8c org.xmlpull.v1.XmlPullParserException -> L9f
r1 = r17
r3 = r18
r4 = r20
r5 = r14
r7 = r21
r8 = r22
r9 = r23
r10 = r24
android.graphics.Typeface r0 = androidx.core.graphics.TypefaceCompat.createFromResourcesFamilyXml(r1, r2, r3, r4, r5, r6, r7, r8, r9, r10) // Catch: java.io.IOException -> L8c org.xmlpull.v1.XmlPullParserException -> L9f
return r0
L71:
int r5 = r1.assetCookie // Catch: java.io.IOException -> L8c org.xmlpull.v1.XmlPullParserException -> L9f
r1 = r17
r2 = r18
r3 = r20
r4 = r14
r6 = r21
android.graphics.Typeface r0 = androidx.core.graphics.TypefaceCompat.createFromResourcesFontFile(r1, r2, r3, r4, r5, r6) // Catch: java.io.IOException -> L8c org.xmlpull.v1.XmlPullParserException -> L9f
if (r11 == 0) goto L8b
if (r0 == 0) goto L88
r11.callbackSuccessAsync(r0, r12) // Catch: java.io.IOException -> L8c org.xmlpull.v1.XmlPullParserException -> L9f
goto L8b
L88:
r11.callbackFailAsync(r15, r12) // Catch: java.io.IOException -> L8c org.xmlpull.v1.XmlPullParserException -> L9f
L8b:
return r0
L8c:
r0 = move-exception
java.lang.StringBuilder r1 = new java.lang.StringBuilder
java.lang.String r2 = "Failed to read xml resource "
r1.<init>(r2)
r1.append(r14)
java.lang.String r1 = r1.toString()
android.util.Log.e(r13, r1, r0)
goto Lb1
L9f:
r0 = move-exception
java.lang.StringBuilder r1 = new java.lang.StringBuilder
java.lang.String r2 = "Failed to parse xml resource "
r1.<init>(r2)
r1.append(r14)
java.lang.String r1 = r1.toString()
android.util.Log.e(r13, r1, r0)
Lb1:
if (r11 == 0) goto Lb6
r11.callbackFailAsync(r15, r12)
Lb6:
return r16
Lb7:
android.content.res.Resources$NotFoundException r2 = new android.content.res.Resources$NotFoundException
java.lang.StringBuilder r3 = new java.lang.StringBuilder
java.lang.String r5 = "Resource \""
r3.<init>(r5)
java.lang.String r0 = r0.getResourceName(r4)
r3.append(r0)
java.lang.String r0 = "\" ("
r3.append(r0)
java.lang.String r0 = java.lang.Integer.toHexString(r20)
r3.append(r0)
java.lang.String r0 = ") is not a Font: "
r3.append(r0)
r3.append(r1)
java.lang.String r0 = r3.toString()
r2.<init>(r0)
throw r2
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.core.content.res.ResourcesCompat.loadFont(android.content.Context, android.content.res.Resources, android.util.TypedValue, int, int, androidx.core.content.res.ResourcesCompat$FontCallback, android.os.Handler, boolean, boolean):android.graphics.Typeface");
}
static class Api29Impl {
private Api29Impl() {
}
static float getFloat(Resources resources, int i) {
return resources.getFloat(i);
}
}
static class Api23Impl {
private Api23Impl() {
}
static ColorStateList getColorStateList(Resources resources, int i, Resources.Theme theme) {
return resources.getColorStateList(i, theme);
}
static int getColor(Resources resources, int i, Resources.Theme theme) {
return resources.getColor(i, theme);
}
}
static class Api21Impl {
private Api21Impl() {
}
static Drawable getDrawable(Resources resources, int i, Resources.Theme theme) {
return resources.getDrawable(i, theme);
}
static Drawable getDrawableForDensity(Resources resources, int i, int i2, Resources.Theme theme) {
return resources.getDrawableForDensity(i, i2, theme);
}
}
static class Api15Impl {
private Api15Impl() {
}
static Drawable getDrawableForDensity(Resources resources, int i, int i2) {
return resources.getDrawableForDensity(i, i2);
}
}
private ResourcesCompat() {
}
public static final class ThemeCompat {
private ThemeCompat() {
}
public static void rebase(Resources.Theme theme) {
if (Build.VERSION.SDK_INT >= 29) {
Api29Impl.rebase(theme);
} else if (Build.VERSION.SDK_INT >= 23) {
Api23Impl.rebase(theme);
}
}
static class Api29Impl {
private Api29Impl() {
}
static void rebase(Resources.Theme theme) {
theme.rebase();
}
}
static class Api23Impl {
private static Method sRebaseMethod;
private static boolean sRebaseMethodFetched;
private static final Object sRebaseMethodLock = new Object();
private Api23Impl() {
}
static void rebase(Resources.Theme theme) {
synchronized (sRebaseMethodLock) {
if (!sRebaseMethodFetched) {
try {
Method declaredMethod = Resources.Theme.class.getDeclaredMethod("rebase", new Class[0]);
sRebaseMethod = declaredMethod;
declaredMethod.setAccessible(true);
} catch (NoSuchMethodException e) {
Log.i(ResourcesCompat.TAG, "Failed to retrieve rebase() method", e);
}
sRebaseMethodFetched = true;
}
Method method = sRebaseMethod;
if (method != null) {
try {
method.invoke(theme, new Object[0]);
} catch (IllegalAccessException | InvocationTargetException e2) {
Log.i(ResourcesCompat.TAG, "Failed to invoke rebase() method via reflection", e2);
sRebaseMethod = null;
}
}
}
}
}
}
}

View File

@ -0,0 +1,25 @@
package androidx.core.content.res;
import android.content.res.TypedArray;
import android.graphics.Typeface;
import kotlin.Metadata;
import kotlin.jvm.JvmStatic;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: TypedArray.kt */
@Metadata(d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u001a\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\b\b\u0001\u0010\u0007\u001a\u00020\bH\u0007¨\u0006\t"}, d2 = {"Landroidx/core/content/res/TypedArrayApi26ImplKt;", "", "()V", "getFont", "Landroid/graphics/Typeface;", "typedArray", "Landroid/content/res/TypedArray;", "index", "", "core-ktx_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
/* loaded from: classes.dex */
final class TypedArrayApi26ImplKt {
public static final TypedArrayApi26ImplKt INSTANCE = new TypedArrayApi26ImplKt();
private TypedArrayApi26ImplKt() {
}
@JvmStatic
public static final Typeface getFont(TypedArray typedArray, int index) {
Intrinsics.checkNotNullParameter(typedArray, "typedArray");
Typeface font = typedArray.getFont(index);
Intrinsics.checkNotNull(font);
return font;
}
}

View File

@ -0,0 +1,134 @@
package androidx.core.content.res;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import kotlin.Metadata;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: TypedArray.kt */
@Metadata(d1 = {"\u0000R\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0007\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0011\n\u0002\u0010\r\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a\u0016\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\b\b\u0001\u0010\u0003\u001a\u00020\u0004H\u0002\u001a\u0014\u0010\u0005\u001a\u00020\u0006*\u00020\u00022\b\b\u0001\u0010\u0003\u001a\u00020\u0004\u001a\u0016\u0010\u0007\u001a\u00020\u0004*\u00020\u00022\b\b\u0001\u0010\u0003\u001a\u00020\u0004H\u0007\u001a\u0014\u0010\b\u001a\u00020\t*\u00020\u00022\b\b\u0001\u0010\u0003\u001a\u00020\u0004\u001a\u0014\u0010\n\u001a\u00020\u000b*\u00020\u00022\b\b\u0001\u0010\u0003\u001a\u00020\u0004\u001a\u0016\u0010\f\u001a\u00020\u0004*\u00020\u00022\b\b\u0001\u0010\u0003\u001a\u00020\u0004H\u0007\u001a\u0016\u0010\r\u001a\u00020\u0004*\u00020\u00022\b\b\u0001\u0010\u0003\u001a\u00020\u0004H\u0007\u001a\u0014\u0010\u000e\u001a\u00020\u000f*\u00020\u00022\b\b\u0001\u0010\u0003\u001a\u00020\u0004\u001a\u0014\u0010\u0010\u001a\u00020\u000b*\u00020\u00022\b\b\u0001\u0010\u0003\u001a\u00020\u0004\u001a\u0016\u0010\u0011\u001a\u00020\u0012*\u00020\u00022\b\b\u0001\u0010\u0003\u001a\u00020\u0004H\u0007\u001a\u0014\u0010\u0013\u001a\u00020\u0004*\u00020\u00022\b\b\u0001\u0010\u0003\u001a\u00020\u0004\u001a\u0014\u0010\u0014\u001a\u00020\u0004*\u00020\u00022\b\b\u0001\u0010\u0003\u001a\u00020\u0004\u001a\u0016\u0010\u0015\u001a\u00020\u0004*\u00020\u00022\b\b\u0001\u0010\u0003\u001a\u00020\u0004H\u0007\u001a\u0014\u0010\u0016\u001a\u00020\u0017*\u00020\u00022\b\b\u0001\u0010\u0003\u001a\u00020\u0004\u001a\u001f\u0010\u0018\u001a\b\u0012\u0004\u0012\u00020\u001a0\u0019*\u00020\u00022\b\b\u0001\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u001b\u001a\u0014\u0010\u001c\u001a\u00020\u001a*\u00020\u00022\b\b\u0001\u0010\u0003\u001a\u00020\u0004\u001a/\u0010\u001d\u001a\u0002H\u001e\"\u0004\b\u0000\u0010\u001e*\u00020\u00022\u0012\u0010\u001f\u001a\u000e\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u0002H\u001e0 H\u0086\\u0001\u0000¢\u0006\u0002\u0010!\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006\""}, d2 = {"checkAttribute", "", "Landroid/content/res/TypedArray;", "index", "", "getBooleanOrThrow", "", "getColorOrThrow", "getColorStateListOrThrow", "Landroid/content/res/ColorStateList;", "getDimensionOrThrow", "", "getDimensionPixelOffsetOrThrow", "getDimensionPixelSizeOrThrow", "getDrawableOrThrow", "Landroid/graphics/drawable/Drawable;", "getFloatOrThrow", "getFontOrThrow", "Landroid/graphics/Typeface;", "getIntOrThrow", "getIntegerOrThrow", "getResourceIdOrThrow", "getStringOrThrow", "", "getTextArrayOrThrow", "", "", "(Landroid/content/res/TypedArray;I)[Ljava/lang/CharSequence;", "getTextOrThrow", "use", "R", "block", "Lkotlin/Function1;", "(Landroid/content/res/TypedArray;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;", "core-ktx_release"}, k = 2, mv = {1, 7, 1}, xi = 48)
/* loaded from: classes.dex */
public final class TypedArrayKt {
private static final void checkAttribute(TypedArray typedArray, int i) {
if (!typedArray.hasValue(i)) {
throw new IllegalArgumentException("Attribute not defined in set.");
}
}
public static final boolean getBooleanOrThrow(TypedArray typedArray, int i) {
Intrinsics.checkNotNullParameter(typedArray, "<this>");
checkAttribute(typedArray, i);
return typedArray.getBoolean(i, false);
}
public static final int getColorOrThrow(TypedArray typedArray, int i) {
Intrinsics.checkNotNullParameter(typedArray, "<this>");
checkAttribute(typedArray, i);
return typedArray.getColor(i, 0);
}
public static final ColorStateList getColorStateListOrThrow(TypedArray typedArray, int i) {
Intrinsics.checkNotNullParameter(typedArray, "<this>");
checkAttribute(typedArray, i);
ColorStateList colorStateList = typedArray.getColorStateList(i);
if (colorStateList != null) {
return colorStateList;
}
throw new IllegalStateException("Attribute value was not a color or color state list.".toString());
}
public static final float getDimensionOrThrow(TypedArray typedArray, int i) {
Intrinsics.checkNotNullParameter(typedArray, "<this>");
checkAttribute(typedArray, i);
return typedArray.getDimension(i, 0.0f);
}
public static final int getDimensionPixelOffsetOrThrow(TypedArray typedArray, int i) {
Intrinsics.checkNotNullParameter(typedArray, "<this>");
checkAttribute(typedArray, i);
return typedArray.getDimensionPixelOffset(i, 0);
}
public static final int getDimensionPixelSizeOrThrow(TypedArray typedArray, int i) {
Intrinsics.checkNotNullParameter(typedArray, "<this>");
checkAttribute(typedArray, i);
return typedArray.getDimensionPixelSize(i, 0);
}
public static final Drawable getDrawableOrThrow(TypedArray typedArray, int i) {
Intrinsics.checkNotNullParameter(typedArray, "<this>");
checkAttribute(typedArray, i);
Drawable drawable = typedArray.getDrawable(i);
Intrinsics.checkNotNull(drawable);
return drawable;
}
public static final float getFloatOrThrow(TypedArray typedArray, int i) {
Intrinsics.checkNotNullParameter(typedArray, "<this>");
checkAttribute(typedArray, i);
return typedArray.getFloat(i, 0.0f);
}
public static final Typeface getFontOrThrow(TypedArray typedArray, int i) {
Intrinsics.checkNotNullParameter(typedArray, "<this>");
checkAttribute(typedArray, i);
return TypedArrayApi26ImplKt.getFont(typedArray, i);
}
public static final int getIntOrThrow(TypedArray typedArray, int i) {
Intrinsics.checkNotNullParameter(typedArray, "<this>");
checkAttribute(typedArray, i);
return typedArray.getInt(i, 0);
}
public static final int getIntegerOrThrow(TypedArray typedArray, int i) {
Intrinsics.checkNotNullParameter(typedArray, "<this>");
checkAttribute(typedArray, i);
return typedArray.getInteger(i, 0);
}
public static final int getResourceIdOrThrow(TypedArray typedArray, int i) {
Intrinsics.checkNotNullParameter(typedArray, "<this>");
checkAttribute(typedArray, i);
return typedArray.getResourceId(i, 0);
}
public static final String getStringOrThrow(TypedArray typedArray, int i) {
Intrinsics.checkNotNullParameter(typedArray, "<this>");
checkAttribute(typedArray, i);
String string = typedArray.getString(i);
if (string != null) {
return string;
}
throw new IllegalStateException("Attribute value could not be coerced to String.".toString());
}
public static final CharSequence getTextOrThrow(TypedArray typedArray, int i) {
Intrinsics.checkNotNullParameter(typedArray, "<this>");
checkAttribute(typedArray, i);
CharSequence text = typedArray.getText(i);
if (text != null) {
return text;
}
throw new IllegalStateException("Attribute value could not be coerced to CharSequence.".toString());
}
public static final CharSequence[] getTextArrayOrThrow(TypedArray typedArray, int i) {
Intrinsics.checkNotNullParameter(typedArray, "<this>");
checkAttribute(typedArray, i);
CharSequence[] textArray = typedArray.getTextArray(i);
Intrinsics.checkNotNullExpressionValue(textArray, "getTextArray(index)");
return textArray;
}
public static final <R> R use(TypedArray typedArray, Function1<? super TypedArray, ? extends R> block) {
Intrinsics.checkNotNullParameter(typedArray, "<this>");
Intrinsics.checkNotNullParameter(block, "block");
R invoke = block.invoke(typedArray);
typedArray.recycle();
return invoke;
}
}

View File

@ -0,0 +1,135 @@
package androidx.core.content.res;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.TypedValue;
import org.xmlpull.v1.XmlPullParser;
/* loaded from: classes.dex */
public class TypedArrayUtils {
private static final String NAMESPACE = "http://schemas.android.com/apk/res/android";
public static boolean hasAttribute(XmlPullParser xmlPullParser, String str) {
return xmlPullParser.getAttributeValue(NAMESPACE, str) != null;
}
public static float getNamedFloat(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i, float f) {
return !hasAttribute(xmlPullParser, str) ? f : typedArray.getFloat(i, f);
}
public static boolean getNamedBoolean(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i, boolean z) {
return !hasAttribute(xmlPullParser, str) ? z : typedArray.getBoolean(i, z);
}
public static int getNamedInt(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i, int i2) {
return !hasAttribute(xmlPullParser, str) ? i2 : typedArray.getInt(i, i2);
}
public static int getNamedColor(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i, int i2) {
return !hasAttribute(xmlPullParser, str) ? i2 : typedArray.getColor(i, i2);
}
public static ComplexColorCompat getNamedComplexColor(TypedArray typedArray, XmlPullParser xmlPullParser, Resources.Theme theme, String str, int i, int i2) {
if (hasAttribute(xmlPullParser, str)) {
TypedValue typedValue = new TypedValue();
typedArray.getValue(i, typedValue);
if (typedValue.type >= 28 && typedValue.type <= 31) {
return ComplexColorCompat.from(typedValue.data);
}
ComplexColorCompat inflate = ComplexColorCompat.inflate(typedArray.getResources(), typedArray.getResourceId(i, 0), theme);
if (inflate != null) {
return inflate;
}
}
return ComplexColorCompat.from(i2);
}
public static ColorStateList getNamedColorStateList(TypedArray typedArray, XmlPullParser xmlPullParser, Resources.Theme theme, String str, int i) {
if (!hasAttribute(xmlPullParser, str)) {
return null;
}
TypedValue typedValue = new TypedValue();
typedArray.getValue(i, typedValue);
if (typedValue.type == 2) {
throw new UnsupportedOperationException("Failed to resolve attribute at index " + i + ": " + typedValue);
}
if (typedValue.type >= 28 && typedValue.type <= 31) {
return getNamedColorStateListFromInt(typedValue);
}
return ColorStateListInflaterCompat.inflate(typedArray.getResources(), typedArray.getResourceId(i, 0), theme);
}
private static ColorStateList getNamedColorStateListFromInt(TypedValue typedValue) {
return ColorStateList.valueOf(typedValue.data);
}
public static int getNamedResourceId(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i, int i2) {
return !hasAttribute(xmlPullParser, str) ? i2 : typedArray.getResourceId(i, i2);
}
public static String getNamedString(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i) {
if (hasAttribute(xmlPullParser, str)) {
return typedArray.getString(i);
}
return null;
}
public static TypedValue peekNamedValue(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i) {
if (hasAttribute(xmlPullParser, str)) {
return typedArray.peekValue(i);
}
return null;
}
public static TypedArray obtainAttributes(Resources resources, Resources.Theme theme, AttributeSet attributeSet, int[] iArr) {
if (theme == null) {
return resources.obtainAttributes(attributeSet, iArr);
}
return theme.obtainStyledAttributes(attributeSet, iArr, 0, 0);
}
public static boolean getBoolean(TypedArray typedArray, int i, int i2, boolean z) {
return typedArray.getBoolean(i, typedArray.getBoolean(i2, z));
}
public static Drawable getDrawable(TypedArray typedArray, int i, int i2) {
Drawable drawable = typedArray.getDrawable(i);
return drawable == null ? typedArray.getDrawable(i2) : drawable;
}
public static int getInt(TypedArray typedArray, int i, int i2, int i3) {
return typedArray.getInt(i, typedArray.getInt(i2, i3));
}
public static int getResourceId(TypedArray typedArray, int i, int i2, int i3) {
return typedArray.getResourceId(i, typedArray.getResourceId(i2, i3));
}
public static String getString(TypedArray typedArray, int i, int i2) {
String string = typedArray.getString(i);
return string == null ? typedArray.getString(i2) : string;
}
public static CharSequence getText(TypedArray typedArray, int i, int i2) {
CharSequence text = typedArray.getText(i);
return text == null ? typedArray.getText(i2) : text;
}
public static CharSequence[] getTextArray(TypedArray typedArray, int i, int i2) {
CharSequence[] textArray = typedArray.getTextArray(i);
return textArray == null ? typedArray.getTextArray(i2) : textArray;
}
public static int getAttr(Context context, int i, int i2) {
TypedValue typedValue = new TypedValue();
context.getTheme().resolveAttribute(i, typedValue, true);
return typedValue.resourceId != 0 ? i : i2;
}
private TypedArrayUtils() {
}
}

View File

@ -0,0 +1,107 @@
package androidx.core.content.res;
/* loaded from: classes.dex */
final class ViewingConditions {
static final ViewingConditions DEFAULT = make(CamUtils.WHITE_POINT_D65, (float) ((CamUtils.yFromLStar(50.0f) * 63.66197723675813d) / 100.0d), 50.0f, 2.0f, false);
private final float mAw;
private final float mC;
private final float mFl;
private final float mFlRoot;
private final float mN;
private final float mNbb;
private final float mNc;
private final float mNcb;
private final float[] mRgbD;
private final float mZ;
float getAw() {
return this.mAw;
}
float getC() {
return this.mC;
}
float getFl() {
return this.mFl;
}
float getFlRoot() {
return this.mFlRoot;
}
float getN() {
return this.mN;
}
float getNbb() {
return this.mNbb;
}
float getNc() {
return this.mNc;
}
float getNcb() {
return this.mNcb;
}
float[] getRgbD() {
return this.mRgbD;
}
float getZ() {
return this.mZ;
}
private ViewingConditions(float f, float f2, float f3, float f4, float f5, float f6, float[] fArr, float f7, float f8, float f9) {
this.mN = f;
this.mAw = f2;
this.mNbb = f3;
this.mNcb = f4;
this.mC = f5;
this.mNc = f6;
this.mRgbD = fArr;
this.mFl = f7;
this.mFlRoot = f8;
this.mZ = f9;
}
static ViewingConditions make(float[] fArr, float f, float f2, float f3, boolean z) {
float[][] fArr2 = CamUtils.XYZ_TO_CAM16RGB;
float f4 = fArr[0];
float[] fArr3 = fArr2[0];
float f5 = fArr3[0] * f4;
float f6 = fArr[1];
float f7 = f5 + (fArr3[1] * f6);
float f8 = fArr[2];
float f9 = f7 + (fArr3[2] * f8);
float[] fArr4 = fArr2[1];
float f10 = (fArr4[0] * f4) + (fArr4[1] * f6) + (fArr4[2] * f8);
float[] fArr5 = fArr2[2];
float f11 = (f4 * fArr5[0]) + (f6 * fArr5[1]) + (f8 * fArr5[2]);
float f12 = (f3 / 10.0f) + 0.8f;
float lerp = ((double) f12) >= 0.9d ? CamUtils.lerp(0.59f, 0.69f, (f12 - 0.9f) * 10.0f) : CamUtils.lerp(0.525f, 0.59f, (f12 - 0.8f) * 10.0f);
float exp = z ? 1.0f : (1.0f - (((float) Math.exp(((-f) - 42.0f) / 92.0f)) * 0.2777778f)) * f12;
double d = exp;
if (d > 1.0d) {
exp = 1.0f;
} else if (d < 0.0d) {
exp = 0.0f;
}
float[] fArr6 = {(((100.0f / f9) * exp) + 1.0f) - exp, (((100.0f / f10) * exp) + 1.0f) - exp, (((100.0f / f11) * exp) + 1.0f) - exp};
float f13 = 1.0f / ((5.0f * f) + 1.0f);
float f14 = f13 * f13 * f13 * f13;
float f15 = 1.0f - f14;
float cbrt = (f14 * f) + (0.1f * f15 * f15 * ((float) Math.cbrt(f * 5.0d)));
float yFromLStar = CamUtils.yFromLStar(f2) / fArr[1];
double d2 = yFromLStar;
float sqrt = ((float) Math.sqrt(d2)) + 1.48f;
float pow = 0.725f / ((float) Math.pow(d2, 0.2d));
float pow2 = (float) Math.pow(((fArr6[2] * cbrt) * f11) / 100.0d, 0.42d);
float[] fArr7 = {(float) Math.pow(((fArr6[0] * cbrt) * f9) / 100.0d, 0.42d), (float) Math.pow(((fArr6[1] * cbrt) * f10) / 100.0d, 0.42d), pow2};
float f16 = fArr7[0];
float f17 = fArr7[1];
return new ViewingConditions(yFromLStar, ((((f16 * 400.0f) / (f16 + 27.13f)) * 2.0f) + ((f17 * 400.0f) / (f17 + 27.13f)) + (((400.0f * pow2) / (pow2 + 27.13f)) * 0.05f)) * pow, pow, pow, lerp, f12, fArr6, cbrt, (float) Math.pow(cbrt, 0.25d), sqrt);
}
}

View File

@ -0,0 +1,66 @@
package androidx.core.database;
import android.database.Cursor;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: Cursor.kt */
@Metadata(d1 = {"\u00008\n\u0000\n\u0002\u0010\u0012\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u0006\n\u0002\b\u0002\n\u0002\u0010\u0007\n\u0002\b\u0004\n\u0002\u0010\t\n\u0002\b\u0002\n\u0002\u0010\n\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\u001a\u0017\u0010\u0000\u001a\u0004\u0018\u00010\u0001*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u0004H\u0086\b\u001a\u001c\u0010\u0005\u001a\u0004\u0018\u00010\u0006*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u0004H\u0086\\u0006\u0002\u0010\u0007\u001a\u001c\u0010\b\u001a\u0004\u0018\u00010\t*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u0004H\u0086\\u0006\u0002\u0010\n\u001a\u001c\u0010\u000b\u001a\u0004\u0018\u00010\u0004*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u0004H\u0086\\u0006\u0002\u0010\f\u001a\u001c\u0010\r\u001a\u0004\u0018\u00010\u000e*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u0004H\u0086\\u0006\u0002\u0010\u000f\u001a\u001c\u0010\u0010\u001a\u0004\u0018\u00010\u0011*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u0004H\u0086\\u0006\u0002\u0010\u0012\u001a\u0017\u0010\u0013\u001a\u0004\u0018\u00010\u0014*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u0004H\u0086\\u0006\u0015"}, d2 = {"getBlobOrNull", "", "Landroid/database/Cursor;", "index", "", "getDoubleOrNull", "", "(Landroid/database/Cursor;I)Ljava/lang/Double;", "getFloatOrNull", "", "(Landroid/database/Cursor;I)Ljava/lang/Float;", "getIntOrNull", "(Landroid/database/Cursor;I)Ljava/lang/Integer;", "getLongOrNull", "", "(Landroid/database/Cursor;I)Ljava/lang/Long;", "getShortOrNull", "", "(Landroid/database/Cursor;I)Ljava/lang/Short;", "getStringOrNull", "", "core-ktx_release"}, k = 2, mv = {1, 7, 1}, xi = 48)
/* loaded from: classes.dex */
public final class CursorKt {
public static final byte[] getBlobOrNull(Cursor cursor, int i) {
Intrinsics.checkNotNullParameter(cursor, "<this>");
if (cursor.isNull(i)) {
return null;
}
return cursor.getBlob(i);
}
public static final Double getDoubleOrNull(Cursor cursor, int i) {
Intrinsics.checkNotNullParameter(cursor, "<this>");
if (cursor.isNull(i)) {
return null;
}
return Double.valueOf(cursor.getDouble(i));
}
public static final Float getFloatOrNull(Cursor cursor, int i) {
Intrinsics.checkNotNullParameter(cursor, "<this>");
if (cursor.isNull(i)) {
return null;
}
return Float.valueOf(cursor.getFloat(i));
}
public static final Integer getIntOrNull(Cursor cursor, int i) {
Intrinsics.checkNotNullParameter(cursor, "<this>");
if (cursor.isNull(i)) {
return null;
}
return Integer.valueOf(cursor.getInt(i));
}
public static final Long getLongOrNull(Cursor cursor, int i) {
Intrinsics.checkNotNullParameter(cursor, "<this>");
if (cursor.isNull(i)) {
return null;
}
return Long.valueOf(cursor.getLong(i));
}
public static final Short getShortOrNull(Cursor cursor, int i) {
Intrinsics.checkNotNullParameter(cursor, "<this>");
if (cursor.isNull(i)) {
return null;
}
return Short.valueOf(cursor.getShort(i));
}
public static final String getStringOrNull(Cursor cursor, int i) {
Intrinsics.checkNotNullParameter(cursor, "<this>");
if (cursor.isNull(i)) {
return null;
}
return cursor.getString(i);
}
}

View File

@ -0,0 +1,35 @@
package androidx.core.database;
import android.database.CursorWindow;
import android.os.Build;
/* loaded from: classes.dex */
public final class CursorWindowCompat {
private CursorWindowCompat() {
}
public static CursorWindow create(String str, long j) {
if (Build.VERSION.SDK_INT >= 28) {
return Api28Impl.createCursorWindow(str, j);
}
return Api15Impl.createCursorWindow(str);
}
static class Api28Impl {
private Api28Impl() {
}
static CursorWindow createCursorWindow(String str, long j) {
return new CursorWindow(str, j);
}
}
static class Api15Impl {
private Api15Impl() {
}
static CursorWindow createCursorWindow(String str) {
return new CursorWindow(str);
}
}
}

View File

@ -0,0 +1,32 @@
package androidx.core.database;
import android.text.TextUtils;
@Deprecated
/* loaded from: classes.dex */
public final class DatabaseUtilsCompat {
private DatabaseUtilsCompat() {
}
@Deprecated
public static String concatenateWhere(String str, String str2) {
if (TextUtils.isEmpty(str)) {
return str2;
}
if (TextUtils.isEmpty(str2)) {
return str;
}
return "(" + str + ") AND (" + str2 + ")";
}
@Deprecated
public static String[] appendSelectionArgs(String[] strArr, String[] strArr2) {
if (strArr == null || strArr.length == 0) {
return strArr2;
}
String[] strArr3 = new String[strArr.length + strArr2.length];
System.arraycopy(strArr, 0, strArr3, 0, strArr.length);
System.arraycopy(strArr2, 0, strArr3, strArr.length, strArr2.length);
return strArr3;
}
}

View File

@ -0,0 +1,25 @@
package androidx.core.database.sqlite;
import android.database.sqlite.SQLiteCursor;
import android.os.Build;
/* loaded from: classes.dex */
public final class SQLiteCursorCompat {
private SQLiteCursorCompat() {
}
public static void setFillWindowForwardOnly(SQLiteCursor sQLiteCursor, boolean z) {
if (Build.VERSION.SDK_INT >= 28) {
Api28Impl.setFillWindowForwardOnly(sQLiteCursor, z);
}
}
static class Api28Impl {
private Api28Impl() {
}
static void setFillWindowForwardOnly(SQLiteCursor sQLiteCursor, boolean z) {
sQLiteCursor.setFillWindowForwardOnly(z);
}
}
}

View File

@ -0,0 +1,53 @@
package androidx.core.database.sqlite;
import android.database.sqlite.SQLiteDatabase;
import kotlin.Metadata;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.InlineMarker;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: SQLiteDatabase.kt */
@Metadata(d1 = {"\u0000\u001c\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a>\u0010\u0000\u001a\u0002H\u0001\"\u0004\b\u0000\u0010\u0001*\u00020\u00022\b\b\u0002\u0010\u0003\u001a\u00020\u00042\u0017\u0010\u0005\u001a\u0013\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u0002H\u00010\u0006¢\u0006\u0002\b\u0007H\u0086\\u0001\u0000¢\u0006\u0002\u0010\b\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006\t"}, d2 = {"transaction", "T", "Landroid/database/sqlite/SQLiteDatabase;", "exclusive", "", "body", "Lkotlin/Function1;", "Lkotlin/ExtensionFunctionType;", "(Landroid/database/sqlite/SQLiteDatabase;ZLkotlin/jvm/functions/Function1;)Ljava/lang/Object;", "core-ktx_release"}, k = 2, mv = {1, 7, 1}, xi = 48)
/* loaded from: classes.dex */
public final class SQLiteDatabaseKt {
public static /* synthetic */ Object transaction$default(SQLiteDatabase sQLiteDatabase, boolean z, Function1 body, int i, Object obj) {
if ((i & 1) != 0) {
z = true;
}
Intrinsics.checkNotNullParameter(sQLiteDatabase, "<this>");
Intrinsics.checkNotNullParameter(body, "body");
if (z) {
sQLiteDatabase.beginTransaction();
} else {
sQLiteDatabase.beginTransactionNonExclusive();
}
try {
Object invoke = body.invoke(sQLiteDatabase);
sQLiteDatabase.setTransactionSuccessful();
return invoke;
} finally {
InlineMarker.finallyStart(1);
sQLiteDatabase.endTransaction();
InlineMarker.finallyEnd(1);
}
}
public static final <T> T transaction(SQLiteDatabase sQLiteDatabase, boolean z, Function1<? super SQLiteDatabase, ? extends T> body) {
Intrinsics.checkNotNullParameter(sQLiteDatabase, "<this>");
Intrinsics.checkNotNullParameter(body, "body");
if (z) {
sQLiteDatabase.beginTransaction();
} else {
sQLiteDatabase.beginTransactionNonExclusive();
}
try {
T invoke = body.invoke(sQLiteDatabase);
sQLiteDatabase.setTransactionSuccessful();
return invoke;
} finally {
InlineMarker.finallyStart(1);
sQLiteDatabase.endTransaction();
InlineMarker.finallyEnd(1);
}
}
}

View File

@ -0,0 +1,124 @@
package androidx.core.graphics;
import android.graphics.Bitmap;
import android.graphics.BlendMode;
import android.graphics.ColorSpace;
import android.graphics.Paint;
import android.os.Build;
/* loaded from: classes.dex */
public final class BitmapCompat {
public static int sizeAtStep(int i, int i2, int i3, int i4) {
return i3 == 0 ? i2 : i3 > 0 ? i * (1 << (i4 - i3)) : i2 << ((-i3) - 1);
}
public static boolean hasMipMap(Bitmap bitmap) {
return Api17Impl.hasMipMap(bitmap);
}
public static void setHasMipMap(Bitmap bitmap, boolean z) {
Api17Impl.setHasMipMap(bitmap, z);
}
public static int getAllocationByteCount(Bitmap bitmap) {
return Api19Impl.getAllocationByteCount(bitmap);
}
/* JADX WARN: Code restructure failed: missing block: B:95:0x01a5, code lost:
if (androidx.core.graphics.BitmapCompat.Api27Impl.isAlreadyF16AndLinear(r10) == false) goto L122;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static android.graphics.Bitmap createScaledBitmap(android.graphics.Bitmap r22, int r23, int r24, android.graphics.Rect r25, boolean r26) {
/*
Method dump skipped, instructions count: 530
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.core.graphics.BitmapCompat.createScaledBitmap(android.graphics.Bitmap, int, int, android.graphics.Rect, boolean):android.graphics.Bitmap");
}
private BitmapCompat() {
}
static class Api17Impl {
private Api17Impl() {
}
static boolean hasMipMap(Bitmap bitmap) {
return bitmap.hasMipMap();
}
static void setHasMipMap(Bitmap bitmap, boolean z) {
bitmap.setHasMipMap(z);
}
}
static class Api19Impl {
private Api19Impl() {
}
static int getAllocationByteCount(Bitmap bitmap) {
return bitmap.getAllocationByteCount();
}
}
static class Api27Impl {
private Api27Impl() {
}
static Bitmap createBitmapWithSourceColorspace(int i, int i2, Bitmap bitmap, boolean z) {
Bitmap.Config config = bitmap.getConfig();
ColorSpace colorSpace = bitmap.getColorSpace();
ColorSpace colorSpace2 = ColorSpace.get(ColorSpace.Named.LINEAR_EXTENDED_SRGB);
if (z && !bitmap.getColorSpace().equals(colorSpace2)) {
config = Bitmap.Config.RGBA_F16;
colorSpace = colorSpace2;
} else if (bitmap.getConfig() == Bitmap.Config.HARDWARE) {
config = Bitmap.Config.ARGB_8888;
if (Build.VERSION.SDK_INT >= 31) {
config = Api31Impl.getHardwareBitmapConfig(bitmap);
}
}
return Bitmap.createBitmap(i, i2, config, bitmap.hasAlpha(), colorSpace);
}
static boolean isAlreadyF16AndLinear(Bitmap bitmap) {
return bitmap.getConfig() == Bitmap.Config.RGBA_F16 && bitmap.getColorSpace().equals(ColorSpace.get(ColorSpace.Named.LINEAR_EXTENDED_SRGB));
}
static Bitmap copyBitmapIfHardware(Bitmap bitmap) {
if (bitmap.getConfig() != Bitmap.Config.HARDWARE) {
return bitmap;
}
Bitmap.Config config = Bitmap.Config.ARGB_8888;
if (Build.VERSION.SDK_INT >= 31) {
config = Api31Impl.getHardwareBitmapConfig(bitmap);
}
return bitmap.copy(config, true);
}
}
static class Api29Impl {
private Api29Impl() {
}
static void setPaintBlendMode(Paint paint) {
paint.setBlendMode(BlendMode.SRC);
}
}
static class Api31Impl {
private Api31Impl() {
}
static Bitmap.Config getHardwareBitmapConfig(Bitmap bitmap) {
if (bitmap.getHardwareBuffer().getFormat() == 22) {
return Bitmap.Config.RGBA_F16;
}
return Bitmap.Config.ARGB_8888;
}
}
}

View File

@ -0,0 +1,112 @@
package androidx.core.graphics;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.ColorSpace;
import android.graphics.Point;
import android.graphics.PointF;
import androidx.constraintlayout.core.motion.utils.TypedValues;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: Bitmap.kt */
@Metadata(d1 = {"\u0000D\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\b\u001a#\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00032\b\b\u0002\u0010\u0005\u001a\u00020\u0006H\u0086\b\u001a7\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00032\b\b\u0002\u0010\u0005\u001a\u00020\u00062\b\b\u0002\u0010\u0007\u001a\u00020\b2\b\b\u0002\u0010\t\u001a\u00020\nH\u0087\b\u001a)\u0010\u000b\u001a\u00020\u0001*\u00020\u00012\u0017\u0010\f\u001a\u0013\u0012\u0004\u0012\u00020\u000e\u0012\u0004\u0012\u00020\u000f0\\u0006\u0002\b\u0010H\u0086\\u0001\u0000\u001a\u0015\u0010\u0011\u001a\u00020\b*\u00020\u00012\u0006\u0010\u0012\u001a\u00020\u0013H\u0086\n\u001a\u0015\u0010\u0011\u001a\u00020\b*\u00020\u00012\u0006\u0010\u0012\u001a\u00020\u0014H\u0086\n\u001a\u001d\u0010\u0015\u001a\u00020\u0003*\u00020\u00012\u0006\u0010\u0016\u001a\u00020\u00032\u0006\u0010\u0017\u001a\u00020\u0003H\u0086\n\u001a'\u0010\u0018\u001a\u00020\u0001*\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00032\b\b\u0002\u0010\u0019\u001a\u00020\bH\u0086\b\u001a'\u0010\u001a\u001a\u00020\u000f*\u00020\u00012\u0006\u0010\u0016\u001a\u00020\u00032\u0006\u0010\u0017\u001a\u00020\u00032\b\b\u0001\u0010\u001b\u001a\u00020\u0003H\u0086\n\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006\u001c"}, d2 = {"createBitmap", "Landroid/graphics/Bitmap;", "width", "", "height", "config", "Landroid/graphics/Bitmap$Config;", "hasAlpha", "", "colorSpace", "Landroid/graphics/ColorSpace;", "applyCanvas", "block", "Lkotlin/Function1;", "Landroid/graphics/Canvas;", "", "Lkotlin/ExtensionFunctionType;", "contains", "p", "Landroid/graphics/Point;", "Landroid/graphics/PointF;", "get", "x", "y", "scale", "filter", "set", TypedValues.Custom.S_COLOR, "core-ktx_release"}, k = 2, mv = {1, 7, 1}, xi = 48)
/* loaded from: classes.dex */
public final class BitmapKt {
public static final Bitmap applyCanvas(Bitmap bitmap, Function1<? super Canvas, Unit> block) {
Intrinsics.checkNotNullParameter(bitmap, "<this>");
Intrinsics.checkNotNullParameter(block, "block");
block.invoke(new Canvas(bitmap));
return bitmap;
}
public static final int get(Bitmap bitmap, int i, int i2) {
Intrinsics.checkNotNullParameter(bitmap, "<this>");
return bitmap.getPixel(i, i2);
}
public static final void set(Bitmap bitmap, int i, int i2, int i3) {
Intrinsics.checkNotNullParameter(bitmap, "<this>");
bitmap.setPixel(i, i2, i3);
}
public static /* synthetic */ Bitmap scale$default(Bitmap bitmap, int i, int i2, boolean z, int i3, Object obj) {
if ((i3 & 4) != 0) {
z = true;
}
Intrinsics.checkNotNullParameter(bitmap, "<this>");
Bitmap createScaledBitmap = Bitmap.createScaledBitmap(bitmap, i, i2, z);
Intrinsics.checkNotNullExpressionValue(createScaledBitmap, "createScaledBitmap(this, width, height, filter)");
return createScaledBitmap;
}
public static final Bitmap scale(Bitmap bitmap, int i, int i2, boolean z) {
Intrinsics.checkNotNullParameter(bitmap, "<this>");
Bitmap createScaledBitmap = Bitmap.createScaledBitmap(bitmap, i, i2, z);
Intrinsics.checkNotNullExpressionValue(createScaledBitmap, "createScaledBitmap(this, width, height, filter)");
return createScaledBitmap;
}
public static /* synthetic */ Bitmap createBitmap$default(int i, int i2, Bitmap.Config config, int i3, Object obj) {
if ((i3 & 4) != 0) {
config = Bitmap.Config.ARGB_8888;
}
Intrinsics.checkNotNullParameter(config, "config");
Bitmap createBitmap = Bitmap.createBitmap(i, i2, config);
Intrinsics.checkNotNullExpressionValue(createBitmap, "createBitmap(width, height, config)");
return createBitmap;
}
public static final Bitmap createBitmap(int i, int i2, Bitmap.Config config) {
Intrinsics.checkNotNullParameter(config, "config");
Bitmap createBitmap = Bitmap.createBitmap(i, i2, config);
Intrinsics.checkNotNullExpressionValue(createBitmap, "createBitmap(width, height, config)");
return createBitmap;
}
public static /* synthetic */ Bitmap createBitmap$default(int i, int i2, Bitmap.Config config, boolean z, ColorSpace colorSpace, int i3, Object obj) {
Bitmap createBitmap;
ColorSpace.Named named;
if ((i3 & 4) != 0) {
config = Bitmap.Config.ARGB_8888;
}
if ((i3 & 8) != 0) {
z = true;
}
if ((i3 & 16) != 0) {
named = ColorSpace.Named.SRGB;
colorSpace = ColorSpace.get(named);
Intrinsics.checkNotNullExpressionValue(colorSpace, "get(ColorSpace.Named.SRGB)");
}
Intrinsics.checkNotNullParameter(config, "config");
Intrinsics.checkNotNullParameter(colorSpace, "colorSpace");
createBitmap = Bitmap.createBitmap(i, i2, config, z, colorSpace);
Intrinsics.checkNotNullExpressionValue(createBitmap, "createBitmap(width, heig…ig, hasAlpha, colorSpace)");
return createBitmap;
}
public static final Bitmap createBitmap(int i, int i2, Bitmap.Config config, boolean z, ColorSpace colorSpace) {
Bitmap createBitmap;
Intrinsics.checkNotNullParameter(config, "config");
Intrinsics.checkNotNullParameter(colorSpace, "colorSpace");
createBitmap = Bitmap.createBitmap(i, i2, config, z, colorSpace);
Intrinsics.checkNotNullExpressionValue(createBitmap, "createBitmap(width, heig…ig, hasAlpha, colorSpace)");
return createBitmap;
}
public static final boolean contains(Bitmap bitmap, Point p) {
Intrinsics.checkNotNullParameter(bitmap, "<this>");
Intrinsics.checkNotNullParameter(p, "p");
int width = bitmap.getWidth();
int i = p.x;
return i >= 0 && i < width && p.y >= 0 && p.y < bitmap.getHeight();
}
public static final boolean contains(Bitmap bitmap, PointF p) {
Intrinsics.checkNotNullParameter(bitmap, "<this>");
Intrinsics.checkNotNullParameter(p, "p");
return p.x >= 0.0f && p.x < ((float) bitmap.getWidth()) && p.y >= 0.0f && p.y < ((float) bitmap.getHeight());
}
}

View File

@ -0,0 +1,39 @@
package androidx.core.graphics;
import android.graphics.BlendMode;
import android.graphics.BlendModeColorFilter;
import android.graphics.ColorFilter;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.os.Build;
import androidx.core.graphics.BlendModeUtils;
/* loaded from: classes.dex */
public class BlendModeColorFilterCompat {
public static ColorFilter createBlendModeColorFilterCompat(int i, BlendModeCompat blendModeCompat) {
if (Build.VERSION.SDK_INT >= 29) {
Object obtainBlendModeFromCompat = BlendModeUtils.Api29Impl.obtainBlendModeFromCompat(blendModeCompat);
if (obtainBlendModeFromCompat != null) {
return Api29Impl.createBlendModeColorFilter(i, obtainBlendModeFromCompat);
}
return null;
}
PorterDuff.Mode obtainPorterDuffFromCompat = BlendModeUtils.obtainPorterDuffFromCompat(blendModeCompat);
if (obtainPorterDuffFromCompat != null) {
return new PorterDuffColorFilter(i, obtainPorterDuffFromCompat);
}
return null;
}
private BlendModeColorFilterCompat() {
}
static class Api29Impl {
private Api29Impl() {
}
static ColorFilter createBlendModeColorFilter(int i, Object obj) {
return new BlendModeColorFilter(i, (BlendMode) obj);
}
}
}

View File

@ -0,0 +1,34 @@
package androidx.core.graphics;
/* loaded from: classes.dex */
public enum BlendModeCompat {
CLEAR,
SRC,
DST,
SRC_OVER,
DST_OVER,
SRC_IN,
DST_IN,
SRC_OUT,
DST_OUT,
SRC_ATOP,
DST_ATOP,
XOR,
PLUS,
MODULATE,
SCREEN,
OVERLAY,
DARKEN,
LIGHTEN,
COLOR_DODGE,
COLOR_BURN,
HARD_LIGHT,
SOFT_LIGHT,
DIFFERENCE,
EXCLUSION,
MULTIPLY,
HUE,
SATURATION,
COLOR,
LUMINOSITY
}

View File

@ -0,0 +1,215 @@
package androidx.core.graphics;
import android.graphics.BlendMode;
import android.graphics.PorterDuff;
/* loaded from: classes.dex */
class BlendModeUtils {
private BlendModeUtils() {
}
static class Api29Impl {
private Api29Impl() {
}
static Object obtainBlendModeFromCompat(BlendModeCompat blendModeCompat) {
switch (AnonymousClass1.$SwitchMap$androidx$core$graphics$BlendModeCompat[blendModeCompat.ordinal()]) {
case 1:
return BlendMode.CLEAR;
case 2:
return BlendMode.SRC;
case 3:
return BlendMode.DST;
case 4:
return BlendMode.SRC_OVER;
case 5:
return BlendMode.DST_OVER;
case 6:
return BlendMode.SRC_IN;
case 7:
return BlendMode.DST_IN;
case 8:
return BlendMode.SRC_OUT;
case 9:
return BlendMode.DST_OUT;
case 10:
return BlendMode.SRC_ATOP;
case 11:
return BlendMode.DST_ATOP;
case 12:
return BlendMode.XOR;
case 13:
return BlendMode.PLUS;
case 14:
return BlendMode.MODULATE;
case 15:
return BlendMode.SCREEN;
case 16:
return BlendMode.OVERLAY;
case 17:
return BlendMode.DARKEN;
case 18:
return BlendMode.LIGHTEN;
case 19:
return BlendMode.COLOR_DODGE;
case 20:
return BlendMode.COLOR_BURN;
case 21:
return BlendMode.HARD_LIGHT;
case 22:
return BlendMode.SOFT_LIGHT;
case 23:
return BlendMode.DIFFERENCE;
case 24:
return BlendMode.EXCLUSION;
case 25:
return BlendMode.MULTIPLY;
case 26:
return BlendMode.HUE;
case 27:
return BlendMode.SATURATION;
case 28:
return BlendMode.COLOR;
case 29:
return BlendMode.LUMINOSITY;
default:
return null;
}
}
}
/* renamed from: androidx.core.graphics.BlendModeUtils$1, reason: invalid class name */
static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] $SwitchMap$androidx$core$graphics$BlendModeCompat;
static {
int[] iArr = new int[BlendModeCompat.values().length];
$SwitchMap$androidx$core$graphics$BlendModeCompat = iArr;
try {
iArr[BlendModeCompat.CLEAR.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.SRC.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.DST.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.SRC_OVER.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.DST_OVER.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.SRC_IN.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.DST_IN.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.SRC_OUT.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.DST_OUT.ordinal()] = 9;
} catch (NoSuchFieldError unused9) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.SRC_ATOP.ordinal()] = 10;
} catch (NoSuchFieldError unused10) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.DST_ATOP.ordinal()] = 11;
} catch (NoSuchFieldError unused11) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.XOR.ordinal()] = 12;
} catch (NoSuchFieldError unused12) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.PLUS.ordinal()] = 13;
} catch (NoSuchFieldError unused13) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.MODULATE.ordinal()] = 14;
} catch (NoSuchFieldError unused14) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.SCREEN.ordinal()] = 15;
} catch (NoSuchFieldError unused15) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.OVERLAY.ordinal()] = 16;
} catch (NoSuchFieldError unused16) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.DARKEN.ordinal()] = 17;
} catch (NoSuchFieldError unused17) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.LIGHTEN.ordinal()] = 18;
} catch (NoSuchFieldError unused18) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.COLOR_DODGE.ordinal()] = 19;
} catch (NoSuchFieldError unused19) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.COLOR_BURN.ordinal()] = 20;
} catch (NoSuchFieldError unused20) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.HARD_LIGHT.ordinal()] = 21;
} catch (NoSuchFieldError unused21) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.SOFT_LIGHT.ordinal()] = 22;
} catch (NoSuchFieldError unused22) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.DIFFERENCE.ordinal()] = 23;
} catch (NoSuchFieldError unused23) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.EXCLUSION.ordinal()] = 24;
} catch (NoSuchFieldError unused24) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.MULTIPLY.ordinal()] = 25;
} catch (NoSuchFieldError unused25) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.HUE.ordinal()] = 26;
} catch (NoSuchFieldError unused26) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.SATURATION.ordinal()] = 27;
} catch (NoSuchFieldError unused27) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.COLOR.ordinal()] = 28;
} catch (NoSuchFieldError unused28) {
}
try {
$SwitchMap$androidx$core$graphics$BlendModeCompat[BlendModeCompat.LUMINOSITY.ordinal()] = 29;
} catch (NoSuchFieldError unused29) {
}
}
}
static PorterDuff.Mode obtainPorterDuffFromCompat(BlendModeCompat blendModeCompat) {
if (blendModeCompat == null) {
return null;
}
switch (AnonymousClass1.$SwitchMap$androidx$core$graphics$BlendModeCompat[blendModeCompat.ordinal()]) {
}
return null;
}
}

Some files were not shown because too many files have changed in this diff Show More