TestSession(Activity paramActivity, List<String> paramList, TokenCachingStrategy paramTokenCachingStrategy, String paramString, TestSession.Mode paramMode)
 {
   super(paramActivity, testApplicationId, paramTokenCachingStrategy);
   Validate.notNull(paramList, "permissions");
   Validate.notNullOrEmpty(testApplicationId, "testApplicationId");
   Validate.notNullOrEmpty(testApplicationSecret, "testApplicationSecret");
   sessionUniqueUserTag = paramString;
   mode = paramMode;
   requestedPermissions = paramList;
 }
  public Logger(LoggingBehavior behavior, String tag) {
    Validate.notNullOrEmpty(tag, "tag");

    this.behavior = behavior;
    this.tag = LOG_TAG_BASE + tag;
    this.contents = new StringBuilder();
  }
  TestSession(
      Activity activity,
      List<String> permissions,
      TokenCachingStrategy tokenCachingStrategy,
      String sessionUniqueUserTag,
      Mode mode) {
    super(activity, TestSession.testApplicationId, tokenCachingStrategy);

    Validate.notNull(permissions, "permissions");

    // Validate these as if they were arguments even though they are statics.
    Validate.notNullOrEmpty(testApplicationId, "testApplicationId");
    Validate.notNullOrEmpty(testApplicationSecret, "testApplicationSecret");

    this.sessionUniqueUserTag = sessionUniqueUserTag;
    this.mode = mode;
    this.requestedPermissions = permissions;
  }
示例#4
0
  /** Constructor is private, newLogger() methods should be used to build an instance. */
  private InsightsLogger(
      Context context, String clientToken, String applicationId, Session session) {

    Validate.notNull(context, "context");

    // Always ensure the client token is present, even if not needed for this particular logging
    // (because at
    // some point it will be required).  Be harsh by throwing an exception because this is all too
    // easy to miss
    // and things will work with authenticated sessions, but start failing with users that don't
    // have
    // authenticated sessions.
    Validate.notNullOrEmpty(clientToken, "clientToken");

    if (applicationId == null) {
      applicationId = Utility.getMetadataApplicationId(context);
    }

    this.context = context;
    this.clientToken = clientToken;
    this.applicationId = applicationId;
    this.specifiedSession = session;
  }