refactor: circular deps part 14

This commit is contained in:
Nathan Walker
2025-07-10 15:47:29 -07:00
parent cebc78406b
commit e7ab426ee2
87 changed files with 2667 additions and 3403 deletions

View File

@@ -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;