diff --git a/include/gui/SensorManager.h b/include/gui/SensorManager.h
index 3796067..0cff46c 100644
--- a/include/gui/SensorManager.h
+++ b/include/gui/SensorManager.h
@@ -51,57 +51,7 @@
     public ASensorManager
 {
 public:
-    static SensorManager& getInstanceForPackage(const String16& packageName) {
-        Mutex::Autolock _l(sLock);
-
-        SensorManager* sensorManager;
-        std::map<String16, SensorManager*>::iterator iterator =
-                sPackageInstances.find(packageName);
-
-        if (iterator != sPackageInstances.end()) {
-            sensorManager = iterator->second;
-        } else {
-            String16 opPackageName = packageName;
-
-            // It is possible that the calling code has no access to the package name.
-            // In this case we will get the packages for the calling UID and pick the
-            // first one for attributing the app op. This will work correctly for
-            // runtime permissions as for legacy apps we will toggle the app op for
-            // all packages in the UID. The caveat is that the operation may be attributed
-            // to the wrong package and stats based on app ops may be slightly off.
-            if (opPackageName.size() <= 0) {
-                sp<IBinder> binder = defaultServiceManager()->getService(String16("permission"));
-                if (binder != 0) {
-                    const uid_t uid = IPCThreadState::self()->getCallingUid();
-                    Vector<String16> packages;
-                    interface_cast<IPermissionController>(binder)->getPackagesForUid(uid, packages);
-                    if (!packages.isEmpty()) {
-                        opPackageName = packages[0];
-                    } else {
-                        ALOGE("No packages for calling UID");
-                    }
-                } else {
-                    ALOGE("Cannot get permission service");
-                }
-            }
-
-            sensorManager = new SensorManager(opPackageName);
-
-            // If we had no package name, we looked it up from the UID and the sensor
-            // manager instance we created should also be mapped to the empty package
-            // name, to avoid looking up the packages for a UID and get the same result.
-            if (packageName.size() <= 0) {
-                sPackageInstances.insert(std::make_pair(String16(), sensorManager));
-            }
-
-            // Stash the per package sensor manager.
-            sPackageInstances.insert(std::make_pair(opPackageName, sensorManager));
-        }
-
-        return *sensorManager;
-    }
-
-    SensorManager(const String16& opPackageName);
+    static SensorManager& getInstanceForPackage(const String16& packageName);
     ~SensorManager();
 
     ssize_t getSensorList(Sensor const* const** list) const;
@@ -113,6 +63,7 @@
     // DeathRecipient interface
     void sensorManagerDied();
 
+    SensorManager(const String16& opPackageName);
     status_t assertStateLocked() const;
 
 private:
