code: static PackageInfo getDropboxAppPackage(Context context, Intent intent) {
          PackageManager manager = context.getPackageManager();
  
          List<ResolveInfo> infos = manager.queryIntentActivities(intent, 0);
          if (null == infos || 1 != infos.size()) {
              // The official app doesn't exist, or only an older version
              // is available, or multiple activities are confusing us.
              return null;
          } else {
              // The official app exists. Make sure it's the correct one by
              // checking signing keys.
              ResolveInfo resolveInfo = manager.resolveActivity(intent, 0);
              if (resolveInfo == null) {
                  return null;
              }
  
              final PackageInfo packageInfo;
              try {
                  packageInfo = manager.getPackageInfo(resolveInfo.activityInfo.packageName,
                      PackageManager.GET_SIGNATURES);
              } catch (NameNotFoundException e) {
                  return null;
              }
  
              for (Signature signature : packageInfo.signatures) {
                  for (String dbSignature : DROPBOX_APP_SIGNATURES) {
                      if (dbSignature.equals(signature.toCharsString())) {
                          return packageInfo;
                      }
                  }
              }
          }
  
          return null;
      }
docs: Verify that intent will be processed by Dropbox App
  
  @return PackageInfo of DropboxApp if Dropbox App can process intent, else null