Migrate from android::String isEmpty to empty
This empty method is different from the old one - it aligns with
std::string definition.
Bug: 295394788
Test: make checkbuild
Change-Id: I890b3dfa930002f4406e9d9aec024f94ada1cad0
diff --git a/drm/drmserver/DrmManager.cpp b/drm/drmserver/DrmManager.cpp
index f7989bd..9b27737 100644
--- a/drm/drmserver/DrmManager.cpp
+++ b/drm/drmserver/DrmManager.cpp
@@ -127,7 +127,7 @@
}
}
- if (!mimeType.isEmpty()) {
+ if (!mimeType.empty()) {
metrics.mMimeTypes.insert(mimeType.c_str());
} else if (NULL != info) {
DrmSupportInfo::MimeTypeIterator mimeIter = info->getMimeTypeIterator();
@@ -395,7 +395,7 @@
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
mimeType = rDrmEngine.getOriginalMimeType(uniqueId, path, fd);
}
- if (!mimeType.isEmpty()) {
+ if (!mimeType.empty()) {
recordEngineMetrics(__func__, plugInId, mimeType);
}
return mimeType;
diff --git a/drm/libmediadrm/DrmHalAidl.cpp b/drm/libmediadrm/DrmHalAidl.cpp
index 9e30708..7106d66 100644
--- a/drm/libmediadrm/DrmHalAidl.cpp
+++ b/drm/libmediadrm/DrmHalAidl.cpp
@@ -375,7 +375,7 @@
sp<DrmHalAidl> drm = mDrm.promote();
if (drm == NULL) {
name.append("<deleted>");
- } else if (drm->getPropertyStringInternal(String8("vendor"), name) != OK || name.isEmpty()) {
+ } else if (drm->getPropertyStringInternal(String8("vendor"), name) != OK || name.empty()) {
name.append("<Get vendor failed or is empty>");
}
name.append("[");
@@ -947,12 +947,12 @@
String8 vendor;
String8 description;
- if (getPropertyStringInternal(String8("vendor"), vendor) != OK || vendor.isEmpty()) {
+ if (getPropertyStringInternal(String8("vendor"), vendor) != OK || vendor.empty()) {
ALOGE("Get vendor failed or is empty");
vendor = "NONE";
}
if (getPropertyStringInternal(String8("description"), description) != OK ||
- description.isEmpty()) {
+ description.empty()) {
ALOGE("Get description failed or is empty.");
description = "NONE";
}
diff --git a/drm/libmediadrm/DrmHalHidl.cpp b/drm/libmediadrm/DrmHalHidl.cpp
index 29dde96..9317345 100644
--- a/drm/libmediadrm/DrmHalHidl.cpp
+++ b/drm/libmediadrm/DrmHalHidl.cpp
@@ -273,7 +273,7 @@
sp<DrmHalHidl> drm = mDrm.promote();
if (drm == NULL) {
name.append("<deleted>");
- } else if (drm->getPropertyStringInternal(String8("vendor"), name) != OK || name.isEmpty()) {
+ } else if (drm->getPropertyStringInternal(String8("vendor"), name) != OK || name.empty()) {
name.append("<Get vendor failed or is empty>");
}
name.append("[");
@@ -1261,12 +1261,12 @@
if (mPluginV1_1 != NULL) {
String8 vendor;
String8 description;
- if (getPropertyStringInternal(String8("vendor"), vendor) != OK || vendor.isEmpty()) {
+ if (getPropertyStringInternal(String8("vendor"), vendor) != OK || vendor.empty()) {
ALOGE("Get vendor failed or is empty");
vendor = "NONE";
}
if (getPropertyStringInternal(String8("description"), description) != OK ||
- description.isEmpty()) {
+ description.empty()) {
ALOGE("Get description failed or is empty.");
description = "NONE";
}
diff --git a/drm/mediacas/plugins/clearkey/ClearKeyCasPlugin.cpp b/drm/mediacas/plugins/clearkey/ClearKeyCasPlugin.cpp
index 37051d5..c364bbb 100644
--- a/drm/mediacas/plugins/clearkey/ClearKeyCasPlugin.cpp
+++ b/drm/mediacas/plugins/clearkey/ClearKeyCasPlugin.cpp
@@ -131,7 +131,7 @@
for (size_t i = 0; i < array.size(); i++) {
result.appendFormat("%02x ", array[i]);
}
- if (result.isEmpty()) {
+ if (result.empty()) {
result.append("(null)");
}
return result;
diff --git a/drm/mediacas/plugins/clearkey/JsonAssetLoader.cpp b/drm/mediacas/plugins/clearkey/JsonAssetLoader.cpp
index a54ae47..07de1d2 100644
--- a/drm/mediacas/plugins/clearkey/JsonAssetLoader.cpp
+++ b/drm/mediacas/plugins/clearkey/JsonAssetLoader.cpp
@@ -187,7 +187,7 @@
*/
bool JsonAssetLoader::parseJsonAssetString(const String8& jsonAsset,
Vector<String8>* jsonObjects) {
- if (jsonAsset.isEmpty()) {
+ if (jsonAsset.empty()) {
ALOGE("Empty JSON Web Key");
return false;
}
diff --git a/drm/mediacas/plugins/mock/MockCasPlugin.cpp b/drm/mediacas/plugins/mock/MockCasPlugin.cpp
index 671fba1..cbff6cb 100644
--- a/drm/mediacas/plugins/mock/MockCasPlugin.cpp
+++ b/drm/mediacas/plugins/mock/MockCasPlugin.cpp
@@ -96,7 +96,7 @@
for (size_t i = 0; i < array.size(); i++) {
result.appendFormat("%02x ", array[i]);
}
- if (result.isEmpty()) {
+ if (result.empty()) {
result.append("(null)");
}
return result;
diff --git a/drm/mediadrm/plugins/clearkey/default/JsonWebKey.cpp b/drm/mediadrm/plugins/clearkey/default/JsonWebKey.cpp
index a12b1d1..6db70c1 100644
--- a/drm/mediadrm/plugins/clearkey/default/JsonWebKey.cpp
+++ b/drm/mediadrm/plugins/clearkey/default/JsonWebKey.cpp
@@ -77,7 +77,7 @@
return false;
if (findKey(mJsonObjects[i], &encodedKeyId, &encodedKey)) {
- if (encodedKeyId.isEmpty() || encodedKey.isEmpty()) {
+ if (encodedKeyId.empty() || encodedKey.empty()) {
ALOGE("Must have both key id and key in the JsonWebKey set.");
continue;
}
@@ -225,7 +225,7 @@
*/
bool JsonWebKey::parseJsonWebKeySet(const String8& jsonWebKeySet,
Vector<String8>* jsonObjects) {
- if (jsonWebKeySet.isEmpty()) {
+ if (jsonWebKeySet.empty()) {
ALOGE("Empty JSON Web Key");
return false;
}