summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2010-01-06 14:43:06 -0800
committerSan Mehat <san@google.com>2010-01-06 14:51:15 -0800
commit4a57c55ce86e05e8cde58ff5ce945320ee23304f (patch)
tree97f2faf4a6accd77f2690f73007400346f649af1
parent035181b8fc0267b983a026ec1f133b944f22282f (diff)
downloadplatform_hardware_libhardware_legacy-4a57c55ce86e05e8cde58ff5ce945320ee23304f.tar.gz
platform_hardware_libhardware_legacy-4a57c55ce86e05e8cde58ff5ce945320ee23304f.tar.bz2
platform_hardware_libhardware_legacy-4a57c55ce86e05e8cde58ff5ce945320ee23304f.zip
legacy: Add asec binder transaction support to c++ wrappers
Signed-off-by: San Mehat <san@google.com>
-rw-r--r--include/hardware_legacy/IMountService.h19
-rw-r--r--mount/IMountService.cpp88
2 files changed, 105 insertions, 2 deletions
diff --git a/include/hardware_legacy/IMountService.h b/include/hardware_legacy/IMountService.h
index f5f03c9..7c5e612 100644
--- a/include/hardware_legacy/IMountService.h
+++ b/include/hardware_legacy/IMountService.h
@@ -69,6 +69,25 @@ public:
* Sets whether or not media notification sounds are played.
*/
virtual void setPlayNotificationSounds(bool enabled) = 0;
+
+ /**
+ * Returns true if USB Mass Storage is automatically started
+ * when a UMS host is detected.
+ */
+ virtual bool getAutoStartUms() = 0;
+
+ /*
+ * Sets whether or not USB Mass Storage is automatically started
+ * when a UMS host is detected.
+ */
+ virtual void setAutoStartUms(bool autostart) = 0;
+
+ virtual String16 getVolumeState(String16 mountPoint) = 0;
+ virtual String16 createSecureCache(String16 id, int sizeMb, String16 fstype, String16 key, int ownerUid) = 0;
+ virtual void finalizeSecureCache(String16 id) = 0;
+ virtual void destroySecureCache(String16 id) = 0;
+ virtual String16 mountSecureCache(String16 id, String16 key, int ownerUid) = 0;
+ virtual String16 getSecureCachePath(String16 id) = 0;
};
// ----------------------------------------------------------------------
diff --git a/mount/IMountService.cpp b/mount/IMountService.cpp
index c30ac0b..14ba940 100644
--- a/mount/IMountService.cpp
+++ b/mount/IMountService.cpp
@@ -30,8 +30,16 @@ enum {
MOUNT_MEDIA_TRANSACTION,
UNMOUNT_MEDIA_TRANSACTION,
FORMAT_MEDIA_TRANSACTION,
- SET_PLAY_NOTIFICATION_SOUNDS_TRANSACTION,
GET_PLAY_NOTIFICATION_SOUNDS_TRANSACTION,
+ SET_PLAY_NOTIFICATION_SOUNDS_TRANSACTION,
+ GET_AUTOSTART_UMS_TRANSACTION,
+ SET_AUTOSTART_UMS_TRANSACTION,
+ GET_VOLUME_STATE_TRANSACTION,
+ CREATE_SECURE_CACHE_TRANSACTION,
+ FINALIZE_SECURE_CACHE_TRANSACTION,
+ DESTROY_SECURE_CACHE_TRANSACTION,
+ MOUNT_SECURE_CACHE_TRANSACTION,
+ GET_SECURE_CACHE_PATH_TRANSACTION
};
class BpMountService : public BpInterface<IMountService>
@@ -109,7 +117,83 @@ public:
remote()->transact(SET_PLAY_NOTIFICATION_SOUNDS_TRANSACTION, data, &reply);
}
-
+ virtual bool getAutoStartUms()
+ {
+ uint32_t n;
+ Parcel data, reply;
+ data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
+ remote()->transact(GET_AUTOSTART_UMS_TRANSACTION, data, &reply);
+ return reply.readInt32();
+ }
+
+ virtual void setAutoStartUms(bool enabled)
+ {
+ Parcel data, reply;
+ data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
+ data.writeInt32(enabled ? 1 : 0);
+ remote()->transact(SET_AUTOSTART_UMS_TRANSACTION, data, &reply);
+ }
+
+ virtual String16 getVolumeState(String16 mountPoint)
+ {
+ uint32_t n;
+ Parcel data, reply;
+ data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
+ data.writeString16(mountPoint);
+ remote()->transact(GET_VOLUME_STATE_TRANSACTION, data, &reply);
+ return reply.readString16();
+ }
+
+ virtual String16 createSecureCache(String16 id, int sizeMb, String16 fstype, String16 key, int ownerUid)
+ {
+ uint32_t n;
+ Parcel data, reply;
+ data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
+ data.writeString16(id);
+ data.writeInt32(sizeMb);
+ data.writeString16(fstype);
+ data.writeString16(key);
+ data.writeInt32(ownerUid);
+ remote()->transact(CREATE_SECURE_CACHE_TRANSACTION, data, &reply);
+ return reply.readString16();
+ }
+
+ virtual void finalizeSecureCache(String16 id)
+ {
+ Parcel data, reply;
+ data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
+ data.writeString16(id);
+ remote()->transact(FINALIZE_SECURE_CACHE_TRANSACTION, data, &reply);
+ }
+
+ virtual void destroySecureCache(String16 id)
+ {
+ Parcel data, reply;
+ data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
+ data.writeString16(id);
+ remote()->transact(DESTROY_SECURE_CACHE_TRANSACTION, data, &reply);
+ }
+
+ virtual String16 mountSecureCache(String16 id, String16 key, int ownerUid)
+ {
+ Parcel data, reply;
+ data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
+ data.writeString16(id);
+ data.writeString16(key);
+ data.writeInt32(ownerUid);
+ remote()->transact(MOUNT_SECURE_CACHE_TRANSACTION, data, &reply);
+ return reply.readString16();
+ }
+
+ virtual String16 getSecureCachePath(String16 id)
+ {
+ uint32_t n;
+ Parcel data, reply;
+ data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
+ data.writeString16(id);
+ remote()->transact(GET_SECURE_CACHE_PATH_TRANSACTION, data, &reply);
+ return reply.readString16();
+ }
};
IMPLEMENT_META_INTERFACE(MountService, "android.os.IMountService");