code: public static void deactivateApp(Context context, String applicationId) {
          if (context == null || applicationId == null) {
              throw new IllegalArgumentException("Both context and applicationId must be non-null");
          }
  
          resetSourceApplication();
  
          final AppEventsLogger logger = new AppEventsLogger(context, applicationId, null);
          final long eventTime = System.currentTimeMillis();
          backgroundExecutor.execute(new Runnable() {
              @Override
              public void run() {
                  logger.logAppSessionSuspendEvent(eventTime);
              }
          });
      }
docs: Notifies the events system that the app has been deactivated (put in the background) and
  tracks the application session information. Should be called whenever your app becomes
  inactive, typically in the onPause() method of each long-running Activity of your app.
  
  @param context       Used to access the attributionId for non-authenticated users.
  @param applicationId The specific applicationId to track session information for.