|
|
@ -10,6 +10,7 @@ import com.google.common.base.Joiner;
|
|
|
|
import org.tasks.BuildConfig;
|
|
|
|
import org.tasks.BuildConfig;
|
|
|
|
import org.tasks.R;
|
|
|
|
import org.tasks.R;
|
|
|
|
import org.tasks.injection.ForApplication;
|
|
|
|
import org.tasks.injection.ForApplication;
|
|
|
|
|
|
|
|
import org.tasks.locale.Locale;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.inject.Inject;
|
|
|
|
import javax.inject.Inject;
|
|
|
|
|
|
|
|
|
|
|
@ -20,10 +21,12 @@ import static java.util.Arrays.asList;
|
|
|
|
public class Device {
|
|
|
|
public class Device {
|
|
|
|
|
|
|
|
|
|
|
|
private final Context context;
|
|
|
|
private final Context context;
|
|
|
|
|
|
|
|
private final Locale locale;
|
|
|
|
|
|
|
|
|
|
|
|
@Inject
|
|
|
|
@Inject
|
|
|
|
public Device(@ForApplication Context context) {
|
|
|
|
public Device(@ForApplication Context context, Locale locale) {
|
|
|
|
this.context = context;
|
|
|
|
this.context = context;
|
|
|
|
|
|
|
|
this.locale = locale;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isBaneOfMyExistence() {
|
|
|
|
public boolean isBaneOfMyExistence() {
|
|
|
@ -46,11 +49,14 @@ public class Device {
|
|
|
|
|
|
|
|
|
|
|
|
public String getDebugInfo() {
|
|
|
|
public String getDebugInfo() {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
java.util.Locale appLocale = locale.getLocale();
|
|
|
|
|
|
|
|
java.util.Locale deviceLocale = locale.getDeviceLocale();
|
|
|
|
return Joiner.on("\n").join(asList(
|
|
|
|
return Joiner.on("\n").join(asList(
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"----------",
|
|
|
|
"----------",
|
|
|
|
"Tasks: " + BuildConfig.VERSION_NAME + " (" + BuildConfig.FLAVOR + " build " + BuildConfig.VERSION_CODE + ")",
|
|
|
|
"Tasks: " + BuildConfig.VERSION_NAME + " (" + BuildConfig.FLAVOR + " build " + BuildConfig.VERSION_CODE + ")",
|
|
|
|
"Android: " + Build.VERSION.RELEASE + " (" + Build.DISPLAY + ")",
|
|
|
|
"Android: " + Build.VERSION.RELEASE + " (" + Build.DISPLAY + ")",
|
|
|
|
|
|
|
|
"Locale: " + deviceLocale + (!deviceLocale.equals(appLocale) ? " (" + appLocale + ")" : ""),
|
|
|
|
"Model: " + Build.MANUFACTURER + " " + Build.MODEL,
|
|
|
|
"Model: " + Build.MANUFACTURER + " " + Build.MODEL,
|
|
|
|
"Product: " + Build.PRODUCT + " (" + Build.DEVICE + ")",
|
|
|
|
"Product: " + Build.PRODUCT + " (" + Build.DEVICE + ")",
|
|
|
|
"Kernel: " + System.getProperty("os.version") + " (" + Build.VERSION.INCREMENTAL + ")",
|
|
|
|
"Kernel: " + System.getProperty("os.version") + " (" + Build.VERSION.INCREMENTAL + ")",
|
|
|
|