Add separate strict mode settings

pull/795/head
Alex Baker 7 years ago
parent cb89bbf6e4
commit 621ccf561a

@ -33,7 +33,7 @@ public class BuildSetup {
if (preferences.getBoolean(R.string.p_leak_canary, false)) {
LeakCanary.install(application);
}
if (preferences.getBoolean(R.string.p_strict_mode, false)) {
if (preferences.getBoolean(R.string.p_strict_mode_thread, false)) {
StrictMode.setThreadPolicy(
new StrictMode.ThreadPolicy.Builder()
.detectDiskReads()
@ -41,6 +41,8 @@ public class BuildSetup {
.detectNetwork()
.penaltyLog()
.build());
}
if (preferences.getBoolean(R.string.p_strict_mode_vm, false)) {
StrictMode.setVmPolicy(
new StrictMode.VmPolicy.Builder()
.detectLeakedSqlLiteObjects()

@ -6,8 +6,12 @@
android:title="@string/debug_leak_canary" />
<CheckBoxPreference
android:key="@string/p_strict_mode"
android:title="@string/debug_strict_mode"/>
android:key="@string/p_strict_mode_thread"
android:title="@string/debug_strict_mode_thread"/>
<CheckBoxPreference
android:key="@string/p_strict_mode_vm"
android:title="@string/debug_strict_mode_vm"/>
<CheckBoxPreference
android:key="@string/p_debug_pro"

@ -280,7 +280,8 @@
<string name="p_default_remote_list">default_remote_list</string>
<string name="debug_consume">Consume</string>
<string name="debug_strict_mode">Strict mode</string>
<string name="debug_strict_mode_thread">Strict mode - Thread</string>
<string name="debug_strict_mode_vm">Strict mode - VM</string>
<string name="debug_leak_canary">LeakCanary</string>
<string name="debug_pro">Unlock pro</string>
<string name="debug_buy">Buy</string>
@ -289,7 +290,8 @@
<string name="p_use_native_datetime_pickers">use_native_datetime_pickers</string>
<string name="p_background_sync">gtask_background_sync</string>
<string name="p_bundle_notifications">bundle_notifications</string>
<string name="p_strict_mode">strict_mode</string>
<string name="p_strict_mode_vm">strict_mode_vm</string>
<string name="p_strict_mode_thread">strict_mode_thread</string>
<string name="p_leak_canary">leak_canary</string>
<string name="p_debug_pro">debug_pro</string>
<string name="warned_play_services">warned_play_services</string>

Loading…
Cancel
Save