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

Commit 4aa8f013 authored by vince-bourgmayer's avatar vince-bourgmayer
Browse files

fix unstoppable media's sync

parents 0693d6a5 59698f08
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -9,8 +9,10 @@

package io.eelo.drive.services;


import android.accounts.Account;
import android.accounts.AccountManager;

import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
@@ -91,6 +93,7 @@ public class OperationManagerService extends Service implements OnRemoteOperatio
        String accountName = prefs.getString(AccountManager.KEY_ACCOUNT_NAME, "");
        String accountType = prefs.getString(AccountManager.KEY_ACCOUNT_TYPE, "");
        this.mAccount = CommonUtils.getAccount(accountName, accountType, AccountManager.get(this));

        CommonUtils.getOwnCloudClient(CommonUtils.getRegisteredAccount(this), getApplicationContext(), this);

    }
+0 −25
Original line number Diff line number Diff line
@@ -80,31 +80,6 @@ public abstract class CommonUtils {
        notifyMgr.notify(id, builder.build());
    }

    /**
     * Send a notification where text is written over many lines
     * @param context context of the app
     * @param id ID of the notifiation
     * @param msg array of string to print in the notif
     * @param icon icp, to use
     *             @TODO: to remove cause useless
     */
    public static void sendMultiLineNotification(Context context, int id, String[] msg, int icon, PendingIntent pIntent){
        NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
                        .setSmallIcon(icon)
                        .setContentTitle("/e/ Drive");
        NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
        for(int i =-1, size = msg.length; ++i < size;){
            inboxStyle.addLine(msg[i]);
        }
        builder.setStyle(inboxStyle);
        if(pIntent != null) builder.setContentIntent(pIntent);


        NotificationManager notifyMgr =
                (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);

        notifyMgr.notify(id, builder.build());
    }
    /**
     * Try to obtain the registered account from AccountManager
     * @param context App context