|
|
|
@ -29,7 +29,6 @@
|
|
|
|
|
#include <utils/Log.h>
|
|
|
|
|
#include <cutils/properties.h>
|
|
|
|
|
#include <binder/IPCThreadState.h>
|
|
|
|
|
#include <binder/ActivityManager.h>
|
|
|
|
|
#include <binder/PermissionController.h>
|
|
|
|
|
#include <binder/IResultReceiver.h>
|
|
|
|
|
#include <utils/String16.h>
|
|
|
|
@ -774,28 +773,26 @@ status_t AudioPolicyService::printHelp(int out) {
|
|
|
|
|
// ----------- AudioPolicyService::UidPolicy implementation ----------
|
|
|
|
|
|
|
|
|
|
void AudioPolicyService::UidPolicy::registerSelf() {
|
|
|
|
|
ActivityManager am;
|
|
|
|
|
am.registerUidObserver(this, ActivityManager::UID_OBSERVER_GONE
|
|
|
|
|
status_t res = mAm.linkToDeath(this);
|
|
|
|
|
mAm.registerUidObserver(this, ActivityManager::UID_OBSERVER_GONE
|
|
|
|
|
| ActivityManager::UID_OBSERVER_IDLE
|
|
|
|
|
| ActivityManager::UID_OBSERVER_ACTIVE
|
|
|
|
|
| ActivityManager::UID_OBSERVER_PROCSTATE,
|
|
|
|
|
ActivityManager::PROCESS_STATE_UNKNOWN,
|
|
|
|
|
String16("audioserver"));
|
|
|
|
|
status_t res = am.linkToDeath(this);
|
|
|
|
|
if (!res) {
|
|
|
|
|
Mutex::Autolock _l(mLock);
|
|
|
|
|
mObserverRegistered = true;
|
|
|
|
|
} else {
|
|
|
|
|
ALOGE("UidPolicy::registerSelf linkToDeath failed: %d", res);
|
|
|
|
|
|
|
|
|
|
am.unregisterUidObserver(this);
|
|
|
|
|
mAm.unregisterUidObserver(this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AudioPolicyService::UidPolicy::unregisterSelf() {
|
|
|
|
|
ActivityManager am;
|
|
|
|
|
am.unlinkToDeath(this);
|
|
|
|
|
am.unregisterUidObserver(this);
|
|
|
|
|
mAm.unlinkToDeath(this);
|
|
|
|
|
mAm.unregisterUidObserver(this);
|
|
|
|
|
Mutex::Autolock _l(mLock);
|
|
|
|
|
mObserverRegistered = false;
|
|
|
|
|
}
|
|
|
|
|