mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
refactor: circular deps part 14
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { IFileSystemAccess, FileSystemAccess, FileSystemAccess29 } from './file-system-access';
|
||||
import { SDK_VERSION } from '../utils/constants';
|
||||
import { android as androidUtils } from '../utils';
|
||||
import { getNativeApp } from '../application/helpers-common';
|
||||
|
||||
// The FileSystemAccess implementation, used through all the APIs.
|
||||
let fileAccess: IFileSystemAccess;
|
||||
@@ -270,7 +270,7 @@ class Android {
|
||||
throw new Error(`createFile is available on Android only!`);
|
||||
}
|
||||
|
||||
const context = androidUtils.getApplicationContext() as android.content.Context;
|
||||
const context = (getNativeApp() as android.app.Application).getApplicationContext() as android.content.Context;
|
||||
|
||||
const meta = new android.content.ContentValues();
|
||||
meta.put(android.provider.MediaStore.MediaColumns.DISPLAY_NAME, options.name);
|
||||
@@ -323,7 +323,7 @@ export class File extends FileSystemEntity {
|
||||
// falls back to creating a temp file without a known extension.
|
||||
if (!fileInfo) {
|
||||
const tempFile = `${knownFolders.temp().path}/${java.util.UUID.randomUUID().toString()}`;
|
||||
org.nativescript.widgets.Async.File.copySync(path, tempFile, androidUtils.getApplicationContext());
|
||||
org.nativescript.widgets.Async.File.copySync(path, tempFile, (getNativeApp() as android.app.Application).getApplicationContext());
|
||||
path = tempFile;
|
||||
} else {
|
||||
const ext = fileInfo.extension;
|
||||
|
||||
Reference in New Issue
Block a user