From 41b3d3be18b54e72a44813cbdd180aae7e77b444 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Mon, 14 Mar 2011 11:32:29 -0700 Subject: Bug 4016329 do full string comparisons Use full string comparisons instead of partial for file extension and MIME type. Do case-insensitive comparison of MIME type and file extensions. Fix error in comment for String8::getPathExtension. Remove dead code -- StringTokenizer is unused. Change-Id: I322be6235abbdaab5f7eafa48926dbb2cf46dc29 --- drm/common/DrmSupportInfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drm/common') diff --git a/drm/common/DrmSupportInfo.cpp b/drm/common/DrmSupportInfo.cpp index 3e02093..c0bff0e 100644 --- a/drm/common/DrmSupportInfo.cpp +++ b/drm/common/DrmSupportInfo.cpp @@ -45,7 +45,7 @@ bool DrmSupportInfo::isSupportedMimeType(const String8& mimeType) const { for (unsigned int i = 0; i < mMimeTypeVector.size(); i++) { const String8 item = mMimeTypeVector.itemAt(i); - if (String8("") != mimeType && item.find(mimeType) != -1) { + if (!strcasecmp(item.string(), mimeType.string())) { return true; } } @@ -56,7 +56,7 @@ bool DrmSupportInfo::isSupportedFileSuffix(const String8& fileType) const { for (unsigned int i = 0; i < mFileSuffixVector.size(); i++) { const String8 item = mFileSuffixVector.itemAt(i); - if (item.find(fileType) != -1) { + if (!strcasecmp(item.string(), fileType.string())) { return true; } } -- cgit v1.1