diff options
| author | Arne Schwabe <arne@rfc2549.org> | 2013-02-21 16:27:46 +0100 | 
|---|---|---|
| committer | Arne Schwabe <arne@rfc2549.org> | 2013-02-21 16:27:46 +0100 | 
| commit | 409df8373d9a06553d1d297428b272260db8aed4 (patch) | |
| tree | cec6ff836329062683bcfbc558b2b19ab676f424 | |
| parent | 1765c3016dfdd73ad382d3e4600d6b30a20653d5 (diff) | |
fix manifest, remember timestamp format, introduce overly accurate timestamp format (=ISO)
| -rw-r--r-- | AndroidManifest.xml | 18 | ||||
| -rw-r--r-- | src/de/blinkt/openvpn/LogWindow.java | 19 | ||||
| -rw-r--r-- | src/de/blinkt/openvpn/OpenVPNThread.java | 2 | 
3 files changed, 28 insertions, 11 deletions
| diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 244d5f8e..a1acaa3d 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -16,6 +16,7 @@  -->  <manifest xmlns:android="http://schemas.android.com/apk/res/android" +    xmlns:tools="http://schemas.android.com/tools"      package="de.blinkt.openvpn"      android:versionCode="59"      android:versionName="0.5.32" > @@ -50,7 +51,9 @@              android:windowSoftInputMode="stateHidden" />          <activity              android:name=".LogWindow" -            android:label="@string/openvpn_log" /> +            android:allowTaskReparenting="true" +            android:label="@string/openvpn_log" +            android:launchMode="singleTask" />          <activity android:name=".SendDumpActivity" />          <activity android:name=".FileSelect" />          <activity android:name=".MainActivity" > @@ -122,11 +125,11 @@                  <data android:scheme="file" />                  <data android:host="*" />                  <data android:port="*" /> -                <data android:pathPattern=".*..*..*..*..*.AAA" /> -                <data android:pathPattern=".*..*..*..*.AAA" /> -                <data android:pathPattern=".*..*..*.AAA" /> -                <data android:pathPattern=".*..*.AAA" /> -                <data android:pathPattern=".*.AAA" /> +                <data android:pathPattern=".*..*..*..*..*.ovpn" /> +                <data android:pathPattern=".*..*..*..*.ovpn" /> +                <data android:pathPattern=".*..*..*.ovpn" /> +                <data android:pathPattern=".*..*.ovpn" /> +                <data android:pathPattern=".*.ovpn" />              </intent-filter>          </activity>          <activity @@ -154,7 +157,8 @@              android:name=".FileProvider"              android:authorities="de.blinkt.openvpn.FileProvider"              android:exported="true" -            android:grantUriPermissions="true" /> +            android:grantUriPermissions="true" +            tools:ignore="ExportedContentProvider" />      </application>  </manifest>
\ No newline at end of file diff --git a/src/de/blinkt/openvpn/LogWindow.java b/src/de/blinkt/openvpn/LogWindow.java index 4e153357..c7bbe6ac 100644 --- a/src/de/blinkt/openvpn/LogWindow.java +++ b/src/de/blinkt/openvpn/LogWindow.java @@ -1,6 +1,8 @@  package de.blinkt.openvpn; +import java.text.SimpleDateFormat;  import java.util.Date; +import java.util.Locale;  import java.util.Vector;  import android.app.AlertDialog; @@ -38,6 +40,7 @@ import de.blinkt.openvpn.OpenVPN.StateListener;  import de.blinkt.openvpn.OpenVpnService.LocalBinder;  public class LogWindow extends ListActivity implements StateListener  { +	private static final String LOGTIMEFORMAT = "logtimeformat";  	private static final int START_VPN_CONFIG = 0;  	private String[] mBconfig=null;  	protected OpenVpnService mService; @@ -156,9 +159,14 @@ public class LogWindow extends ListActivity implements StateListener  {  			LogItem le = myEntries.get(position);  			String msg = le.getString(LogWindow.this); -			if (mTimeFormat%2 == 1) { +			if (mTimeFormat != 0) {  				Date d = new Date(le.getLogtime()); -				String time = DateFormat.getTimeFormat(LogWindow.this).format(d); +				java.text.DateFormat timeformat; +				if (mTimeFormat==2)  +					timeformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss",Locale.getDefault()); +				else +					timeformat = DateFormat.getTimeFormat(LogWindow.this); +				String time = timeformat.format(d);  				msg =  time + " " + msg;  			}  			v.setText(msg); @@ -237,9 +245,10 @@ public class LogWindow extends ListActivity implements StateListener  {  		public void nextTimeFormat() { -			mTimeFormat+=1; +			mTimeFormat= (mTimeFormat+ 1) % 3;  			mHandler.sendEmptyMessage(MESSAGE_NEWTS);  		} +		  	} @@ -355,6 +364,8 @@ public class LogWindow extends ListActivity implements StateListener  {  	protected void onStop() {  		super.onStop();  		OpenVPN.removeStateListener(this); +		getPreferences(0).edit().putInt(LOGTIMEFORMAT, ladapter.mTimeFormat).apply(); +  	}  	@Override @@ -379,6 +390,7 @@ public class LogWindow extends ListActivity implements StateListener  {  		});  		ladapter = new LogWindowListAdapter(); +		ladapter.mTimeFormat = getPreferences(0).getInt(LOGTIMEFORMAT, 0);  		lv.setAdapter(ladapter);  		mSpeedView = (TextView) findViewById(R.id.speed); @@ -408,6 +420,7 @@ public class LogWindow extends ListActivity implements StateListener  {  	} +  	@Override  	protected void onDestroy() {  		unbindService(mConnection); diff --git a/src/de/blinkt/openvpn/OpenVPNThread.java b/src/de/blinkt/openvpn/OpenVPNThread.java index 2bdffe95..cbaab234 100644 --- a/src/de/blinkt/openvpn/OpenVPNThread.java +++ b/src/de/blinkt/openvpn/OpenVPNThread.java @@ -64,7 +64,7 @@ public class OpenVPNThread implements Runnable {  					SimpleDateFormat timeformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss",Locale.GERMAN);
  					for(LogItem li :OpenVPN.getlogbuffer()){
  						String time = timeformat.format(new Date(li.getLogtime()));
 -						logout.write(time +" " + li.getString(null) + "\n");
 +						logout.write(time +" " + li.getString(mService) + "\n");
  					}
  					logout.close();
  					OpenVPN.logError(R.string.minidump_generated);
 | 
