discord-jadx/app/src/main/java/androidx/core/content/SharedPreferencesKt.java

40 lines
1.4 KiB
Java
Raw Normal View History

2021-07-24 02:37:17 +00:00
package androidx.core.content;
import android.annotation.SuppressLint;
import android.content.SharedPreferences;
import d0.z.d.m;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
/* compiled from: SharedPreferences.kt */
public final class SharedPreferencesKt {
@SuppressLint({"ApplySharedPref"})
public static final void edit(SharedPreferences sharedPreferences, boolean z2, Function1<? super SharedPreferences.Editor, Unit> function1) {
2021-09-21 07:33:49 +00:00
m.checkNotNullParameter(sharedPreferences, "<this>");
m.checkNotNullParameter(function1, "action");
2021-07-24 02:37:17 +00:00
SharedPreferences.Editor edit = sharedPreferences.edit();
2021-09-21 07:33:49 +00:00
m.checkNotNullExpressionValue(edit, "editor");
2021-07-24 02:37:17 +00:00
function1.invoke(edit);
if (z2) {
edit.commit();
} else {
edit.apply();
}
}
public static /* synthetic */ void edit$default(SharedPreferences sharedPreferences, boolean z2, Function1 function1, int i, Object obj) {
if ((i & 1) != 0) {
z2 = false;
}
2021-09-21 07:33:49 +00:00
m.checkNotNullParameter(sharedPreferences, "<this>");
m.checkNotNullParameter(function1, "action");
2021-07-24 02:37:17 +00:00
SharedPreferences.Editor edit = sharedPreferences.edit();
2021-09-21 07:33:49 +00:00
m.checkNotNullExpressionValue(edit, "editor");
2021-07-24 02:37:17 +00:00
function1.invoke(edit);
if (z2) {
edit.commit();
} else {
edit.apply();
}
}
}