use of edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug in project carat by amplab.
the class SettingsSuggestionAdapter method acceptSetScreenTimeout.
private void acceptSetScreenTimeout(ArrayList<SimpleHogBug> result) {
try {
if (Settings.System.getInt(a.getApplicationContext().getContentResolver(), Settings.System.SCREEN_OFF_TIMEOUT) > 30000) {
SimpleHogBug item = new SimpleHogBug(a.getString(R.string.shortenscreentimeout), Constants.Type.OS);
// TODO Get expected benefit
result.add(item);
}
} catch (SettingNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
use of edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug in project carat by amplab.
the class SettingsSuggestionAdapter method acceptDisableVibration.
private void acceptDisableVibration(ArrayList<SimpleHogBug> result) {
AudioManager myAudioManager = (AudioManager) a.getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
if (myAudioManager.getVibrateSetting(1) == 1 || myAudioManager.getVibrateSetting(0) == 1) {
SimpleHogBug item = new SimpleHogBug(a.getString(R.string.disablevibration), Constants.Type.OS);
// TODO Get expected benefit
result.add(item);
}
}
use of edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug in project carat by amplab.
the class SettingsSuggestionAdapter method acceptDisableBluetooth.
private void acceptDisableBluetooth(ArrayList<SimpleHogBug> result) {
BluetoothAdapter myBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (myBluetoothAdapter.isEnabled() == true) {
SimpleHogBug item = new SimpleHogBug(a.getString(R.string.disablebluetooth), 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 acceptDisableNetwork.
private void acceptDisableNetwork(ArrayList<SimpleHogBug> result) {
if (SamplingLibrary.networkAvailable(a.getApplicationContext()) == true) {
SimpleHogBug item = new SimpleHogBug(a.getString(R.string.disablenetwork), Constants.Type.OS);
// TODO Get expected benefit
result.add(item);
}
}
use of edu.berkeley.cs.amplab.carat.android.storage.SimpleHogBug in project carat by amplab.
the class SettingsSuggestionAdapter method acceptDimScreen.
private void acceptDimScreen(ArrayList<SimpleHogBug> result) {
// set the screen threshold to be 50
if (!SamplingLibrary.isAutoBrightness(a.getApplicationContext()) && SamplingLibrary.getScreenBrightness(a.getApplicationContext()) > 50) {
SimpleHogBug item = new SimpleHogBug(a.getString(R.string.dimscreen), Constants.Type.OS);
result.add(item);
}
}
Aggregations