diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/camera/ICameraService.h | 19 | ||||
-rw-r--r-- | include/media/AudioSystem.h | 13 |
2 files changed, 27 insertions, 5 deletions
diff --git a/include/camera/ICameraService.h b/include/camera/ICameraService.h index c8d3d19..cad275e 100644 --- a/include/camera/ICameraService.h +++ b/include/camera/ICameraService.h @@ -51,6 +51,7 @@ public: SUPPORTS_CAMERA_API, CONNECT_LEGACY, SET_TORCH_MODE, + NOTIFY_SYSTEM_EVENT, }; enum { @@ -64,7 +65,18 @@ public: enum { CAMERA_HAL_API_VERSION_UNSPECIFIED = -1 - }; + }; + + /** + * Keep up-to-date with declarations in + * frameworks/base/services/core/java/com/android/server/camera/CameraService.java + * + * These event codes are intended to be used with the notifySystemEvent call. + */ + enum { + NO_EVENT = 0, + USER_SWITCHED, + }; public: DECLARE_META_INTERFACE(CameraService); @@ -148,6 +160,11 @@ public: */ virtual status_t setTorchMode(const String16& cameraId, bool enabled, const sp<IBinder>& clientBinder) = 0; + + /** + * Notify the camera service of a system event. Should only be called from system_server. + */ + virtual void notifySystemEvent(int eventId, int arg0) = 0; }; // ---------------------------------------------------------------------------- diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h index ad5d6ed..f5db1bb 100644 --- a/include/media/AudioSystem.h +++ b/include/media/AudioSystem.h @@ -346,7 +346,8 @@ public: }; - static void setAudioPortCallback(sp<AudioPortCallback> callBack); + static status_t addAudioPortCallback(const sp<AudioPortCallback>& callBack); + static status_t removeAudioPortCallback(const sp<AudioPortCallback>& callBack); private: @@ -373,12 +374,19 @@ private: AudioPolicyServiceClient() { } + status_t addAudioPortCallback(const sp<AudioPortCallback>& callBack); + status_t removeAudioPortCallback(const sp<AudioPortCallback>& callBack); + // DeathRecipient virtual void binderDied(const wp<IBinder>& who); // IAudioPolicyServiceClient virtual void onAudioPortListUpdate(); virtual void onAudioPatchListUpdate(); + + private: + Mutex mLock; + Vector <sp <AudioPortCallback> > mAudioPortCallbacks; }; static sp<AudioFlingerClient> gAudioFlingerClient; @@ -390,7 +398,6 @@ private: static Mutex gLockCache; // protects gOutputs, gPrevInSamplingRate, gPrevInFormat, // gPrevInChannelMask and gInBuffSize static Mutex gLockAPS; // protects gAudioPolicyService and gAudioPolicyServiceClient - static Mutex gLockAPC; // protects gAudioPortCallback static sp<IAudioFlinger> gAudioFlinger; static audio_error_callback gAudioErrorCallback; @@ -405,8 +412,6 @@ private: // list of output descriptors containing cached parameters // (sampling rate, framecount, channel count...) static DefaultKeyedVector<audio_io_handle_t, OutputDescriptor *> gOutputs; - - static sp<AudioPortCallback> gAudioPortCallback; }; }; // namespace android |