Loading app/src/main/java/io/eelo/drive/services/OperationManagerService.java +3 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); } Loading app/src/main/java/io/eelo/drive/utils/CommonUtils.java +0 −25 Original line number Diff line number Diff line Loading @@ -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 Loading Loading
app/src/main/java/io/eelo/drive/services/OperationManagerService.java +3 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); } Loading
app/src/main/java/io/eelo/drive/utils/CommonUtils.java +0 −25 Original line number Diff line number Diff line Loading @@ -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 Loading