Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da451a55 authored by vince-bourgmayer's avatar vince-bourgmayer
Browse files

merge local branch

parent 08c5b51c
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -17,6 +17,10 @@ http://www.gnu.org/licenses/gpl.html
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <!-- needed for PersistedJob -->
    <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
    <uses-permission android:name="android.permission.READ_SYNC_SETTINGS"/>
    <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
    <permission android:name="android.permission.FORCE_STOP_PACKAGES"
        android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
        android:protectionLevel="signature"/>

    <application
        android:allowBackup="true"
+7 −5
Original line number Diff line number Diff line
@@ -48,21 +48,23 @@ public class CreateInitialRemoteFolderOperation extends RemoteOperation {
            Log.e(TAG, "Local folder doesn't exist, so create it");
            folder.mkdirs();
        }
        CreateRemoteFolderOperation createFolderOperation = new CreateRemoteFolderOperation(mRemotePath, mCreateFullPath);

        RemoteOperationResult createOperationResult;
         createOperationResult = createFolderOperation.execute(client, true);
        //Perfom request
        CreateRemoteFolderOperation createFolderOperation = new CreateRemoteFolderOperation(mRemotePath, mCreateFullPath);
        RemoteOperationResult createOperationResult  = createFolderOperation.execute(client, true);

        Log.d(TAG, createOperationResult.getLogMessage()+" \n"+createOperationResult.getCode()+
                " \n"+createOperationResult.getHttpCode()+" \n"+createOperationResult.getAuthenticateHeaders().toString());
        if(createOperationResult.isSuccess() || createOperationResult.getCode() == RemoteOperationResult.ResultCode.FOLDER_ALREADY_EXISTS ){
            if(DbHelper.insertSyncedFolder(mSyncedFolder, mContext) >= 0 ) {
                Log.d(TAG, "Insertion in DB succeed");
                return new RemoteOperationResult(RemoteOperationResult.ResultCode.OK);
            }else {
                Log.d(TAG, "insertion of folder in DB failed");
                return new RemoteOperationResult(RemoteOperationResult.ResultCode.FOLDER_ALREADY_EXISTS);
            }
        }
        Log.d(TAG, createOperationResult.getLogMessage()+" \n"+createOperationResult.getCode()+
                " \n"+createOperationResult.getHttpCode()+" \n"+createOperationResult.getAuthenticateHeaders().toString());

        return createOperationResult;
    }
}
+0 −1
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ public class PackageEventReceiver extends BroadcastReceiver {
            DbHelper dbHelper = new DbHelper(context);
            dbHelper.getWritableDatabase().close(); //Force upgrade of db.


            /*if (!pref.getBoolean(AppConstants.INITIALIZATION_HAS_BEEN_DONE, false)) {
                context.startService(new Intent(context, InitializerService.class));
            } else if(CommonUtils.getAccount( pref.getString(AccountManager.KEY_ACCOUNT_NAME,""),
+1 −2
Original line number Diff line number Diff line
@@ -39,9 +39,7 @@ import io.eelo.drive.utils.JobUtils;

import static com.owncloud.android.lib.resources.files.FileUtils.PATH_SEPARATOR;
import static io.eelo.drive.utils.AppConstants.INITIALFOLDERS_NUMBER;
import static io.eelo.drive.utils.AppConstants.MEDIASYNC_PROVIDER_AUTHORITY;
import static io.eelo.drive.utils.AppConstants.MEDIA_SYNCABLE_CATEGORIES;
import static io.eelo.drive.utils.AppConstants.SETTINGSYNC_PROVIDER_AUTHORITY;
import static io.eelo.drive.utils.AppConstants.SETTINGS_SYNCABLE_CATEGORIES;

/**
@@ -211,6 +209,7 @@ public class InitializerService extends Service implements OnRemoteOperationList
     * Start to createSyncedFolder in the cloud
     */
    private void CreateNextRemoteFolder(){
        Log.i(TAG, "createNextRemoteFolder()");
        this.restartFolderCreationCounter = 0;

        if( this.mSyncedFolders == null || this.mSyncedFolders.isEmpty() ){
+12 −2
Original line number Diff line number Diff line
@@ -9,11 +9,15 @@
package io.eelo.drive.services;

import android.accounts.AccountManager;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.Application;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.IBinder;
import android.os.Process;
import android.support.annotation.Nullable;
import android.util.Log;

@@ -72,7 +76,7 @@ public class ResetService extends Service {
                    //4. clear prefs
                    prefs.edit().remove(AccountManager.KEY_ACCOUNT_NAME)
                            .remove(AccountManager.KEY_ACCOUNT_TYPE)
                            .putBoolean(INITIALIZATION_HAS_BEEN_DONE, false)
                            .remove(INITIALIZATION_HAS_BEEN_DONE)
                            .remove(INITIALFOLDERS_NUMBER)
                            .apply();

@@ -85,7 +89,13 @@ public class ResetService extends Service {
                    for(File f : cachedFiles){
                        f.delete();
                    }

                    /*try{
                        ActivityManager activityManager = (ActivityManager) getSystemService(ActivityManager.class);
                        Log.d(TAG, "clearApplicationUserData: "+activityManager.clearApplicationUserData());
                        activityManager.killBackgroundProcesses("io.eelo.drive");
                    }catch (Exception e){
                        Log.e(TAG, e.toString() );
                    }*/
                }
            }
        }