auto import from //branches/cupcake/...@130745

This commit is contained in:
The Android Open Source Project 2009-02-10 15:44:04 -08:00
parent 987df5db6d
commit 6e5ad3c6e8
4 changed files with 51 additions and 4 deletions

View file

@ -54,6 +54,21 @@ public:
* Safely unmount external storage at given mount point.
*/
virtual void unmountMedia(String16 mountPoint) = 0;
/**
* Format external storage at given mount point.
*/
virtual void formatMedia(String16 mountPoint) = 0;
/**
* Returns true if we're playing media notification sounds.
*/
virtual bool getPlayNotificationSounds() = 0;
/**
* Sets whether or not media notification sounds are played.
*/
virtual void setPlayNotificationSounds(bool enabled) = 0;
};
// ----------------------------------------------------------------------

View file

@ -24,9 +24,11 @@ extern "C" {
/**
* Turn on vibrator
*
* @param timeout_ms number of milliseconds to vibrate
*
* @return 0 if successful, -1 if error
*/
int vibrator_on();
int vibrator_on(int timeout_ms);
/**
* Turn off vibrator

View file

@ -28,7 +28,10 @@ enum {
SET_MASS_STORAGE_ENABLED_TRANSACTION,
GET_MASS_STORAGE_CONNECTED_TRANSACTION,
MOUNT_MEDIA_TRANSACTION,
UNMOUNT_MEDIA_TRANSACTION
UNMOUNT_MEDIA_TRANSACTION,
FORMAT_MEDIA_TRANSACTION,
SET_PLAY_NOTIFICATION_SOUNDS_TRANSACTION,
GET_PLAY_NOTIFICATION_SOUNDS_TRANSACTION,
};
class BpMountService : public BpInterface<IMountService>
@ -80,6 +83,33 @@ public:
data.writeString16(mountPoint);
remote()->transact(UNMOUNT_MEDIA_TRANSACTION, data, &reply);
}
virtual void formatMedia(String16 mountPoint)
{
Parcel data, reply;
data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
data.writeString16(mountPoint);
remote()->transact(FORMAT_MEDIA_TRANSACTION, data, &reply);
}
virtual bool getPlayNotificationSounds()
{
uint32_t n;
Parcel data, reply;
data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
remote()->transact(GET_PLAY_NOTIFICATION_SOUNDS_TRANSACTION, data, &reply);
return reply.readInt32();
}
virtual void setPlayNotificationSounds(bool enabled)
{
Parcel data, reply;
data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
data.writeInt32(enabled ? 1 : 0);
remote()->transact(SET_PLAY_NOTIFICATION_SOUNDS_TRANSACTION, data, &reply);
}
};
IMPLEMENT_META_INTERFACE(MountService, "android.os.IMountService");

View file

@ -46,10 +46,10 @@ static int sendit(int timeout_ms)
return (ret == nwr) ? 0 : -1;
}
int vibrator_on()
int vibrator_on(int timeout_ms)
{
/* constant on, up to maximum allowed time */
return sendit(-1);
return sendit(timeout_ms);
}
int vibrator_off()