Fix an error
This commit is contained in:
parent
adcefa4df4
commit
904b3fa7db
|
@ -138,6 +138,6 @@ dependencies {
|
||||||
implementation 'com.github.penfeizhou.android.animation:gif:1.1.0'
|
implementation 'com.github.penfeizhou.android.animation:gif:1.1.0'
|
||||||
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
|
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
|
||||||
implementation 'com.github.smarteist:autoimageslider:1.3.2'
|
implementation 'com.github.smarteist:autoimageslider:1.3.2'
|
||||||
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-beta-2'
|
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0'
|
||||||
implementation 'com.jaredrummler:cyanea:1.0.2'
|
implementation 'com.jaredrummler:cyanea:1.0.2'
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import android.content.Context;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.StrictMode;
|
||||||
import android.view.ActionMode;
|
import android.view.ActionMode;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
@ -22,6 +23,7 @@ import com.vanniktech.emoji.one.EmojiOneProvider;
|
||||||
|
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
|
|
||||||
|
import app.fedilab.android.BuildConfig;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
|
||||||
|
@ -48,7 +50,7 @@ public class BaseActivity extends CyaneaAppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
|
||||||
/* if (BuildConfig.DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
|
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
|
||||||
.detectDiskReads()
|
.detectDiskReads()
|
||||||
.detectDiskWrites()
|
.detectDiskWrites()
|
||||||
|
@ -63,7 +65,7 @@ public class BaseActivity extends CyaneaAppCompatActivity {
|
||||||
.penaltyLog()
|
.penaltyLog()
|
||||||
.penaltyDeath()
|
.penaltyDeath()
|
||||||
.build());
|
.build());
|
||||||
}*/
|
}
|
||||||
canShowActionMode = true;
|
canShowActionMode = true;
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
|
|
@ -5161,13 +5161,7 @@ public class API {
|
||||||
filters = parseFilters(new JSONArray(response));
|
filters = parseFilters(new JSONArray(response));
|
||||||
} catch (HttpsConnection.HttpsConnectionException e) {
|
} catch (HttpsConnection.HttpsConnectionException e) {
|
||||||
setError(e.getStatusCode(), e);
|
setError(e.getStatusCode(), e);
|
||||||
} catch (NoSuchAlgorithmException e) {
|
} catch (NoSuchAlgorithmException | IOException | KeyManagementException | JSONException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (KeyManagementException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
apiResponse.setFilters(filters);
|
apiResponse.setFilters(filters);
|
||||||
|
@ -5190,13 +5184,7 @@ public class API {
|
||||||
filters.add(filter);
|
filters.add(filter);
|
||||||
} catch (HttpsConnection.HttpsConnectionException e) {
|
} catch (HttpsConnection.HttpsConnectionException e) {
|
||||||
setError(e.getStatusCode(), e);
|
setError(e.getStatusCode(), e);
|
||||||
} catch (NoSuchAlgorithmException e) {
|
} catch (NoSuchAlgorithmException | IOException | KeyManagementException | JSONException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (KeyManagementException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
apiResponse.setFilters(filters);
|
apiResponse.setFilters(filters);
|
||||||
|
|
|
@ -184,7 +184,8 @@ public class HttpsConnection {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= 21) {
|
if (Build.VERSION.SDK_INT >= 21) {
|
||||||
OkHttpClient.Builder builder = new OkHttpClient.Builder().connectTimeout(timeout, TimeUnit.SECONDS).cache(new Cache(context.getCacheDir(), cacheSize));
|
Cache cache = new Cache(context.getCacheDir(), cacheSize);
|
||||||
|
OkHttpClient.Builder builder = new OkHttpClient.Builder().connectTimeout(timeout, TimeUnit.SECONDS).cache(cache);
|
||||||
if (proxy != null) {
|
if (proxy != null) {
|
||||||
builder.proxy(proxy);
|
builder.proxy(proxy);
|
||||||
}
|
}
|
||||||
|
@ -212,6 +213,14 @@ public class HttpsConnection {
|
||||||
} else {
|
} else {
|
||||||
throw new HttpsConnectionException(code, error);
|
throw new HttpsConnectionException(code, error);
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
if (!cache.isClosed()) {
|
||||||
|
try {
|
||||||
|
cache.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue