Search in sources :

Example 1 with LegacyLoggerAdapter

use of com.nextcloud.client.logger.LegacyLoggerAdapter in project android by nextcloud.

the class MainApp method onCreate.

@SuppressFBWarnings("ST")
@Override
public void onCreate() {
    enableStrictMode();
    setAppTheme(preferences.getDarkThemeMode());
    super.onCreate();
    insertConscrypt();
    initSecurityKeyManager();
    registerActivityLifecycleCallbacks(new ActivityInjector());
    int startedMigrationsCount = migrationsManager.startMigration();
    logger.i(TAG, String.format(Locale.US, "Started %d migrations", startedMigrationsCount));
    new SecurityUtils();
    DisplayUtils.useCompatVectorIfNeeded();
    fixStoragePath();
    MainApp.storagePath = preferences.getStoragePath(getApplicationContext().getFilesDir().getAbsolutePath());
    OwnCloudClientManagerFactory.setUserAgent(getUserAgent());
    // initialise thumbnails cache on background thread
    new ThumbnailsCacheManager.InitDiskCacheTask().execute();
    if (BuildConfig.DEBUG || getApplicationContext().getResources().getBoolean(R.bool.logger_enabled)) {
        // use app writable dir, no permissions needed
        Log_OC.setLoggerImplementation(new LegacyLoggerAdapter(logger));
        Log_OC.d("Debug", "start logging");
    }
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
        try {
            Method m = StrictMode.class.getMethod("disableDeathOnFileUriExposure");
            m.invoke(null);
        } catch (Exception e) {
            Log_OC.d("Debug", "Failed to disable uri exposure");
        }
    }
    initSyncOperations(preferences, uploadsStorageManager, accountManager, connectivityService, powerManagementService, backgroundJobManager, clock);
    initContactsBackup(accountManager, backgroundJobManager);
    notificationChannels();
    backgroundJobManager.scheduleMediaFoldersDetectionJob();
    backgroundJobManager.startMediaFoldersDetectionJob();
    registerGlobalPassCodeProtection();
}
Also used : ActivityInjector(com.nextcloud.client.di.ActivityInjector) LegacyLoggerAdapter(com.nextcloud.client.logger.LegacyLoggerAdapter) ThumbnailsCacheManager(com.owncloud.android.datamodel.ThumbnailsCacheManager) SecurityUtils(com.owncloud.android.utils.SecurityUtils) Method(java.lang.reflect.Method) StoragePoint(com.owncloud.android.datastorage.StoragePoint) SuppressLint(android.annotation.SuppressLint) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) SuppressFBWarnings(edu.umd.cs.findbugs.annotations.SuppressFBWarnings)

Aggregations

SuppressLint (android.annotation.SuppressLint)1 ActivityInjector (com.nextcloud.client.di.ActivityInjector)1 LegacyLoggerAdapter (com.nextcloud.client.logger.LegacyLoggerAdapter)1 ThumbnailsCacheManager (com.owncloud.android.datamodel.ThumbnailsCacheManager)1 StoragePoint (com.owncloud.android.datastorage.StoragePoint)1 SecurityUtils (com.owncloud.android.utils.SecurityUtils)1 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)1 Method (java.lang.reflect.Method)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1