mirror of
https://github.com/yuliskov/SmartTube.git
synced 2026-01-09 15:31:03 -06:00
gdrive backup: first step
This commit is contained in:
Submodule MediaServiceCore updated: 77f96011a2...058c32b887
@@ -58,6 +58,7 @@ dependencies {
|
||||
implementation project(':fragment-1.1.0')
|
||||
implementation project(':mediaserviceinterfaces')
|
||||
implementation project(':youtubeapi')
|
||||
implementation project(':googleapi')
|
||||
|
||||
implementation 'io.reactivex.rxjava2:rxandroid:' + rxAndroidVersion
|
||||
implementation 'io.reactivex.rxjava2:rxjava:' + rxJavaVersion
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.liskovsoft.smartyoutubetv2.common.misc;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.liskovsoft.googleapi.service.GDriveService;
|
||||
import com.liskovsoft.googleapi.service.GoogleSignInService;
|
||||
|
||||
public class GDriveBackupManager {
|
||||
private final Context mContext;
|
||||
private final String mBackupFolder;
|
||||
private final GoogleSignInService mSignInService;
|
||||
private final GDriveService mDriveService;
|
||||
|
||||
public GDriveBackupManager(Context context) {
|
||||
mContext = context;
|
||||
mBackupFolder = String.format("SmartTubeBackup/%s", context.getPackageName());
|
||||
mSignInService = GoogleSignInService.instance();
|
||||
mDriveService = GDriveService.instance();
|
||||
}
|
||||
|
||||
public void backup() {
|
||||
if (mSignInService.isSigned()) {
|
||||
startBackup();
|
||||
} else {
|
||||
logIn(this::startBackup);
|
||||
}
|
||||
}
|
||||
|
||||
public void restore() {
|
||||
if (mSignInService.isSigned()) {
|
||||
startRestore();
|
||||
} else {
|
||||
logIn(this::startRestore);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasBackup() {
|
||||
return false;
|
||||
}
|
||||
|
||||
private void startBackup() {
|
||||
|
||||
}
|
||||
|
||||
private void startRestore() {
|
||||
|
||||
}
|
||||
|
||||
private void logIn(Runnable onDone) {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user