diff options
author | Arne Schwabe <arne@rfc2549.org> | 2013-02-28 17:43:12 +0100 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2013-02-28 17:43:12 +0100 |
commit | c2d2473b1618a9a002344ec6be1e67004fdb1f94 (patch) | |
tree | 26e6080ee9aaa63de6d55ec0983d840ed65e423a /src/de/blinkt/openvpn/SendDumpActivity.java | |
parent | 428ef31f6a1de54cd6e3c20264f5ab411a076aaa (diff) |
New Layout for main screen
Diffstat (limited to 'src/de/blinkt/openvpn/SendDumpActivity.java')
-rw-r--r-- | src/de/blinkt/openvpn/SendDumpActivity.java | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/src/de/blinkt/openvpn/SendDumpActivity.java b/src/de/blinkt/openvpn/SendDumpActivity.java deleted file mode 100644 index 74d1a2f8..00000000 --- a/src/de/blinkt/openvpn/SendDumpActivity.java +++ /dev/null @@ -1,74 +0,0 @@ -package de.blinkt.openvpn; - -import java.io.File; -import java.util.ArrayList; - -import android.app.Activity; -import android.content.Context; -import android.content.Intent; -import android.content.pm.PackageInfo; -import android.content.pm.PackageManager.NameNotFoundException; -import android.net.Uri; - -public class SendDumpActivity extends Activity { - - protected void onStart() { - super.onStart(); - emailMiniDumps(); - finish(); - }; - - public void emailMiniDumps() - { - //need to "send multiple" to get more than one attachment - final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE); - emailIntent.setType("*/*"); - emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, - new String[]{"Arne Schwabe <arne@rfc2549.org>"}); - - String version; - String name="ics-openvpn"; - try { - PackageInfo packageinfo = getPackageManager().getPackageInfo(getPackageName(), 0); - version = packageinfo.versionName; - name = packageinfo.applicationInfo.name; - } catch (NameNotFoundException e) { - version = "error fetching version"; - } - - - emailIntent.putExtra(Intent.EXTRA_SUBJECT, String.format("%s %s Minidump",name,version)); - - emailIntent.putExtra(Intent.EXTRA_TEXT, "Please describe the issue you have experienced"); - - ArrayList<Uri> uris = new ArrayList<Uri>(); - - File ldump = getLastestDump(this); - if(ldump==null) { - OpenVPN.logError("No Minidump found!"); - } - - uris.add(Uri.parse("content://de.blinkt.openvpn.FileProvider/" + ldump.getName())); - uris.add(Uri.parse("content://de.blinkt.openvpn.FileProvider/" + ldump.getName() + ".log")); - - emailIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); - emailIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris); - startActivity(emailIntent); - } - - static public File getLastestDump(Context c) { - long newestDumpTime=0; - File newestDumpFile=null; - - for(File f:c.getCacheDir().listFiles()) { - if(!f.getName().endsWith(".dmp")) - continue; - - if (newestDumpTime < f.lastModified()) { - newestDumpTime = f.lastModified(); - newestDumpFile=f; - } - } - return newestDumpFile; - } -} |