Skip to content

Commit

Permalink
Market v42, build serial check
Browse files Browse the repository at this point in the history
  • Loading branch information
mendhak committed Mar 28, 2014
1 parent 49ad6e3 commit 30b3f19
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 7 deletions.
4 changes: 2 additions & 2 deletions GPSLogger/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mendhak.gpslogger" android:versionCode="41"
android:versionName="41" android:installLocation="auto">
package="com.mendhak.gpslogger" android:versionCode="42"
android:versionName="42" android:installLocation="auto">

<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="16"/>

Expand Down
11 changes: 10 additions & 1 deletion GPSLogger/src/com/mendhak/gpslogger/GpsSettingsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,16 @@ protected void onCreate(Bundle savedInstanceState)
.onPreferenceChange(newFilePref, newFilePref.getValue());

CheckBoxPreference chkfile_prefix_serial = (CheckBoxPreference) findPreference("new_file_prefix_serial");
chkfile_prefix_serial.setSummary(chkfile_prefix_serial.getSummary().toString() + "(" + Build.SERIAL + ")");
if(Utilities.IsNullOrEmpty(Utilities.GetBuildSerial()))
{
chkfile_prefix_serial.setEnabled(false);
chkfile_prefix_serial.setSummary("This option not available on older phones or if a serial id is not present");
}
else
{
chkfile_prefix_serial.setSummary(chkfile_prefix_serial.getSummary().toString() + "(" + Utilities.GetBuildSerial() + ")");
}


}

Expand Down
6 changes: 3 additions & 3 deletions GPSLogger/src/com/mendhak/gpslogger/common/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ public static String getCurrentFileName()
{
if(AppSettings.getNewFileCreation().equals("static") && !Utilities.IsNullOrEmpty(currentFileName))
{
return currentFileName.replaceAll("(?i)%ser", String.valueOf(android.os.Build.SERIAL));
return currentFileName.replaceAll("(?i)%ser", String.valueOf(Utilities.GetBuildSerial()));
}
else
{
if(!Utilities.IsNullOrEmpty(currentFileName) && AppSettings.shouldPrefixSerialToFileName() && !currentFileName.contains(Build.SERIAL))
if(!Utilities.IsNullOrEmpty(currentFileName) && AppSettings.shouldPrefixSerialToFileName() && !currentFileName.contains(Utilities.GetBuildSerial()))
{
currentFileName = String.valueOf(Build.SERIAL) + "_" + currentFileName;
currentFileName = String.valueOf(Utilities.GetBuildSerial()) + "_" + currentFileName;
}
}

Expand Down
13 changes: 13 additions & 0 deletions GPSLogger/src/com/mendhak/gpslogger/common/Utilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import android.app.ProgressDialog;
import android.content.*;
import android.os.BatteryManager;
import android.os.Build;
import android.os.Environment;
import android.preference.PreferenceManager;
import android.provider.Settings;
Expand Down Expand Up @@ -864,4 +865,16 @@ public static String HtmlDecode(String text) {

return text.replace("&amp;", "&").replace("&quot;", "\"");
}

public static String GetBuildSerial()
{
try{
return Build.SERIAL;
}
catch(Throwable t){
return "";
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void run() {
logUrl = logUrl.replaceAll("(?i)%time", String.valueOf(Utilities.GetIsoDateTime(new Date(loc.getTime()))));
logUrl = logUrl.replaceAll("(?i)%batt", String.valueOf(batteryLevel));
logUrl = logUrl.replaceAll("(?i)%aid", String.valueOf(androidId));
logUrl = logUrl.replaceAll("(?i)%ser", String.valueOf(android.os.Build.SERIAL));
logUrl = logUrl.replaceAll("(?i)%ser", String.valueOf(Utilities.GetBuildSerial()));



Expand Down

0 comments on commit 30b3f19

Please sign in to comment.