Commits

Adam Pritchard committed e51b598

Changed location where feedback file is written, as Gmail was having trouble attaching it on some devices

  • Participants
  • Parent commits 61969c2
  • Branches diagnostic-feedback-windows

Comments (0)

Files changed (1)

Android/PsiphonAndroid/src/com/psiphon3/FeedbackActivity.java

 import android.net.Uri;
 import android.os.Build;
 import android.os.Bundle;
+import android.os.Environment;
 import android.webkit.WebView;
 import android.webkit.WebViewClient;
 import android.widget.Toast;
                     try 
                     {
                         // The attachment must be created on external storage, 
-                        // or else Gmail gives this error:
+                        // and be publicly readable, or else Gmail gives this error:
                         // E/Gmail(18760): file:// attachment paths must point to file:///storage/sdcard0. Ignoring attachment [obscured file path]
-    
-                        attachmentFile = new File(getExternalFilesDir("feedback"), PsiphonConstants.FEEDBACK_ATTACHMENT_FILENAME);
-    
-                        // Note that we're overwriting any existing file
+                        
+                        File extDir = Environment.getExternalStoragePublicDirectory(PsiphonConstants.TAG);
+                        extDir.mkdirs();
+
+                        attachmentFile = new File(
+                                extDir, 
+                                PsiphonConstants.FEEDBACK_ATTACHMENT_FILENAME);
+                        
                         FileWriter writer = new FileWriter(attachmentFile, false);
                         writer.write(encryptedContent.toString());
                         writer.close();