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

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

remove not useful notification

parent 029ba4ca
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@ public class UploadFileOperation extends RemoteOperation {
    private SyncedFileState mSyncedState;
    private int restartCounter =0;
    private long previousLastModified;
    private int notificationID;
    private boolean checkEtag;

    /**
@@ -56,7 +55,6 @@ public class UploadFileOperation extends RemoteOperation {
        this.mFile = file;
        this.mContext = context;
        this.mTargetPath = targetPath;
        this.notificationID =  3310 + (int) (System.currentTimeMillis() / 1000);

        //Try to load syncedFileState from DB
        this.mSyncedState = DbHelper.loadSyncedFile( mContext,
@@ -129,9 +127,7 @@ public class UploadFileOperation extends RemoteOperation {
                CommonUtils.getMimeType( mFile ),
                ( !checkEtag || mSyncedState.getLastETAG().isEmpty() )? null : mSyncedState.getLastETAG(), //If not null, This can cause error 412; that means remote file has change
                timeStamp );
        if(restartCounter == 0) {
            CommonUtils.sendNotification(mContext,notificationID,"Start to upload " + mSyncedState.getName(), android.R.drawable.stat_sys_upload, null, null);
        }


        // Execute UploadFileOperation
        RemoteOperationResult uploadResult = uploadRemoteFileOperation.execute( client );
@@ -208,11 +204,7 @@ public class UploadFileOperation extends RemoteOperation {
        }
        // updated syncedFile in DB
        DbHelper.manageSyncedFileStateDB(mSyncedState, "UPDATE", mContext);
        if(mResultCode == RemoteOperationResult.ResultCode.OK) {
            CommonUtils.sendNotification(mContext,notificationID, mSyncedState.getName() + " has been uploaded", android.R.drawable.stat_sys_upload_done, null, null);
        }else{
            ( (NotificationManager)  mContext.getSystemService(Context.NOTIFICATION_SERVICE) ).cancel(notificationID);
        }

        ArrayList<Object> datas = new ArrayList<>();
        datas.add(mSyncedState.getSyncedFolderId());
        final RemoteOperationResult finalResult = new RemoteOperationResult(mResultCode);
+1 −4
Original line number Diff line number Diff line
@@ -57,7 +57,6 @@ public class InitializerService extends Service implements OnRemoteOperationList
    private Account mAccount;
    private boolean isAccountFromPref;
    private int restartFolderCreationCounter =0;
    private int notificationID;

    @Override
    public void onCreate() {
@@ -66,7 +65,7 @@ public class InitializerService extends Service implements OnRemoteOperationList
        this.mHandler = new Handler();
        this.mSyncedFolders = new ArrayList<>();
        this.existingRemoteFolderCounter = 0;
        this.notificationID =  3310 + (int) (System.currentTimeMillis() / 1000);

    }

    @Override
@@ -110,7 +109,6 @@ public class InitializerService extends Service implements OnRemoteOperationList
        this.mCloudClient = (OwnCloudClient) result;
        if (mCloudClient != null) {
            Log.d(TAG, mCloudClient.getBaseUri().toString());
            CommonUtils.sendNotification(this,this.notificationID, "Initialisation in process", android.R.drawable.stat_notify_sync, null, null);
            if (!isAccountFromPref) {
                SharedPreferences settings = getApplicationContext().getSharedPreferences(
                        AppConstants.SHARED_PREFERENCE_NAME,
@@ -246,7 +244,6 @@ public class InitializerService extends Service implements OnRemoteOperationList
                edit.putBoolean(AppConstants.INITIALIZERSERVICE_HAS_RUN, true)
                        .putInt(INITIALFOLDERS_NUMBER, mSyncedFolders.size())
                        .apply();
                CommonUtils.sendNotification(this,this.notificationID, "Initialisation is over", android.R.drawable.stat_notify_sync_noanim, null, null);
                stopSelf();
            }else {
                startFolderCreation();
+0 −1
Original line number Diff line number Diff line
@@ -287,7 +287,6 @@ public class OperationManagerService extends Service implements OnRemoteOperatio
            SyncedFileState sf = removeOperation.getSyncedFileState();
            if( result.isSuccess() ) {
                DbHelper.manageSyncedFileStateDB(sf, "DELETE", this);
                CommonUtils.sendNotification(this,notificationID, sf.getName()+" has been remotly removed", android.R.drawable.ic_delete, null, null );
            }
            this.lockedfilePath.remove( removeOperation.getSyncedFileState().getLocalPath() );
        }