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

Commit c88ca7d1 authored by Aayush Gupta's avatar Aayush Gupta
Browse files

Merge branch '176-o-update-quota-notif' into 'v1-oreo'

Change Notification about Quota alloted filled or nearly filled

See merge request !108
parents 88847063 a386d750
Loading
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -155,11 +155,11 @@ public class SynchronizationService extends Service implements OnRemoteOperation
            if (callerOperation instanceof UploadFileOperation) {
                final Float relativeQuota = (Float) result.getData().get(1);
                if (relativeQuota >= 99.0) {
                    addNotification(getString(R.string.notif_quota_nearlyReached_title), getString(R.string.notif_quota_99Plus_text));
                    addNotification(getString(R.string.notif_quota_99Plus_title), getString(R.string.notif_quota_99Plus_text));
                } else if (relativeQuota >= 90.0) {
                    addNotification(getString(R.string.notif_quota_nearlyReached_title), getString(R.string.notif_quota_90Plus_text));
                    addNotification(getString(R.string.notif_quota_80plus_title), getString(R.string.notif_quota_90Plus_text));
                } else if (relativeQuota >= 80.0) {
                    addNotification(getString(R.string.notif_quota_nearlyReached_title), getString(R.string.notif_quota_80Plus_text));
                    addNotification(getString(R.string.notif_quota_80plus_title), getString(R.string.notif_quota_80Plus_text));
                }
            }
            switch (result.getCode()) {
@@ -200,7 +200,7 @@ public class SynchronizationService extends Service implements OnRemoteOperation
                case QUOTA_EXCEEDED:
                    //Case specific to UploadFileOperation
                    Log.w(TAG, "Quota_EXCEEDED");
                    addNotification(getString(R.string.notif_quota_execeeded_title), getString(R.string.notif_quota_execeeded_text));
                    addNotification(getString(R.string.notif_quota_99Plus_title), getString(R.string.notif_quota_execeeded_text));
                    break;
                case FILE_NOT_FOUND:
                    //Case specific to DownloadFileOperation
@@ -246,7 +246,8 @@ public class SynchronizationService extends Service implements OnRemoteOperation
                new NotificationCompat.Builder(this, AppConstants.notificationChannelID)
                        .setSmallIcon(android.R.drawable.stat_sys_warning)
                        .setContentTitle(title)
                        .setContentText(text+ client.getBaseUri());
                        .setContentText(text)
                        .setStyle(new NotificationCompat.BigTextStyle().bigText(text));
        // Add as notification
        final NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
        manager.notify(0, builder.build());
+6 −6
Original line number Diff line number Diff line
@@ -23,10 +23,10 @@

    <string name="notif_channel_name" translatable="false">eDrive\'s notification</string>
    <string name="notif_channel_description">eDrive\'s notification channel</string>
    <string name="notif_quota_execeeded_title">/e/ account\'s quota reached</string>
    <string name="notif_quota_nearlyReached_title">/e/ account\'s quota nearly reached</string>
    <string name="notif_quota_execeeded_text">eDrive can\'t upload a file that is bigger than remaining quota at: </string>
    <string name="notif_quota_99Plus_text">You filled 99% of your /e/\'s account quota. check: </string>
    <string name="notif_quota_90Plus_text">You filled 90% of your /e/\'s account quota. check: </string>
    <string name="notif_quota_80Plus_text">You filled 80% of your /e/\'s account quota. check: </string>
    <string name="notif_quota_99Plus_title">Your cloud storage is full.</string>
    <string name="notif_quota_80plus_title">Your cloud storage is nearly full.</string>
    <string name="notif_quota_execeeded_text">Impossible to upload a file which is bigger than your free alloted cloud storage. Please take action.</string>
    <string name="notif_quota_99Plus_text">99% of your allotted cloud storage is used. Please take action.</string>
    <string name="notif_quota_90Plus_text">You\'ve filled your allotted cloud storage up to 90%.</string>
    <string name="notif_quota_80Plus_text">You\'ve filled your allotted cloud storage up to 80%.</string>
</resources>