diff options
author | Mike Lockwood <lockwood@android.com> | 2010-08-31 16:25:12 -0400 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2010-08-31 16:25:12 -0400 |
commit | 6b3a9d15c8a2282c03f1df7d72a55b6800d4ecec (patch) | |
tree | 18b3d54b2cfc9ef13e7c0d0adadb9b9c7e8e56b5 | |
parent | 6865ddb29fc7e7a14104d73c65b71074502bb6c7 (diff) | |
download | frameworks_av-6b3a9d15c8a2282c03f1df7d72a55b6800d4ecec.zip frameworks_av-6b3a9d15c8a2282c03f1df7d72a55b6800d4ecec.tar.gz frameworks_av-6b3a9d15c8a2282c03f1df7d72a55b6800d4ecec.tar.bz2 |
MTP: Send an Intent after an MTP session that resulted in media database modifications
Change-Id: Ib2796e9155350c67769502935a73cf98d6ae9c08
Signed-off-by: Mike Lockwood <lockwood@android.com>
-rw-r--r-- | media/mtp/MtpDatabase.h | 4 | ||||
-rw-r--r-- | media/mtp/MtpServer.cpp | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/media/mtp/MtpDatabase.h b/media/mtp/MtpDatabase.h index 899b34a..c8cb016 100644 --- a/media/mtp/MtpDatabase.h +++ b/media/mtp/MtpDatabase.h @@ -93,6 +93,10 @@ public: MtpObjectFormat format) = 0; virtual MtpProperty* getDevicePropertyDesc(MtpDeviceProperty property) = 0; + + virtual void sessionStarted() = 0; + + virtual void sessionEnded() = 0; }; }; // namespace android diff --git a/media/mtp/MtpServer.cpp b/media/mtp/MtpServer.cpp index 1e64e4f..c982114 100644 --- a/media/mtp/MtpServer.cpp +++ b/media/mtp/MtpServer.cpp @@ -185,6 +185,9 @@ void MtpServer::run() { LOGV("skipping response\n"); } } + + if (mSessionOpen) + mDatabase->sessionEnded(); } void MtpServer::sendObjectAdded(MtpObjectHandle handle) { @@ -346,6 +349,9 @@ MtpResponseCode MtpServer::doOpenSession() { } mSessionID = mRequest.getParameter(1); mSessionOpen = true; + + mDatabase->sessionStarted(); + return MTP_RESPONSE_OK; } @@ -354,6 +360,7 @@ MtpResponseCode MtpServer::doCloseSession() { return MTP_RESPONSE_SESSION_NOT_OPEN; mSessionID = 0; mSessionOpen = false; + mDatabase->sessionEnded(); return MTP_RESPONSE_OK; } |