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

Commit 580bda3c authored by vince-bourgmayer's avatar vince-bourgmayer
Browse files

add Notification Channel for quota Excedeed. Remove commented line about crashanalytics

parent e4291e28
Loading
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "io.eelo.drive"
        minSdkVersion 25
        minSdkVersion 26
        targetSdkVersion 26
        versionCode 1
        //versionName "1.0"
@@ -49,22 +49,17 @@ android {
}
repositories {
    maven { url "https://jitpack.io" }
    //maven { url 'https://maven.fabric.io/public' }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test:rules:1.0.2'
    androidTestImplementation 'com.android.support:support-annotations:27.1.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    api 'com.github.nextcloud:android-library:1.1.0'
    /*api('com.crashlytics.sdk.android:crashlytics:2.9.2@aar') {
        transitive = true;
    }*/
    api 'com.android.support:support-annotations:27.1.1'

}
+0 −3
Original line number Diff line number Diff line
@@ -70,8 +70,5 @@ http://www.gnu.org/licenses/gpl.html
                <action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
            </intent-filter>
        </receiver>
        <!--<meta-data
            android:name="io.fabric.ApiKey"
            android:value="63e8fd2ffc15b7b187bd369a9c0535e9fe151e8a" />-->
    </application>
</manifest>
+5 −0
Original line number Diff line number Diff line
@@ -10,6 +10,8 @@ package io.eelo.drive.services;

import android.accounts.Account;
import android.accounts.AccountManager;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
@@ -288,6 +290,9 @@ public class InitializerService extends Service implements OnRemoteOperationList

        //all folder have been created
        JobUtils.scheduleScannerJob(this, 120000);
        NotificationManager nM = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

        nM.createNotificationChannel(new NotificationChannel(AppConstants.notificationChannelID, AppConstants.notificationChannelName, NotificationManager.IMPORTANCE_DEFAULT));

        //JobUtils.stopScheduledJob(appContext, JobUtils.InitializerJobId);
        stopSelf();
+15 −6
Original line number Diff line number Diff line
@@ -10,6 +10,9 @@ package io.eelo.drive.services;

import android.accounts.Account;
import android.accounts.AccountManager;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
@@ -21,6 +24,7 @@ import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.support.annotation.Nullable;
import android.support.v4.app.NotificationCompat;
import android.util.Log;

import com.owncloud.android.lib.common.OwnCloudClient;
@@ -92,6 +96,7 @@ public class OperationManagerService extends Service implements OnRemoteOperatio
    public void onCreate(){
        super.onCreate();
        Log.i(TAG, "onCreate()");

        this.workerAmount = 4; //This variable could be replace later by an option in settings

        this.mOperationsQueue = new ConcurrentLinkedDeque<>();
@@ -226,14 +231,18 @@ public class OperationManagerService extends Service implements OnRemoteOperatio
                    //Case specific to UploadFileOperation
                    Log.d(CURRENTTAG, "Quota_EXCEEDED");

                    CommonUtils.sendNotification(this,
                            33100001,
                            "Your drive lacks of space. Tap to check " + mClient.getBaseUri(), android.R.drawable.stat_sys_warning,
                            PendingIntent.getActivity(getApplicationContext(),
                    NotificationManager nM = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);

                    Notification notif = new Notification.Builder(this, AppConstants.notificationChannelID)
                            .setContentIntent(PendingIntent.getActivity(getApplicationContext(),
                                    0,
                                    new Intent(Intent.ACTION_VIEW, mClient.getBaseUri()),
                                    0)
                            , null);
                                    0))
                            .setContentText("Your drive lacks of space. Tap to check " + mClient.getBaseUri())
                            .setBadgeIconType(android.R.drawable.stat_sys_warning)
                            .build();

                    nM.notify(1,notif );
                    break;
                case FILE_NOT_FOUND:
                    //Case specific to DownloadFileOperation
Loading