use of edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug in project carat by amplab.
the class SettingsSuggestionAdapter method acceptDisableLocSev.
private void acceptDisableLocSev(ArrayList<SimpleHogBug> result) {
List<String> providers = SamplingLibrary.getEnabledLocationProviders(a.getApplicationContext());
if (providers != null && providers.size() > 1) {
// Always has 1 provider
SimpleHogBug item = new SimpleHogBug(a.getString(R.string.disablelocation), Constants.Type.OS);
result.add(item);
}
}
use of edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug in project carat by amplab.
the class SettingsSuggestionAdapter method acceptSettings.
private void acceptSettings(SimpleHogBug[] inputArrayList, ArrayList<SimpleHogBug> resultArrayList) {
if (inputArrayList == null)
return;
for (SimpleHogBug item : inputArrayList) {
if (item == null)
continue;
// TODO: can we use the same formula for calculating the expected improvement?
// if not, embed the formula here or fetch the value from the server
// double benefit = 100.0 / item.getExpectedValueWithout() - 100.0
// / item.getExpectedValue();
// TODO other filter conditions?
// Limit max number of items?
String appName = item.getAppName();
if (appName == null)
appName = a.getString(R.string.unknown);
// TODO: skip (leave out) special cases
boolean someCondition = true;
if (someCondition)
continue;
// TODO: fill in the list if it's empty (for non focus-group users)
// if (addFakeItem && appName.equals(FAKE_ITEM))
// resultArrayList.add(item);
// Filter out if benefit is too small
// TODO: disabled this check for the time being, until we have a calculated benefit
// if (SamplingLibrary.isSettingsSuggestion(a.getApplicationContext(), appName) && benefit > 60 ) {
resultArrayList.add(item);
// }
}
}
use of edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug in project carat by amplab.
the class SettingsSuggestionAdapter method questionnaire.
private void questionnaire(ArrayList<SimpleHogBug> result) {
SimpleHogBug item = new SimpleHogBug(a.getString(R.string.questionnaire), Constants.Type.OTHER, a.getString(R.string.questionnaire2));
result.add(item);
}
use of edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug in project carat by amplab.
the class SettingsSuggestionAdapter method helpCaratCollectMoreData.
private void helpCaratCollectMoreData(ArrayList<SimpleHogBug> result) {
SimpleHogBug item = new SimpleHogBug(a.getString(R.string.helpcarat), Constants.Type.OS);
result.add(item);
}
use of edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug in project carat by amplab.
the class SettingsSuggestionAdapter method acceptDisableHapticFb.
private void acceptDisableHapticFb(ArrayList<SimpleHogBug> result) {
try {
if (Settings.System.getInt(a.getApplicationContext().getContentResolver(), Settings.System.HAPTIC_FEEDBACK_ENABLED) == 1) {
SimpleHogBug item = new SimpleHogBug(a.getString(R.string.disablehapticfeedback), Constants.Type.OS);
// TODO Get expected benefit
result.add(item);
}
} catch (SettingNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Aggregations