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

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

notification's removal continuation

parent aebf3824
Loading
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -67,7 +67,6 @@ public class ObserverService extends Service implements OnRemoteOperationListene
    private boolean mBoundToOperationManager = false;
    private boolean isWorking = false;
    private OperationManagerService mOperationManagerService;
    private final int notificationID = 3310;
    private int initialFolderCounter;
    private Account mAccount;
    /**
@@ -111,8 +110,6 @@ public class ObserverService extends Service implements OnRemoteOperationListene
        this.mClient = null;
        this.mHandler = null;
        this.mSyncedFolders = null;
        NotificationManager nM = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
        nM.cancel(notificationID);
    }

    @Override
@@ -439,9 +436,7 @@ public class ObserverService extends Service implements OnRemoteOperationListene
                if(! fileExists ) {
                    Log.d(CURRENTTAG, file.getName()+" doesn't exists *2");
                    //It means that file has been correctly deleted from device. So update DB.
                    if (DbHelper.manageSyncedFileStateDB(syncedFileState, "DELETE", this) > 0)
                        CommonUtils.sendNotification(this,notificationID, syncedFileState.getName() + " has been removed", android.R.drawable.ic_delete, null, null);
                    else
                    if (DbHelper.manageSyncedFileStateDB(syncedFileState, "DELETE", this) <= 0)
                        Log.e(CURRENTTAG, "SyncedFileState row hasn't been deleted from DB");
                }else
                    Log.e(CURRENTTAG, "file still exist and can't be remove");
+0 −1
Original line number Diff line number Diff line
@@ -260,7 +260,6 @@ public class OperationManagerService extends Service implements OnRemoteOperatio
            DownloadFileOperation downloadOperation = (DownloadFileOperation) operation;
            switch (result.getCode()){
                case OK:
                    CommonUtils.sendNotification(this,notificationID, "Download of " +  downloadOperation.getmSyncedState().getRemotePath()  + " succeed", android.R.drawable.stat_sys_download_done, null, null);
                    Log.d(CURRENTTAG, " Download: OK: download succeed" );
                    break;
                case ETAG_UNCHANGED:
+6 −10
Original line number Diff line number Diff line
/*
 * Copyright © Vincent Bourgmayer (/e/ foundation).
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
@@ -43,6 +44,11 @@ public abstract class CommonUtils {
    final private static String TAG = CommonUtils.class.getSimpleName();


    /**
     * Unregister from screeOffReceiver component
     * @param context app context
     * @return true if unregistration was successful or false if it encounter an exception
     */
    public static boolean unregisterScreenOff(Context context){
        try {
            Log.d("TAG", "unregisterReceiver(screenOffReceiver)");
@@ -248,16 +254,6 @@ public abstract class CommonUtils {
        return result;
    }

    /**
     * Check if a string is not null and not empty
     *
     * @param string string to analyze
     * @return true if string not null and not empty
     */
    public static boolean isValidString(String string) {
        return (string != null && !string.isEmpty());
    }

    /**
     * Used for debug
     * @dev-only