Search in sources :

Example 1 with ExceptionEvent

use of com.waz.zclient.controllers.tracking.events.exception.ExceptionEvent in project wire-android by wireapp.

the class MainActivity method onNewIntent.

@Override
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    if (IntentUtils.isPasswordResetIntent(intent)) {
        onPasswordWasReset();
    }
    injectJava(GlobalTrackingController.class).appLaunched(intent);
    String appCrash = getControllerFactory().getUserPreferencesController().getCrashException();
    String appCrashDetails = getControllerFactory().getUserPreferencesController().getCrashDetails();
    if (appCrash != null) {
        Event exceptionEvent = ExceptionEvent.exception(appCrash, appCrashDetails);
        injectJava(GlobalTrackingController.class).tagEvent(exceptionEvent);
    }
    setIntent(intent);
    String page = intent.getStringExtra(LaunchActivity.APP_PAGE);
    if (page == null || TextUtils.isEmpty(page)) {
        return;
    }
    setIntent(IntentUtils.resetAppPage(intent));
    switch(page) {
        case IntentUtils.LOCALYTICS_DEEPLINK_SEARCH:
        case IntentUtils.LOCALYTICS_DEEPLINK_PROFILE:
            restartAppWithPage(page);
            break;
        case IntentUtils.LOCALYTICS_DEEPLINK_SETTINGS:
            startActivity(ZetaPreferencesActivity.getDefaultIntent(this));
            break;
    }
}
Also used : GlobalTrackingController(com.waz.zclient.tracking.GlobalTrackingController) LoggedOutEvent(com.waz.zclient.core.controllers.tracking.events.session.LoggedOutEvent) Event(com.waz.zclient.core.controllers.tracking.events.Event) AcceptedGenericInviteEvent(com.waz.zclient.controllers.tracking.events.connect.AcceptedGenericInviteEvent) VerifiedConversationEvent(com.waz.zclient.controllers.tracking.events.otr.VerifiedConversationEvent) OpenedMediaActionEvent(com.waz.zclient.core.controllers.tracking.events.media.OpenedMediaActionEvent) ExceptionEvent(com.waz.zclient.controllers.tracking.events.exception.ExceptionEvent)

Example 2 with ExceptionEvent

use of com.waz.zclient.controllers.tracking.events.exception.ExceptionEvent in project wire-android by wireapp.

the class MainActivity method onCreate.

@Override
@SuppressWarnings("PMD")
public void onCreate(final Bundle savedInstanceState) {
    Timber.i("onCreate");
    if (getActionBar() != null) {
        getActionBar().hide();
    }
    super.onCreate(savedInstanceState);
    injectJava(UiTrackingController.class);
    //Prevent drawing the default background to reduce overdraw
    getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    setContentView(R.layout.main);
    if (LayoutSpec.isPhone(this)) {
        ViewUtils.lockScreenOrientation(Configuration.ORIENTATION_PORTRAIT, this);
    }
    FragmentManager fragmentManager = getSupportFragmentManager();
    initializeControllers();
    if (savedInstanceState == null) {
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        fragmentTransaction.add(R.id.fl__offline__container, ConnectivityFragment.newInstance(), ConnectivityFragment.TAG);
        if (BuildConfig.SHOW_GRIDOVERLAY) {
            fragmentTransaction.add(R.id.fl_main_grid, GridFragment.newInstance(), GridFragment.TAG);
        }
        fragmentTransaction.commit();
    } else {
        getControllerFactory().getNavigationController().onActivityCreated(savedInstanceState);
    }
    if (BuildConfigUtils.isHockeyUpdateEnabled() && !BuildConfigUtils.isLocalBuild(this)) {
        HockeyCrashReporting.checkForUpdates(this);
    }
    injectJava(GlobalTrackingController.class).appLaunched(getIntent());
    String appCrash = getControllerFactory().getUserPreferencesController().getCrashException();
    String appCrashDetails = getControllerFactory().getUserPreferencesController().getCrashDetails();
    if (appCrash != null) {
        Event exceptionEvent = ExceptionEvent.exception(appCrash, appCrashDetails);
        injectJava(GlobalTrackingController.class).tagEvent(exceptionEvent);
    }
    getControllerFactory().getLoadTimeLoggerController().appStart();
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) FragmentTransaction(android.support.v4.app.FragmentTransaction) GlobalTrackingController(com.waz.zclient.tracking.GlobalTrackingController) ColorDrawable(android.graphics.drawable.ColorDrawable) LoggedOutEvent(com.waz.zclient.core.controllers.tracking.events.session.LoggedOutEvent) Event(com.waz.zclient.core.controllers.tracking.events.Event) AcceptedGenericInviteEvent(com.waz.zclient.controllers.tracking.events.connect.AcceptedGenericInviteEvent) VerifiedConversationEvent(com.waz.zclient.controllers.tracking.events.otr.VerifiedConversationEvent) OpenedMediaActionEvent(com.waz.zclient.core.controllers.tracking.events.media.OpenedMediaActionEvent) ExceptionEvent(com.waz.zclient.controllers.tracking.events.exception.ExceptionEvent)

Aggregations

AcceptedGenericInviteEvent (com.waz.zclient.controllers.tracking.events.connect.AcceptedGenericInviteEvent)2 ExceptionEvent (com.waz.zclient.controllers.tracking.events.exception.ExceptionEvent)2 VerifiedConversationEvent (com.waz.zclient.controllers.tracking.events.otr.VerifiedConversationEvent)2 Event (com.waz.zclient.core.controllers.tracking.events.Event)2 OpenedMediaActionEvent (com.waz.zclient.core.controllers.tracking.events.media.OpenedMediaActionEvent)2 LoggedOutEvent (com.waz.zclient.core.controllers.tracking.events.session.LoggedOutEvent)2 GlobalTrackingController (com.waz.zclient.tracking.GlobalTrackingController)2 ColorDrawable (android.graphics.drawable.ColorDrawable)1 FragmentManager (android.support.v4.app.FragmentManager)1 FragmentTransaction (android.support.v4.app.FragmentTransaction)1