forked from upstream-mirrors/OpenTracks
Moved debug warnings into Startup.
This commit is contained in:
@@ -70,7 +70,7 @@ limitations under the License.
|
|||||||
android:smallScreens="true"
|
android:smallScreens="true"
|
||||||
android:xlargeScreens="true" />
|
android:xlargeScreens="true" />
|
||||||
<application
|
<application
|
||||||
android:name=".InitPreferences"
|
android:name=".Startup"
|
||||||
android:allowBackup="false"
|
android:allowBackup="false"
|
||||||
android:hardwareAccelerated="true"
|
android:hardwareAccelerated="true"
|
||||||
android:icon="@drawable/ic_logo"
|
android:icon="@drawable/ic_logo"
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
package de.dennisguse.opentracks;
|
|
||||||
|
|
||||||
import android.app.Application;
|
|
||||||
|
|
||||||
import de.dennisguse.opentracks.util.PreferencesUtils;
|
|
||||||
|
|
||||||
public class InitPreferences extends Application {
|
|
||||||
@Override
|
|
||||||
public void onCreate() {
|
|
||||||
super.onCreate();
|
|
||||||
|
|
||||||
//Set default values of preferences on first start.
|
|
||||||
PreferencesUtils.resetPreferences(this, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package de.dennisguse.opentracks;
|
||||||
|
|
||||||
|
import android.app.Application;
|
||||||
|
import android.os.StrictMode;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import de.dennisguse.opentracks.util.PreferencesUtils;
|
||||||
|
|
||||||
|
public class Startup extends Application {
|
||||||
|
|
||||||
|
private final static String TAG = Startup.class.getSimpleName();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
|
||||||
|
//Include version information into stack traces.
|
||||||
|
Log.i(TAG, BuildConfig.APPLICATION_ID + "; BuildType: " + BuildConfig.BUILD_TYPE + "; VersionName: " + BuildConfig.VERSION_NAME + " VersionCode: " + BuildConfig.VERSION_CODE);
|
||||||
|
|
||||||
|
//Set default values of preferences on first start.
|
||||||
|
PreferencesUtils.resetPreferences(this, false);
|
||||||
|
|
||||||
|
|
||||||
|
//In debug builds: show thread and VM warnings.
|
||||||
|
if (BuildConfig.DEBUG) {
|
||||||
|
Log.d(TAG, "Enabling strict mode");
|
||||||
|
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
|
||||||
|
.detectAll()
|
||||||
|
.penaltyLog()
|
||||||
|
.build());
|
||||||
|
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
|
||||||
|
.detectAll()
|
||||||
|
.penaltyLog()
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -248,18 +248,6 @@ public class TrackListActivity extends AbstractListActivity implements ConfirmDe
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
// if (BuildConfig.DEBUG) {
|
|
||||||
// Log.d(TAG, "Enabling strict mode");
|
|
||||||
// StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
|
|
||||||
// .detectAll()
|
|
||||||
// .penaltyLog()
|
|
||||||
// .build());
|
|
||||||
// StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
|
|
||||||
// .detectAll()
|
|
||||||
// .penaltyLog()
|
|
||||||
// .build());
|
|
||||||
// }
|
|
||||||
|
|
||||||
contentProviderUtils = ContentProviderUtils.Factory.get(this);
|
contentProviderUtils = ContentProviderUtils.Factory.get(this);
|
||||||
sharedPreferences = PreferencesUtils.getSharedPreferences(this);
|
sharedPreferences = PreferencesUtils.getSharedPreferences(this);
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class ShareContentProvider extends CustomContentProvider implements ICont
|
|||||||
|
|
||||||
private static final String[] COLUMNS = {OpenableColumns.DISPLAY_NAME, OpenableColumns.SIZE};
|
private static final String[] COLUMNS = {OpenableColumns.DISPLAY_NAME, OpenableColumns.SIZE};
|
||||||
|
|
||||||
public static final String TAG = ShareContentProvider.class.getCanonicalName();
|
public static final String TAG = ShareContentProvider.class.getSimpleName();
|
||||||
|
|
||||||
private static final int URI_GPX = 0;
|
private static final int URI_GPX = 0;
|
||||||
private static final int URI_KML_ONLY = 1;
|
private static final int URI_KML_ONLY = 1;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ import de.dennisguse.opentracks.io.file.TrackFileFormat;
|
|||||||
*/
|
*/
|
||||||
public class IntentUtils {
|
public class IntentUtils {
|
||||||
|
|
||||||
private final static String TAG = IntentUtils.class.getCanonicalName();
|
private final static String TAG = IntentUtils.class.getSimpleName();
|
||||||
|
|
||||||
private IntentUtils() {
|
private IntentUtils() {
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user