am 65f1d44c: am a29db50c: Merge "Revert "Bug fix in SensorManager."" into mnc-dev

* commit '65f1d44cd8d96a4555ce6929bb5e2022307738e8':
  Revert "Bug fix in SensorManager."
This commit is contained in:
Narayan Kamath 2015-07-29 10:27:27 +00:00 committed by Android Git Automerger
commit 14d2548ab7
2 changed files with 4 additions and 11 deletions

View File

@ -101,6 +101,7 @@ public:
return *sensorManager;
}
SensorManager(const String16& opPackageName);
~SensorManager();
ssize_t getSensorList(Sensor const* const** list) const;
@ -112,7 +113,6 @@ private:
// DeathRecipient interface
void sensorManagerDied();
SensorManager(const String16& opPackageName);
status_t assertStateLocked() const;
private:
@ -127,8 +127,6 @@ private:
const String16 mOpPackageName;
};
android::Mutex android::SensorManager::sLock;
std::map<String16, SensorManager*> android::SensorManager::sPackageInstances;
// ----------------------------------------------------------------------------
}; // namespace android

View File

@ -59,13 +59,12 @@ void SensorManager::sensorManagerDied()
status_t SensorManager::assertStateLocked() const {
if (mSensorServer == NULL) {
// try for one second
const String16 name("sensorservice");
// try 10 times before giving up ...
for (int i = 0; i < 10; ++i) {
for (int i=0 ; i<4 ; i++) {
status_t err = getService(name, &mSensorServer);
if (err == NAME_NOT_FOUND) {
// Sleep for 1 second before retrying.
sleep(1);
usleep(250000);
continue;
}
if (err != NO_ERROR) {
@ -74,10 +73,6 @@ status_t SensorManager::assertStateLocked() const {
break;
}
if (mSensorServer == NULL) {
ALOGE("FATAL getsensorservice returned` NULL");
}
class DeathObserver : public IBinder::DeathRecipient {
SensorManager& mSensorManger;
virtual void binderDied(const wp<IBinder>& who) {