File tree Expand file tree Collapse file tree
common/src/main/java/com/liskovsoft/smartyoutubetv2/common
src/main/java/com/liskovsoft/smartyoutubetv2/tv/ui/main Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ public class NetworkData extends DataSaverBase {
88 private static NetworkData sInstance ;
99
1010 private NetworkData (Context context ) {
11- super (context );
11+ super (context , true );
1212 }
1313
1414 public static NetworkData instance (Context context ) {
Original file line number Diff line number Diff line change 1212
1313public abstract class DataSaverBase extends DataChangeBase {
1414 private final AppPrefs mAppPrefs ;
15+ private final boolean mPersistImmediately ;
1516 private final String mDataKey ;
1617 private final List <Object > mValues ;
1718 private final Runnable mPersistStateInt = this ::persistStateInt ;
@@ -21,7 +22,12 @@ private interface Converter {
2122 }
2223
2324 public DataSaverBase (Context context ) {
25+ this (context , false );
26+ }
27+
28+ public DataSaverBase (Context context , boolean persistImmediately ) {
2429 mAppPrefs = AppPrefs .instance (context );
30+ mPersistImmediately = persistImmediately ;
2531 mDataKey = this .getClass ().getSimpleName ();
2632 mValues = new ArrayList <>();
2733 restoreState ();
@@ -98,7 +104,12 @@ public void persistNow() {
98104
99105 private void persistState () {
100106 onDataChange ();
101- Utils .postDelayed (mPersistStateInt , 10_000 );
107+
108+ if (mPersistImmediately ) {
109+ Utils .post (mPersistStateInt );
110+ } else {
111+ Utils .postDelayed (mPersistStateInt , 10_000 );
112+ }
102113 }
103114
104115 private void persistStateInt () {
Original file line number Diff line number Diff line change @@ -1303,6 +1303,5 @@ private static void persistData(Context context) {
13031303 MediaServiceData mediaServiceData = MediaServiceData .instance ();
13041304 mediaServiceData .persistNow ();
13051305 BlockedChannelData .instance (context ).persistNow ();
1306- NetworkData .instance (context ).persistNow ();
13071306 }
13081307}
Original file line number Diff line number Diff line change @@ -57,8 +57,8 @@ android {
5757 applicationId " app.smarttube"
5858 minSdkVersion project. properties. minSdkVersion
5959 targetSdkVersion project. properties. targetSdkVersion
60- versionCode 2378
61- versionName " 31.88 "
60+ versionCode 2379
61+ versionName " 31.89 "
6262 testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
6363 buildConfigField " long" , " TIMESTAMP" , System . currentTimeMillis() + " L"
6464
Original file line number Diff line number Diff line change @@ -59,8 +59,12 @@ public void onCreate() {
5959 //if (Build.VERSION.SDK_INT < 29 && Conscrypt.isAvailable()) {
6060 // Security.insertProviderAt(Conscrypt.newProvider(), 1);
6161 //}
62- if (NetworkData .instance (getApplicationContext ()).isConscryptEnabled () && Conscrypt .isAvailable ()) {
63- Security .insertProviderAt (Conscrypt .newProvider (), 1 );
62+ if (NetworkData .instance (this ).isConscryptEnabled ()) {
63+ try {
64+ Security .insertProviderAt (Conscrypt .newProvider (), 1 );
65+ } catch (Throwable e ) {
66+ // UnsatisfiedLinkError
67+ }
6468 }
6569
6670 setupGlobalExceptionHandler ();
You can’t perform that action at this time.
0 commit comments