Search in sources :

Example 1 with SsdkUnsupportedException

use of com.samsung.android.sdk.SsdkUnsupportedException in project PhoneProfiles by henrichg.

the class PPApplication method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    if (checkAppReplacingState())
        return;
    // Set up Crashlytics, disabled for debug builds
    Crashlytics crashlyticsKit = new Crashlytics.Builder().core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build()).build();
    Fabric.with(getApplicationContext(), crashlyticsKit);
    try {
        Crashlytics.setBool("DEBUG", BuildConfig.DEBUG);
    } catch (Exception ignored) {
    }
    // if (BuildConfig.DEBUG) {
    int actualVersionCode = 0;
    try {
        PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
        actualVersionCode = pInfo.versionCode;
    } catch (Exception ignored) {
    }
    Thread.setDefaultUncaughtExceptionHandler(new TopExceptionHandler(getApplicationContext(), actualVersionCode));
    // }
    // Debug.startMethodTracing("phoneprofiles");
    // long nanoTimeStart = startMeasuringRunTime();
    PACKAGE_NAME = getPackageName();
    LocalBroadcastManager.getInstance(getApplicationContext()).registerReceiver(PPApplication.dashClockBroadcastReceiver, new IntentFilter("DashClockBroadcastReceiver"));
    LocalBroadcastManager.getInstance(getApplicationContext()).registerReceiver(PPApplication.refreshGUIBroadcastReceiver, new IntentFilter("RefreshGUIBroadcastReceiver"));
    startHandlerThread();
    startHandlerThreadVolumes();
    startHandlerThreadRadios();
    startHandlerThreadAdaptiveBrightness();
    startHandlerThreadWallpaper();
    startHandlerThreadPowerSaveMode();
    startHandlerThreadLockDevice();
    startHandlerThreadRunApplication();
    startHandlerThreadHeadsUpNotifications();
    toastHandler = new Handler(getMainLooper());
    brightnessHandler = new Handler(getMainLooper());
    screenTimeoutHandler = new Handler(getMainLooper());
    // initialization
    // loadPreferences(this);
    PPApplication.initRoot();
    // https://github.com/evernote/android-job/issues/197
    JobConfig.setForceAllowApi14(true);
    JobManager.create(this).addJobCreator(new PPJobsCreator());
    // Log.d("PPApplication.onCreate", "memory usage (after create activateProfileHelper)=" + Debug.getNativeHeapAllocatedSize());
    // Log.d("PPApplication.onCreate","xxx");
    // getMeasuredRunTime(nanoTimeStart, "PPApplication.onCreate");
    // Samsung Look initialization
    sLook = new Slook();
    try {
        sLook.initialize(this);
        // true = The Device supports Edge Single Mode, Edge Single Plus Mode, and Edge Feeds Mode.
        sLookCocktailPanelEnabled = sLook.isFeatureEnabled(Slook.COCKTAIL_PANEL);
    // true = The Device supports Edge Immersive Mode feature.
    // sLookCocktailBarEnabled = sLook.isFeatureEnabled(Slook.COCKTAIL_BAR);
    } catch (SsdkUnsupportedException e) {
        sLook = null;
    }
}
Also used : IntentFilter(android.content.IntentFilter) SsdkUnsupportedException(com.samsung.android.sdk.SsdkUnsupportedException) PackageInfo(android.content.pm.PackageInfo) Slook(com.samsung.android.sdk.look.Slook) Handler(android.os.Handler) Crashlytics(com.crashlytics.android.Crashlytics) SsdkUnsupportedException(com.samsung.android.sdk.SsdkUnsupportedException) IOException(java.io.IOException) SuppressLint(android.annotation.SuppressLint)

Example 2 with SsdkUnsupportedException

use of com.samsung.android.sdk.SsdkUnsupportedException in project PhoneProfilesPlus by henrichg.

