aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2015-10-05 13:39:58 +0200
committerSamuel Tardieu <sam@rfc1149.net>2015-10-05 13:43:58 +0200
commit2c57e1022ddfa3d6369488661a26eaaf87206cde (patch)
treeb2be6b05c1e810e378321edd53af20ca38355a0a
parentd581ff572cb28bfe79400e35105506ad977d5173 (diff)
downloadcgeo-2c57e1022ddfa3d6369488661a26eaaf87206cde.zip
cgeo-2c57e1022ddfa3d6369488661a26eaaf87206cde.tar.gz
cgeo-2c57e1022ddfa3d6369488661a26eaaf87206cde.tar.bz2
close #5220: include status of direction sensor in system info
Some cleanups have been performed as well.
-rw-r--r--main/src/cgeo/geocaching/utils/SystemInformation.java21
1 files changed, 11 insertions, 10 deletions
diff --git a/main/src/cgeo/geocaching/utils/SystemInformation.java b/main/src/cgeo/geocaching/utils/SystemInformation.java
index 29d96e1..d7fe357 100644
--- a/main/src/cgeo/geocaching/utils/SystemInformation.java
+++ b/main/src/cgeo/geocaching/utils/SystemInformation.java
@@ -25,23 +25,28 @@ import java.util.Locale;
public final class SystemInformation {
+ private SystemInformation() {
+ // Do not instantiate
+ }
+
@NonNull
public static String getSystemInformation(@NonNull final Context context) {
final boolean googlePlayServicesAvailable = CgeoApplication.getInstance().isGooglePlayServicesAvailable();
final StringBuilder body = new StringBuilder("--- System information ---")
- .append("\nDevice: ").append(Build.MODEL).append(" (").append(Build.PRODUCT).append(", ").append(Build.BRAND).append(")")
+ .append("\nDevice: ").append(Build.MODEL).append(" (").append(Build.PRODUCT).append(", ").append(Build.BRAND).append(')')
.append("\nAndroid version: ").append(VERSION.RELEASE)
.append("\nAndroid build: ").append(Build.DISPLAY)
.append("\nCgeo version: ").append(Version.getVersionName(context))
.append("\nGoogle Play services: ").append(googlePlayServicesAvailable ? (Settings.useGooglePlayServices() ? "enabled" : "disabled") : "unavailable")
.append("\nLow power mode: ").append(Settings.useLowPowerMode() ? "active" : "inactive")
.append("\nCompass capabilities: ").append(Sensors.getInstance().hasCompassCapabilities() ? "yes" : "no")
- .append("\nRotation sensor: ").append(presence(RotationProvider.hasRotationSensor(context)))
+ .append("\nRotation vector sensor: ").append(presence(RotationProvider.hasRotationSensor(context)))
.append("\nOrientation sensor: ").append(presence(OrientationProvider.hasOrientationSensor(context)))
+ .append("\nDirection sensor used: ").append(Settings.useOrientationSensor(context) ? "orientation" : "rotation vector")
.append("\nHide own/found: ").append(Settings.isExcludeMyCaches())
.append("\nMap strategy: ").append(Settings.getLiveMapStrategy().toString().toLowerCase(Locale.getDefault()))
.append("\nHW acceleration: ").append(Settings.useHardwareAcceleration() ? "enabled" : "disabled")
- .append(" (").append(Settings.useHardwareAcceleration() != Settings.HW_ACCEL_DISABLED_BY_DEFAULT ? "default state" : "manually changed").append(")")
+ .append(" (").append(Settings.useHardwareAcceleration() == Settings.HW_ACCEL_DISABLED_BY_DEFAULT ? "manually changed" : "default state").append(')')
.append("\nSystem language: ").append(Locale.getDefault());
if (Settings.useEnglish()) {
body.append(" (cgeo forced to English)");
@@ -53,7 +58,7 @@ public final class SystemInformation {
}
private static void appendConnectors(@NonNull final StringBuilder body) {
- final StringBuilder connectors = new StringBuilder();
+ final StringBuilder connectors = new StringBuilder(128);
int connectorCount = 0;
for (final IConnector connector : ConnectorFactory.getConnectors()) {
if (connector.isActive()) {
@@ -73,7 +78,7 @@ public final class SystemInformation {
}
private static void appendAddons(@NonNull final StringBuilder body) {
- final List<String> addons = new ArrayList<>();
+ final List<String> addons = new ArrayList<>(2);
if (CalendarAddon.isAvailable()) {
addons.add("calendar");
}
@@ -81,11 +86,7 @@ public final class SystemInformation {
addons.add("contacts");
}
body.append("\nInstalled cgeo plugins: ");
- if (CollectionUtils.isNotEmpty(addons)) {
- body.append(StringUtils.join(addons, ", "));
- } else {
- body.append(" none");
- }
+ body.append(CollectionUtils.isNotEmpty(addons) ? StringUtils.join(addons, ", ") : " none");
}
public static String presence(final boolean present) {