mirror of
https://github.com/mauiaaron/apple2.git
synced 2024-06-26 00:29:27 +00:00
Add ability to disable crash checking/reporting in release builds
This commit is contained in:
parent
6a8290d22c
commit
54a92033b0
|
@ -134,6 +134,10 @@ public class Apple2CrashHandler {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!Apple2Preferences.CRASH_CHECK.booleanValue(activity)) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean previouslyRanCrashCheck = mAlreadyRanCrashCheck.getAndSet(true);
|
||||
|
||||
boolean previouslySentReport = mAlreadySentReport.get();
|
||||
|
|
|
@ -580,6 +580,17 @@ public enum Apple2Preferences {
|
|||
boolean enabled = booleanValue(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean booleanValue(Apple2Activity activity) {
|
||||
return activity.getPreferences(Context.MODE_PRIVATE).getBoolean(toString(), true);
|
||||
}
|
||||
},
|
||||
CRASH_CHECK {
|
||||
@Override
|
||||
public void load(Apple2Activity activity) {
|
||||
boolean enabled = booleanValue(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean booleanValue(Apple2Activity activity) {
|
||||
return activity.getPreferences(Context.MODE_PRIVATE).getBoolean(toString(), true);
|
||||
|
|
|
@ -312,6 +312,21 @@ public class Apple2SettingsMenu extends Apple2AbstractMenu {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(final Apple2Activity activity, View convertView) {
|
||||
convertView = _basicView(activity, this, convertView);
|
||||
if (!BuildConfig.DEBUG) {
|
||||
CheckBox cb = _addCheckbox(activity, this, convertView, Apple2Preferences.CRASH_CHECK.booleanValue(activity));
|
||||
cb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
Apple2Preferences.CRASH_CHECK.saveBoolean(activity, isChecked);
|
||||
}
|
||||
});
|
||||
}
|
||||
return convertView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleSelection(final Apple2Activity activity, final Apple2AbstractMenu settingsMenu, boolean isChecked) {
|
||||
|
||||
|
@ -343,8 +358,6 @@ public class Apple2SettingsMenu extends Apple2AbstractMenu {
|
|||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// TODO FIXME : checkbox on whether to enable checking/sending crashes
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user