Merge branch 'audiorecorder-3.0.2'
This commit is contained in:
commit
baa51cf03e
3 changed files with 12 additions and 10 deletions
|
|
@ -8,8 +8,8 @@ android {
|
|||
applicationId "com.github.axet.audiorecorder"
|
||||
minSdkVersion 9
|
||||
targetSdkVersion 23
|
||||
versionCode 166
|
||||
versionName "3.0.1"
|
||||
versionCode 167
|
||||
versionName "3.0.2"
|
||||
}
|
||||
signingConfigs {
|
||||
release {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ import android.util.Log;
|
|||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.webkit.MimeTypeMap;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
|
@ -888,11 +889,17 @@ public class RecordingActivity extends AppCompatActivity {
|
|||
public void run() { // success
|
||||
d.cancel();
|
||||
|
||||
if (s.startsWith(ContentResolver.SCHEME_CONTENT)) {
|
||||
if (Build.VERSION.SDK_INT >= 21 && s.startsWith(ContentResolver.SCHEME_CONTENT)) {
|
||||
ContentResolver resolver = getContentResolver();
|
||||
try {
|
||||
String d = storage.getDocumentName(targetUri);
|
||||
String ee = storage.getExt(targetUri);
|
||||
Uri docUri = DocumentsContract.buildDocumentUriUsingTree(targetUri, DocumentsContract.getTreeDocumentId(targetUri));
|
||||
String mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(ee);
|
||||
Uri childrenUri = DocumentsContract.createDocument(resolver, docUri, mime, d);
|
||||
|
||||
InputStream is = new FileInputStream(out);
|
||||
OutputStream os = resolver.openOutputStream(targetUri);
|
||||
OutputStream os = resolver.openOutputStream(childrenUri);
|
||||
IOUtils.copy(is, os);
|
||||
is.close();
|
||||
os.close();
|
||||
|
|
|
|||
|
|
@ -36,12 +36,7 @@ public class Storage extends com.github.axet.audiolibrary.app.Storage {
|
|||
|
||||
if (Build.VERSION.SDK_INT >= 21 && s.startsWith(ContentResolver.SCHEME_CONTENT)) {
|
||||
Uri n = getNextFile(path, format, ext);
|
||||
String d = getDocumentName(n);
|
||||
String ee = getExt(n);
|
||||
Uri docUri = DocumentsContract.buildDocumentUriUsingTree(path, DocumentsContract.getTreeDocumentId(path));
|
||||
String mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(ee);
|
||||
Uri childrenUri = DocumentsContract.createDocument(context.getContentResolver(), docUri, mime, d);
|
||||
return childrenUri;
|
||||
return n;
|
||||
} else if (s.startsWith(ContentResolver.SCHEME_FILE)) {
|
||||
File f = new File(path.getPath());
|
||||
if (!f.exists() && !f.mkdirs()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue