code: private static int getLoggedinState(Context context, String uid) {
          Cursor cursor = context.getContentResolver().query(
              LOGGED_IN_URI.buildUpon().appendPath(uid).build(), null, // projection
              null, // selection clause
              null, // selection args
              null); // sort order
  
          if (cursor == null) {
              // DropboxApp not installed
              return NO_USER;
          }
          cursor.moveToFirst();
          return cursor.getInt(cursor.getColumnIndex("logged_in"));
      }
docs: Determine if user uid is logged in
  
  @param context
  @param uid
  @return NO_USER if no users connected CORRECT_USER if uid connected WRONG_USER if uid not
  connected