@@ -159,11 +159,13 @@ android::status_t FwdLockEngine::onTerminate(int uniqueId) {
159159 return DRM_NO_ERROR;
160160}
161161
162+ // make sure that lower-case letters are used.
162163const String8 FwdLockEngine::FileSuffixes[] = {
163164 String8 (" .fl" ),
164165 String8 (" .dm" ),
165166};
166167
168+ // make sure that lower-case letters are used.
167169const String8 FwdLockEngine::MimeTypes[] = {
168170 String8 (" application/x-android-drm-fl" ),
169171 String8 (" application/vnd.oma.drm.message" ),
@@ -184,17 +186,21 @@ void FwdLockEngine::AddSupportedFileSuffixes(DrmSupportInfo *info) {
184186}
185187
186188bool FwdLockEngine::IsMimeTypeSupported (const String8& mime) {
189+ String8 tmp (mime);
190+ tmp.toLower ();
187191 for (size_t i = 0 , n = sizeof (MimeTypes)/sizeof (MimeTypes[0 ]); i < n; ++i) {
188- if (mime == MimeTypes[i]) {
192+ if (tmp == MimeTypes[i]) {
189193 return true ;
190194 }
191195 }
192196 return false ;
193197}
194198
195199bool FwdLockEngine::IsFileSuffixSupported (const String8& suffix) {
200+ String8 tmp (suffix);
201+ tmp.toLower ();
196202 for (size_t i = 0 , n = sizeof (FileSuffixes)/sizeof (FileSuffixes[0 ]); i < n; ++i) {
197- if (suffix == FileSuffixes[i]) {
203+ if (tmp == FileSuffixes[i]) {
198204 return true ;
199205 }
200206 }
@@ -220,7 +226,6 @@ bool FwdLockEngine::onCanHandle(int uniqueId, const String8& path) {
220226 bool result = false ;
221227
222228 String8 extString = path.getPathExtension ();
223- extString.toLower ();
224229 return IsFileSuffixSupported (extString);
225230}
226231
@@ -331,8 +336,6 @@ int FwdLockEngine::onGetDrmObjectType(int uniqueId,
331336
332337 LOG_VERBOSE (" FwdLockEngine::onGetDrmObjectType" );
333338
334- mimeStr.toLower ();
335-
336339 /* Checks whether
337340 * 1. path and mime type both are not empty strings (meaning unavailable) else content is unknown
338341 * 2. if one of them is empty string and if other is known then its a DRM Content Object.
0 commit comments