package com.epson.cameracopy.ui;

import android.app.Application;
import android.arch.lifecycle.AndroidViewModel;
import android.arch.lifecycle.LiveData;
import android.os.AsyncTask;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;


/* renamed from: com.epson.cameracopy.ui.ImageFolderFileViewModel */
public class ImageFolderFileViewModel extends AndroidViewModel {
    private final Application mApplication;
    private final ImageFolderFileLiveData mImageFolderFileLiveData = new ImageFolderFileLiveData();

    public ImageFolderFileViewModel(@NonNull Application application) {
        super(application);
        mApplication = application;
    }

    public void setOriginalData(@NonNull ImageFolderFile imageFolderFile) {
        mImageFolderFileLiveData.setImageFolderFile(imageFolderFile);
    }

    public ImageFolderFileLiveData getData() {
        return mImageFolderFileLiveData;
    }

    /* renamed from: com.epson.cameracopy.ui.ImageFolderFileViewModel$ImageFolderFileLiveData */
    public class ImageFolderFileLiveData extends LiveData<ImageFolderFile> {
        public ImageFolderFileLiveData() {
        }

        public void setImageFolderFile(@NonNull final ImageFolderFile imageFolderFile) {
            new AsyncTask<Void, Void, ImageFolderFile>() {
                protected void onPostExecute(ImageFolderFile imageFolderFile) {
                    mImageFolderFileLiveData.setValue(imageFolderFile);
                }

                protected ImageFolderFile doInBackground(Void... voidArr) {
                    ImageFolderFile imageFolderFile = imageFolderFile;
                    if (imageFolderFile == null) {
                        return null;
                    }
                    imageFolderFile.prepareImage(mApplication);
                    return imageFolderFile;
                }
            }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Void[0]);
        }
    }
}
