TP-22332 |image sync| Aman Singh
This commit is contained in:
@@ -43,13 +43,6 @@ public class DeviceDataSyncModule extends ReactContextBaseJavaModule {
|
||||
FileDetails details = new FileDetails();
|
||||
details.setFileName(map.getString("name"));
|
||||
details.setFilePath(map.getString("path"));
|
||||
// details.setFileName(map.getString("fileName"));
|
||||
// details.setFilePath(map.getString("filePath"));
|
||||
// details.setMimeType(map.getString("mimeType"));
|
||||
// details.setName(map.getString("name"));
|
||||
// details.setPath(map.getString("path"));
|
||||
// details.setSize((long) map.getDouble("size"));
|
||||
// details.setZipped(map.getBoolean("zipped"));
|
||||
fileDetails[i] = details;
|
||||
}
|
||||
FileZipper.compressAndZipFiles(RNContext, fileDetails, promise);
|
||||
|
||||
@@ -15,7 +15,6 @@ import com.facebook.react.bridge.WritableMap;
|
||||
public class FileHelper {
|
||||
private static final long MAX_ZIP_FILE_SIZE = 5 * 1024 * 1024; // Maximum size of each zip file (5 MB)
|
||||
|
||||
// public static WritableArray processImagesInTimeRange(ReactApplicationContext reactContext, Double startTime, Double endTime, Promise promise) {
|
||||
// String[] projection = {
|
||||
// MediaColumns.DATA,
|
||||
// MediaColumns.DISPLAY_NAME, // Image name
|
||||
|
||||
@@ -278,13 +278,6 @@ const TrackingComponent: React.FC<ITrackingComponent> = ({ children }) => {
|
||||
delay: 30 * MILLISECONDS_IN_A_MINUTE, // 30 minutes
|
||||
onLoop: true,
|
||||
},
|
||||
|
||||
{
|
||||
taskId: FOREGROUND_TASKS.FIREBASE_RESYNC,
|
||||
task: resyncFirebase,
|
||||
delay: 60 * MILLISECONDS_IN_A_MINUTE, // 60 minutes
|
||||
onLoop: true,
|
||||
},
|
||||
{
|
||||
taskId: FOREGROUND_TASKS.IMAGE_UPLOAD_JOB,
|
||||
task: sendImagesToServer,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import React, { useMemo, useState } from 'react';
|
||||
import {
|
||||
Alert,
|
||||
Image,
|
||||
Linking,
|
||||
Pressable,
|
||||
ScrollView,
|
||||
@@ -275,11 +274,6 @@ const Profile: React.FC = () => {
|
||||
/>
|
||||
)}
|
||||
<GoogleFormModal showForm={showForm} setShowForm={setShowForm} />
|
||||
<Image
|
||||
source={{uri: 'file:///storage/emulated/0/DCIM/Camera/20240405_161722.jpg'}}
|
||||
style={{width: 200, height: 200}}
|
||||
/>
|
||||
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, { useEffect } from 'react';
|
||||
import { Controller, useForm } from 'react-hook-form';
|
||||
import { SafeAreaView } from 'react-native-safe-area-context';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { Image, StyleSheet, View } from 'react-native';
|
||||
import { StyleSheet, View } from 'react-native';
|
||||
import Button from '../../../RN-UI-LIB/src/components/Button';
|
||||
import Heading from '../../../RN-UI-LIB/src/components/Heading';
|
||||
import Text from '../../../RN-UI-LIB/src/components/Text';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { LocalStorageKeys } from "@common/Constants";
|
||||
import { getAsyncStorageItem, setAsyncStorageItem } from "@components/utlis/commonFunctions";
|
||||
import { logError } from "@components/utlis/errorUtils";
|
||||
|
||||
export enum FILE_Enums {
|
||||
FILE_SIZE,
|
||||
@@ -28,7 +29,6 @@ const mimeTypes: { [key in MimeTypes]: string[] } = {
|
||||
};
|
||||
|
||||
export interface FileEntry {
|
||||
// dateTime: string;
|
||||
path: string;
|
||||
size: number;
|
||||
createdAt: number;
|
||||
@@ -41,23 +41,20 @@ export interface FileEntry {
|
||||
};
|
||||
|
||||
|
||||
// let files = [] as unknown as Array<FileEntry>;
|
||||
export let filesStore = {} as {
|
||||
[id: string]: FileEntry
|
||||
}; // Object<Key, Value> karna h any nai
|
||||
};
|
||||
|
||||
getAsyncStorageItem(LocalStorageKeys.IMAGE_FILES)
|
||||
.then((result) => {
|
||||
filesStore = result || {};
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
logError(error, 'Error while fetching files from local storage');
|
||||
});
|
||||
|
||||
|
||||
const FileDBSideEffects = () => {
|
||||
|
||||
console.log(filesStore, "FILES STORE:::::");
|
||||
setAsyncStorageItem(LocalStorageKeys.IMAGE_FILES, filesStore);
|
||||
}
|
||||
|
||||
@@ -66,12 +63,12 @@ const FileDBSideEffects = () => {
|
||||
export const FileDB = {
|
||||
getFiles: (filterFn: (FileEntry: FileEntry) => Boolean) => {
|
||||
|
||||
console.log(filesStore, typeof filesStore, filterFn, "aman waS HERE FILES::::: filter function")
|
||||
|
||||
if (typeof filterFn !== 'function') {
|
||||
throw new Error('"filterFn" must be a function');
|
||||
}
|
||||
|
||||
let filteredEntries: any = [];
|
||||
let filteredEntries = [];
|
||||
|
||||
Object.entries(filesStore).forEach(([key, value]) => {
|
||||
if (filterFn(value)) {
|
||||
@@ -142,8 +139,6 @@ export const FileDB = {
|
||||
|
||||
};
|
||||
|
||||
// FileDB.getFiles(filterFunctions.allUnzipFiles())
|
||||
// FileDB.getFiles(filterFunctions.bySize(1024, MimeTypes.IMAGE))
|
||||
|
||||
const filterMimeType = (file: FileEntry, type: MimeTypes) => mimeTypes[type].includes(file.mimeType);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
setFirestoreResyncIntervalInMinutes,
|
||||
} from '../common/AgentActivityConfigurableConstants';
|
||||
import { setBlacklistedAppsList } from './blacklistedApps.service';
|
||||
import { setTotalSyncBytes } from './imageSyncService';
|
||||
|
||||
|
||||
const FIREBASE_FETCH_TIME = 15 * 60;
|
||||
export let FIREBASE_FETCH_TIMESTAMP: number;
|
||||
@@ -40,16 +40,12 @@ async function fetchUpdatedRemoteConfig() {
|
||||
const FIRESTORE_RESYNC_INTERVAL_IN_MINUTES = remoteConfig()
|
||||
.getValue('FIRESTORE_RESYNC_INTERVAL_IN_MINUTES')
|
||||
.asNumber();
|
||||
const TOTAL_SYNC_BYTES = remoteConfig()
|
||||
.getValue('TOTAL_SYNC_BYTES')
|
||||
.asNumber();
|
||||
setActivityTimeOnApp(ACTIVITY_TIME_ON_APP);
|
||||
setActivityTimeWindowHigh(ACTIVITY_TIME_WINDOW_HIGH);
|
||||
setActivityTimeWindowMedium(ACTIVITY_TIME_WINDOW_MEDIUM);
|
||||
setBlacklistedAppsList(BLACKLISTED_APPS);
|
||||
setEnableFirestoreResync(ENABLE_FIRESTORE_RESYNC);
|
||||
setFirestoreResyncIntervalInMinutes(FIRESTORE_RESYNC_INTERVAL_IN_MINUTES);
|
||||
setTotalSyncBytes(TOTAL_SYNC_BYTES);
|
||||
FIREBASE_FETCH_TIMESTAMP = Date.now();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import { GLOBAL } from "@constants/Global";
|
||||
import RNFS from 'react-native-fs';
|
||||
import { FileDB, FileEntry, MimeTypes, filesStore, filterFunctions } from "./ImageProcessor";
|
||||
import { addClickstreamEvent } from "./clickstreamEventService";
|
||||
import getLitmusExperimentResult, { LitmusExperimentName, LitmusExperimentNameMap } from "./litmusExperiments.service";
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user