summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGloria Wang <gwang@google.com>2011-06-15 10:27:52 -0700
committerGloria Wang <gwang@google.com>2011-06-15 17:32:06 -0700
commit2980a213752d6e30edd4c689489cb4a2c3006252 (patch)
treebb9c533e73b6fcdefed5579be164b750cc3cc244
parentb2e9cde84b1df0506ac416ec6828e3f06de43293 (diff)
downloadframeworks_base-2980a213752d6e30edd4c689489cb4a2c3006252.zip
frameworks_base-2980a213752d6e30edd4c689489cb4a2c3006252.tar.gz
frameworks_base-2980a213752d6e30edd4c689489cb4a2c3006252.tar.bz2
-Fix some typo
-Remove one unnecessary memory allocation Change-Id: Icea21f33d2c7891333e06429d2f382389e5bd27f
-rw-r--r--drm/common/IDrmManagerService.cpp28
-rwxr-xr-xdrm/java/android/drm/DrmInfoRequest.java12
-rwxr-xr-xdrm/java/android/drm/DrmInfoStatus.java16
-rw-r--r--drm/libdrmframework/include/PlugInManager.h4
4 files changed, 29 insertions, 31 deletions
diff --git a/drm/common/IDrmManagerService.cpp b/drm/common/IDrmManagerService.cpp
index c37b4f8..458f1b6 100644
--- a/drm/common/IDrmManagerService.cpp
+++ b/drm/common/IDrmManagerService.cpp
@@ -37,7 +37,7 @@
using namespace android;
-static void writeDecrptHandleToParcelData(
+static void writeDecryptHandleToParcelData(
const DecryptHandle* handle, Parcel* data) {
data->writeInt32(handle->decryptId);
data->writeString8(handle->mimeType);
@@ -46,14 +46,14 @@ static void writeDecrptHandleToParcelData(
int size = handle->copyControlVector.size();
data->writeInt32(size);
- for(int i = 0; i < size; i++) {
+ for (int i = 0; i < size; i++) {
data->writeInt32(handle->copyControlVector.keyAt(i));
data->writeInt32(handle->copyControlVector.valueAt(i));
}
size = handle->extendedData.size();
data->writeInt32(size);
- for(int i = 0; i < size; i++) {
+ for (int i = 0; i < size; i++) {
data->writeString8(handle->extendedData.keyAt(i));
data->writeString8(handle->extendedData.valueAt(i));
}
@@ -77,14 +77,14 @@ static void readDecryptHandleFromParcelData(
handle->status = data.readInt32();
int size = data.readInt32();
- for (int i = 0; i < size; i ++) {
+ for (int i = 0; i < size; i++) {
DrmCopyControl key = (DrmCopyControl)data.readInt32();
int value = data.readInt32();
handle->copyControlVector.add(key, value);
}
size = data.readInt32();
- for (int i = 0; i < size; i ++) {
+ for (int i = 0; i < size; i++) {
String8 key = data.readString8();
String8 value = data.readString8();
handle->extendedData.add(key, value);
@@ -416,7 +416,7 @@ status_t BpDrmManagerService::consumeRights(
data.writeInterfaceToken(IDrmManagerService::getInterfaceDescriptor());
data.writeInt32(uniqueId);
- writeDecrptHandleToParcelData(decryptHandle, &data);
+ writeDecryptHandleToParcelData(decryptHandle, &data);
data.writeInt32(action);
data.writeInt32(static_cast< int>(reserve));
@@ -433,7 +433,7 @@ status_t BpDrmManagerService::setPlaybackStatus(
data.writeInterfaceToken(IDrmManagerService::getInterfaceDescriptor());
data.writeInt32(uniqueId);
- writeDecrptHandleToParcelData(decryptHandle, &data);
+ writeDecryptHandleToParcelData(decryptHandle, &data);
data.writeInt32(playbackStatus);
data.writeInt64(position);
@@ -646,7 +646,7 @@ status_t BpDrmManagerService::closeDecryptSession(int uniqueId, DecryptHandle* d
data.writeInterfaceToken(IDrmManagerService::getInterfaceDescriptor());
data.writeInt32(uniqueId);
- writeDecrptHandleToParcelData(decryptHandle, &data);
+ writeDecryptHandleToParcelData(decryptHandle, &data);
remote()->transact(CLOSE_DECRYPT_SESSION, data, &reply);
@@ -662,7 +662,7 @@ status_t BpDrmManagerService::initializeDecryptUnit(
data.writeInterfaceToken(IDrmManagerService::getInterfaceDescriptor());
data.writeInt32(uniqueId);
- writeDecrptHandleToParcelData(decryptHandle, &data);
+ writeDecryptHandleToParcelData(decryptHandle, &data);
data.writeInt32(decryptUnitId);
@@ -682,7 +682,7 @@ status_t BpDrmManagerService::decrypt(
data.writeInterfaceToken(IDrmManagerService::getInterfaceDescriptor());
data.writeInt32(uniqueId);
- writeDecrptHandleToParcelData(decryptHandle, &data);
+ writeDecryptHandleToParcelData(decryptHandle, &data);
data.writeInt32(decryptUnitId);
data.writeInt32((*decBuffer)->length);
@@ -715,7 +715,7 @@ status_t BpDrmManagerService::finalizeDecryptUnit(
data.writeInterfaceToken(IDrmManagerService::getInterfaceDescriptor());
data.writeInt32(uniqueId);
- writeDecrptHandleToParcelData(decryptHandle, &data);
+ writeDecryptHandleToParcelData(decryptHandle, &data);
data.writeInt32(decryptUnitId);
@@ -733,7 +733,7 @@ ssize_t BpDrmManagerService::pread(
data.writeInterfaceToken(IDrmManagerService::getInterfaceDescriptor());
data.writeInt32(uniqueId);
- writeDecrptHandleToParcelData(decryptHandle, &data);
+ writeDecryptHandleToParcelData(decryptHandle, &data);
data.writeInt32(numBytes);
data.writeInt64(offset);
@@ -1244,7 +1244,7 @@ status_t BnDrmManagerService::onTransact(
= openDecryptSession(uniqueId, fd, data.readInt64(), data.readInt64());
if (NULL != handle) {
- writeDecrptHandleToParcelData(handle, reply);
+ writeDecryptHandleToParcelData(handle, reply);
clearDecryptHandle(handle);
delete handle; handle = NULL;
}
@@ -1262,7 +1262,7 @@ status_t BnDrmManagerService::onTransact(
DecryptHandle* handle = openDecryptSession(uniqueId, uri.string());
if (NULL != handle) {
- writeDecrptHandleToParcelData(handle, reply);
+ writeDecryptHandleToParcelData(handle, reply);
clearDecryptHandle(handle);
delete handle; handle = NULL;
diff --git a/drm/java/android/drm/DrmInfoRequest.java b/drm/java/android/drm/DrmInfoRequest.java
index 2222ae8..1429fa5 100755
--- a/drm/java/android/drm/DrmInfoRequest.java
+++ b/drm/java/android/drm/DrmInfoRequest.java
@@ -32,16 +32,16 @@ public class DrmInfoRequest {
*/
public static final int TYPE_REGISTRATION_INFO = 1;
/**
- * Acquires information for unregistering the DRM server.
- */
+ * Acquires information for unregistering the DRM server.
+ */
public static final int TYPE_UNREGISTRATION_INFO = 2;
/**
- * Acquires rights information.
- */
+ * Acquires rights information.
+ */
public static final int TYPE_RIGHTS_ACQUISITION_INFO = 3;
/**
- * Acquires the progress of the rights acquisition.
- */
+ * Acquires the progress of the rights acquisition.
+ */
public static final int TYPE_RIGHTS_ACQUISITION_PROGRESS_INFO = 4;
/**
diff --git a/drm/java/android/drm/DrmInfoStatus.java b/drm/java/android/drm/DrmInfoStatus.java
index b04694b..5c12ae3 100755
--- a/drm/java/android/drm/DrmInfoStatus.java
+++ b/drm/java/android/drm/DrmInfoStatus.java
@@ -31,20 +31,20 @@ public class DrmInfoStatus {
public static final int STATUS_ERROR = 2;
/**
- * The status of the communication.
- */
+ * The status of the communication.
+ */
public final int statusCode;
/**
- * The type of DRM information processed.
- */
+ * The type of DRM information processed.
+ */
public final int infoType;
/**
- * The MIME type of the content.
- */
+ * The MIME type of the content.
+ */
public final String mimeType;
/**
- * The processed data.
- */
+ * The processed data.
+ */
public final ProcessedData data;
/**
diff --git a/drm/libdrmframework/include/PlugInManager.h b/drm/libdrmframework/include/PlugInManager.h
index 8029138..7bb143f 100644
--- a/drm/libdrmframework/include/PlugInManager.h
+++ b/drm/libdrmframework/include/PlugInManager.h
@@ -202,7 +202,7 @@ private:
Vector<String8> getPlugInPathList(const String8& rsDirPath) {
Vector<String8> fileList;
DIR* pDir = opendir(rsDirPath.string());
- struct dirent* pEntry = new dirent();
+ struct dirent* pEntry;
while (NULL != pDir && NULL != (pEntry = readdir(pDir))) {
if (!isPlugIn(pEntry)) {
@@ -219,8 +219,6 @@ private:
if (NULL != pDir) {
closedir(pDir);
}
- delete pEntry;
- pEntry = NULL;
return fileList;
}