Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,21 +121,26 @@ public void onClick(View v) {
if (v == developer || v == developerTitle) {
// open dev settings
Intent devIntent = new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS);
devIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
ResolveInfo resolveInfo = context.getPackageManager().resolveActivity(devIntent, 0);
if (resolveInfo != null) context.startActivity(devIntent);
else Toast.makeText(context, "Developer settings not available on device",
Toast.LENGTH_SHORT).show();
} else if (v == battery || v == batteryTitle) {
// try to find an app to handle battery settings
Intent batteryIntent = new Intent(Intent.ACTION_POWER_USAGE_SUMMARY);
batteryIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
ResolveInfo resolveInfo = context.getPackageManager().resolveActivity(batteryIntent, 0);
if (resolveInfo != null) context.startActivity(batteryIntent);
else Toast.makeText(context, "No app found to handle power usage intent", Toast.LENGTH_SHORT).show();
} else if (v == settings || v == settingsTitle) {
// open android settings
context.startActivity(new Intent(Settings.ACTION_SETTINGS));
Intent settingsIntent = new Intent(Settings.ACTION_SETTINGS);
settingsIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(settingsIntent);
} else if (v == info || v == infoTitle) {
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setData(Uri.parse("package:" + context.getPackageName()));
context.startActivity(intent);
} else if (v == uninstall || v == uninstallTitle) {
Expand All @@ -144,7 +149,9 @@ public void onClick(View v) {
Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
context.startActivity(uninstallIntent);
} else if (v == location || v == locationTitle) {
context.startActivity(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS));
Intent locationIntent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
locationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(locationIntent);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public class LumberYard {

private static final int BUFFER_SIZE = 200;

private static final DateFormat FILENAME_DATE = new SimpleDateFormat("yyyy-MM-dd hhmm a", Locale.US);
private static final DateFormat LOG_DATE_PATTERN = new SimpleDateFormat("MM-dd hh:mm:ss.S", Locale.US);
private static final DateFormat FILENAME_DATE = new SimpleDateFormat("yyyy-MM-dd HHmm a", Locale.US);
private static final DateFormat LOG_DATE_PATTERN = new SimpleDateFormat("MM-dd HH:mm:ss.S", Locale.US);

private static final String LOG_FILE_END = ".log";

Expand Down