From b54c22d8f6d855727a2d5c9ed9f2a8f3e7206bec Mon Sep 17 00:00:00 2001 From: Juby210 Date: Fri, 29 Oct 2021 02:33:00 +0200 Subject: [PATCH] 98.10 - Stable (98010) --- app/build.gradle | 4 +-- app/src/main/AndroidManifest.xml | 2 +- ...ionCommands$requestFrecencyCommands$1.java | 24 +++++++++++++++++ ...ionCommands$requestFrecencyCommands$2.java | 24 +++++++++++++++++ .../stores/StoreApplicationCommands.java | 9 +++++-- .../StoreStream$storeThreadScheduler$1.java | 5 +++- .../java/com/discord/stores/StoreStream.java | 26 +++++++++++++++++++ .../main/java/com/discord/stores/StoreV2.java | 13 ++++++++++ .../widgets/settings/WidgetSettings.java | 2 +- app/src/main/res/values/strings.xml | 2 +- 10 files changed, 103 insertions(+), 8 deletions(-) create mode 100644 app/src/main/java/com/discord/stores/StoreApplicationCommands$requestFrecencyCommands$1.java create mode 100644 app/src/main/java/com/discord/stores/StoreApplicationCommands$requestFrecencyCommands$2.java diff --git a/app/build.gradle b/app/build.gradle index 855bd310a8..bc417016f9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId 'com.discord' minSdkVersion 21 targetSdkVersion 29 - versionCode 98009 - versionName "98.9 - Stable" + versionCode 98010 + versionName "98.10 - Stable" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index bb4d0b50cd..ca1ba54b4c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ - + diff --git a/app/src/main/java/com/discord/stores/StoreApplicationCommands$requestFrecencyCommands$1.java b/app/src/main/java/com/discord/stores/StoreApplicationCommands$requestFrecencyCommands$1.java new file mode 100644 index 0000000000..6c556da395 --- /dev/null +++ b/app/src/main/java/com/discord/stores/StoreApplicationCommands$requestFrecencyCommands$1.java @@ -0,0 +1,24 @@ +package com.discord.stores; + +import c0.t.n; +import c0.z.d.o; +import kotlin.Unit; +import kotlin.jvm.functions.Function0; +/* compiled from: StoreApplicationCommands.kt */ +public final class StoreApplicationCommands$requestFrecencyCommands$1 extends o implements Function0 { + public final /* synthetic */ String $nonce; + public final /* synthetic */ StoreApplicationCommands this$0; + + /* JADX INFO: super call moved to the top of the method (can break code semantics) */ + public StoreApplicationCommands$requestFrecencyCommands$1(StoreApplicationCommands storeApplicationCommands, String str) { + super(0); + this.this$0 = storeApplicationCommands; + this.$nonce = str; + } + + @Override // kotlin.jvm.functions.Function0 + /* renamed from: invoke */ + public final void mo17invoke() { + StoreApplicationCommands.access$handleFrecencyCommandsUpdate(this.this$0, this.$nonce, n.emptyList()); + } +} diff --git a/app/src/main/java/com/discord/stores/StoreApplicationCommands$requestFrecencyCommands$2.java b/app/src/main/java/com/discord/stores/StoreApplicationCommands$requestFrecencyCommands$2.java new file mode 100644 index 0000000000..7de4881880 --- /dev/null +++ b/app/src/main/java/com/discord/stores/StoreApplicationCommands$requestFrecencyCommands$2.java @@ -0,0 +1,24 @@ +package com.discord.stores; + +import c0.t.n; +import c0.z.d.o; +import kotlin.Unit; +import kotlin.jvm.functions.Function0; +/* compiled from: StoreApplicationCommands.kt */ +public final class StoreApplicationCommands$requestFrecencyCommands$2 extends o implements Function0 { + public final /* synthetic */ String $nonce; + public final /* synthetic */ StoreApplicationCommands this$0; + + /* JADX INFO: super call moved to the top of the method (can break code semantics) */ + public StoreApplicationCommands$requestFrecencyCommands$2(StoreApplicationCommands storeApplicationCommands, String str) { + super(0); + this.this$0 = storeApplicationCommands; + this.$nonce = str; + } + + @Override // kotlin.jvm.functions.Function0 + /* renamed from: invoke */ + public final void mo17invoke() { + StoreApplicationCommands.access$handleFrecencyCommandsUpdate(this.this$0, this.$nonce, n.emptyList()); + } +} diff --git a/app/src/main/java/com/discord/stores/StoreApplicationCommands.java b/app/src/main/java/com/discord/stores/StoreApplicationCommands.java index 102d7d11d1..a85c167a7b 100644 --- a/app/src/main/java/com/discord/stores/StoreApplicationCommands.java +++ b/app/src/main/java/com/discord/stores/StoreApplicationCommands.java @@ -368,6 +368,10 @@ public final class StoreApplicationCommands extends StoreV2 { storeApplicationCommands.handleDiscoverCommandsUpdate(list); } + public static final /* synthetic */ void access$handleFrecencyCommandsUpdate(StoreApplicationCommands storeApplicationCommands, String str, List list) { + storeApplicationCommands.handleFrecencyCommandsUpdate(str, list); + } + public static final /* synthetic */ void access$handleGuildApplicationsUpdate(StoreApplicationCommands storeApplicationCommands, List list) { storeApplicationCommands.handleGuildApplicationsUpdate(list); } @@ -508,6 +512,7 @@ public final class StoreApplicationCommands extends StoreV2 { markChanged(DiscoverCommandsUpdate); } + @StoreThread private final void handleFrecencyCommandsUpdate(String str, List list) { int intValue; boolean z2; @@ -855,9 +860,9 @@ public final class StoreApplicationCommands extends StoreV2 { } } if (!(!arrayList2.isEmpty())) { - handleFrecencyCommandsUpdate(generateNonce, n.emptyList()); + this.dispatcher.schedule(new StoreApplicationCommands$requestFrecencyCommands$2(this, generateNonce)); } else if (!StoreGatewayConnection.requestApplicationCommands$default(this.storeGatewayConnection, j, generateNonce, false, null, null, 20, u.distinct(arrayList2), 24, null)) { - handleFrecencyCommandsUpdate(generateNonce, n.emptyList()); + this.dispatcher.schedule(new StoreApplicationCommands$requestFrecencyCommands$1(this, generateNonce)); } } } diff --git a/app/src/main/java/com/discord/stores/StoreStream$storeThreadScheduler$1.java b/app/src/main/java/com/discord/stores/StoreStream$storeThreadScheduler$1.java index 46d1a0b5af..341e28fa1e 100644 --- a/app/src/main/java/com/discord/stores/StoreStream$storeThreadScheduler$1.java +++ b/app/src/main/java/com/discord/stores/StoreStream$storeThreadScheduler$1.java @@ -1,5 +1,6 @@ package com.discord.stores; +import com.discord.stores.StoreStream; import java.util.concurrent.ThreadFactory; /* compiled from: StoreStream.kt */ public final class StoreStream$storeThreadScheduler$1 implements ThreadFactory { @@ -7,8 +8,10 @@ public final class StoreStream$storeThreadScheduler$1 implements ThreadFactory { @Override // java.util.concurrent.ThreadFactory public final Thread newThread(Runnable runnable) { - Thread thread = new Thread(runnable, "Main-StoreThread"); + StoreStream.Companion companion = StoreStream.Companion; + Thread thread = new Thread(runnable, companion.getSTORE_THREAD_NAME()); thread.setPriority((int) 8.0d); + companion.setSTORE_THREAD_ID(thread.getId()); return thread; } } diff --git a/app/src/main/java/com/discord/stores/StoreStream.java b/app/src/main/java/com/discord/stores/StoreStream.java index 067773a174..ab2f7a48ce 100644 --- a/app/src/main/java/com/discord/stores/StoreStream.java +++ b/app/src/main/java/com/discord/stores/StoreStream.java @@ -110,6 +110,8 @@ public final class StoreStream { public static final Companion Companion = new Companion(null); private static final long DAY_IN_MILLS = TimeUnit.DAYS.toMillis(1); private static final String LAST_LOGGED_NOTIFICATION_PERMISSIONS_KEY = "last_logged_notification_permissions_key"; + private static long STORE_THREAD_ID; + private static final String STORE_THREAD_NAME = "Main-StoreThread"; private static final Lazy collector$delegate = g.lazy(StoreStream$Companion$collector$2.INSTANCE); private static boolean isInitialized; private final StoreAccessibility accessibility; @@ -652,6 +654,14 @@ public final class StoreStream { return getCollector().getRtcConnection$app_productionGoogleRelease(); } + public final long getSTORE_THREAD_ID() { + return StoreStream.access$getSTORE_THREAD_ID$cp(); + } + + public final String getSTORE_THREAD_NAME() { + return StoreStream.access$getSTORE_THREAD_NAME$cp(); + } + public final StoreSearch getSearch() { return getCollector().getSearch$app_productionGoogleRelease(); } @@ -798,6 +808,10 @@ public final class StoreStream { m.checkNotNullExpressionValue(access$getInitialized$p, "collector.initialized"); return access$getInitialized$p; } + + public final void setSTORE_THREAD_ID(long j) { + StoreStream.access$setSTORE_THREAD_ID$cp(j); + } } public StoreStream() { @@ -1060,6 +1074,14 @@ public final class StoreStream { return LAST_LOGGED_NOTIFICATION_PERMISSIONS_KEY; } + public static final /* synthetic */ long access$getSTORE_THREAD_ID$cp() { + return STORE_THREAD_ID; + } + + public static final /* synthetic */ String access$getSTORE_THREAD_NAME$cp() { + return STORE_THREAD_NAME; + } + public static final /* synthetic */ StoreStreamRtcConnection access$getStreamRtcConnection$p(StoreStream storeStream) { return storeStream.streamRtcConnection; } @@ -1384,6 +1406,10 @@ public final class StoreStream { isInitialized = z2; } + public static final /* synthetic */ void access$setSTORE_THREAD_ID$cp(long j) { + STORE_THREAD_ID = j; + } + public static final /* synthetic */ void access$startStoreInitializationTimer(StoreStream storeStream, NetworkMonitor networkMonitor) { storeStream.startStoreInitializationTimer(networkMonitor); } diff --git a/app/src/main/java/com/discord/stores/StoreV2.java b/app/src/main/java/com/discord/stores/StoreV2.java index 273ef6a379..17c25a161c 100644 --- a/app/src/main/java/com/discord/stores/StoreV2.java +++ b/app/src/main/java/com/discord/stores/StoreV2.java @@ -2,7 +2,9 @@ package com.discord.stores; import c0.t.r; import c0.z.d.m; +import com.discord.app.AppLog; import com.discord.stores.updates.ObservationDeck; +import com.discord.utilities.logging.Logger; import java.util.HashSet; import java.util.Set; import kotlin.jvm.internal.DefaultConstructorMarker; @@ -47,22 +49,33 @@ public abstract class StoreV2 extends Store implements DispatchHandler, Observat } } + private final void assertStoreThread() { + Thread currentThread = Thread.currentThread(); + m.checkNotNullExpressionValue(currentThread, "Thread.currentThread()"); + if (currentThread.getId() != StoreStream.Companion.getSTORE_THREAD_ID()) { + Logger.e$default(AppLog.g, "markChanged() should be run from the Store Dispatcher", new IllegalStateException("Dispatch not run on store thread"), null, 4, null); + } + } + public final Set getUpdateSources() { return this.updateSources; } public final void markChanged() { + assertStoreThread(); this.updateSources.add(this); } public final void markChanged(ObservationDeck.UpdateSource... updateSourceArr) { m.checkNotNullParameter(updateSourceArr, "updates"); + assertStoreThread(); markChanged(); r.addAll(this.updateSources, updateSourceArr); } public final void markUnchanged(ObservationDeck.UpdateSource updateSource) { m.checkNotNullParameter(updateSource, "updateSource"); + assertStoreThread(); this.updateSources.remove(updateSource); } diff --git a/app/src/main/java/com/discord/widgets/settings/WidgetSettings.java b/app/src/main/java/com/discord/widgets/settings/WidgetSettings.java index 8821c72e74..a47d67a23a 100644 --- a/app/src/main/java/com/discord/widgets/settings/WidgetSettings.java +++ b/app/src/main/java/com/discord/widgets/settings/WidgetSettings.java @@ -313,7 +313,7 @@ public final class WidgetSettings extends AppFragment implements OnTabSelectedLi TextView textView = binding.f; m.checkNotNullExpressionValue(textView, "appInfoHeader"); String string = getString(R.string.app_information); - textView.setText(string + " - 98.9 - Stable (98009)"); + textView.setText(string + " - 98.10 - Stable (98010)"); binding.A.setOnClickListener(new WidgetSettings$onViewBound$$inlined$with$lambda$3(this)); binding.u.setOnClickListener(WidgetSettings$onViewBound$1$5.INSTANCE); binding.q.setOnClickListener(WidgetSettings$onViewBound$1$6.INSTANCE); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 68eb4100b0..2a378b366f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1439,7 +1439,7 @@ Select a color Transparency Use Default - 5c3c1270ffe4420595a2589ed52467d7 + 4e4e3b15cb7e467e816a64e95e22e8e9 Coming Soon Slash command application {applicationName} {applicationName} application