the class PPApplication method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    PPApplication.logE("##### PPApplication.onCreate", "romManufacturer=" + romManufacturer);
    if (checkAppReplacingState())
        return;
    // Set up Crashlytics, disabled for debug builds
    Crashlytics crashlyticsKit = new Crashlytics.Builder().core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build()).build();
    Fabric.with(getApplicationContext(), crashlyticsKit);
    try {
        Crashlytics.setBool("DEBUG", BuildConfig.DEBUG);
    } catch (Exception ignored) {
    }
    // if (BuildConfig.DEBUG) {
    int actualVersionCode = 0;
    try {
        PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
        actualVersionCode = pInfo.versionCode;
    } catch (Exception ignored) {
    }
    Thread.setDefaultUncaughtExceptionHandler(new TopExceptionHandler(getApplicationContext(), actualVersionCode));
    // }
    // Debug.startMethodTracing("phoneprofiles");
    // resetLog();
    // firstStartServiceStarted = false;
    PACKAGE_NAME = this.getPackageName();
    LocalBroadcastManager.getInstance(getApplicationContext()).registerReceiver(PPApplication.dashClockBroadcastReceiver, new IntentFilter("DashClockBroadcastReceiver"));
    LocalBroadcastManager.getInstance(getApplicationContext()).registerReceiver(PPApplication.refreshGUIBroadcastReceiver, new IntentFilter("RefreshGUIBroadcastReceiver"));
    startHandlerThread();
    startHandlerThreadVolumes();
    startHandlerThreadRadios();
    startHandlerThreadAdaptiveBrightness();
    startHandlerThreadWallpaper();
    startHandlerThreadPowerSaveMode();
    startHandlerThreadLockDevice();
    startHandlerThreadRunApplication();
    startHandlerThreadHeadsUpNotifications();
    toastHandler = new Handler(getMainLooper());
    brightnessHandler = new Handler(getMainLooper());
    screenTimeoutHandler = new Handler(getMainLooper());
    // https://github.com/evernote/android-job/issues/197
    JobConfig.setForceAllowApi14(true);
    JobManager.create(this).addJobCreator(new PPJobsCreator());
    PPApplication.initRoot();
    /*
        try {
            ViewConfiguration config = ViewConfiguration.get(this);
            Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey");
            if(menuKeyField != null) {
                menuKeyField.setAccessible(true);
                menuKeyField.setBoolean(config, false);
            }
        } catch (Exception ex) {
            // Ignore
        }
        */
    // Log.d("PPApplication.onCreate", "memory usage (after create activateProfileHelper)=" + Debug.getNativeHeapAllocatedSize());
    // Log.d("PPApplication.onCreate","xxx");
    // Samsung Look initialization
    sLook = new Slook();
    try {
        sLook.initialize(this);
        // true = The Device supports Edge Single Mode, Edge Single Plus Mode, and Edge Feeds Mode.
        sLookCocktailPanelEnabled = sLook.isFeatureEnabled(Slook.COCKTAIL_PANEL);
    // true = The Device supports Edge Immersive Mode feature.
    // sLookCocktailBarEnabled = sLook.isFeatureEnabled(Slook.COCKTAIL_BAR);
    } catch (SsdkUnsupportedException e) {
        sLook = null;
    }
}
Also used : IntentFilter(android.content.IntentFilter) SsdkUnsupportedException(com.samsung.android.sdk.SsdkUnsupportedException) PackageInfo(android.content.pm.PackageInfo) Slook(com.samsung.android.sdk.look.Slook) Handler(android.os.Handler) Crashlytics(com.crashlytics.android.Crashlytics) SsdkUnsupportedException(com.samsung.android.sdk.SsdkUnsupportedException) IOException(java.io.IOException) SuppressLint(android.annotation.SuppressLint)

Aggregations

SuppressLint (android.annotation.SuppressLint)2 IntentFilter (android.content.IntentFilter)2 PackageInfo (android.content.pm.PackageInfo)2 Handler (android.os.Handler)2 Crashlytics (com.crashlytics.android.Crashlytics)2 SsdkUnsupportedException (com.samsung.android.sdk.SsdkUnsupportedException)2 Slook (com.samsung.android.sdk.look.Slook)2 IOException (java.io.IOException)2