diff options
4 files changed, 0 insertions, 105 deletions
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java index b87614e..f694285 100644 --- a/core/java/android/app/ActivityManagerNative.java +++ b/core/java/android/app/ActivityManagerNative.java @@ -1251,24 +1251,6 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM reply.writeNoException(); return true; } - - case NOTE_START_WAKELOCK_TRANSACTION: { - data.enforceInterface(IActivityManager.descriptor); - int uid = data.readInt(); - String tag = data.readString(); - int type = data.readInt(); - noteStartWakeLock(uid, tag, type); - return true; - } - - case NOTE_STOP_WAKELOCK_TRANSACTION: { - data.enforceInterface(IActivityManager.descriptor); - int uid = data.readInt(); - String tag = data.readString(); - int type = data.readInt(); - noteStopWakeLock(uid, tag, type); - return true; - } } return super.onTransact(code, data, reply, flags); @@ -2776,31 +2758,5 @@ class ActivityManagerProxy implements IActivityManager return res; } - public void noteStartWakeLock(int uid, String tag, int type) throws RemoteException { - Parcel data = Parcel.obtain(); - Parcel reply = Parcel.obtain(); - data.writeInterfaceToken(IActivityManager.descriptor); - data.writeInt(uid); - data.writeString(tag); - data.writeInt(type); - mRemote.transact(NOTE_START_WAKELOCK_TRANSACTION, data, reply, 0); - reply.readException(); - data.recycle(); - reply.recycle(); - } - - public void noteStopWakeLock(int uid, String tag, int type) throws RemoteException { - Parcel data = Parcel.obtain(); - Parcel reply = Parcel.obtain(); - data.writeInterfaceToken(IActivityManager.descriptor); - data.writeInt(uid); - data.writeString(tag); - data.writeInt(type); - mRemote.transact(NOTE_STOP_WAKELOCK_TRANSACTION, data, reply, 0); - reply.readException(); - data.recycle(); - reply.recycle(); - } - private IBinder mRemote; } diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java index a846950..31f0a63 100644 --- a/core/java/android/app/IActivityManager.java +++ b/core/java/android/app/IActivityManager.java @@ -300,9 +300,6 @@ public interface IActivityManager extends IInterface { public void overridePendingTransition(IBinder token, String packageName, int enterAnim, int exitAnim) throws RemoteException; - - public void noteStartWakeLock(int uid, String tag, int type) throws RemoteException; - public void noteStopWakeLock(int uid, String tag, int type) throws RemoteException; public boolean isUserAMonkey() throws RemoteException; @@ -516,6 +513,4 @@ public interface IActivityManager extends IInterface { int WILL_ACTIVITY_BE_VISIBLE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+105; int START_ACTIVITY_WITH_CONFIG_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+106; int GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+107; - int NOTE_START_WAKELOCK_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+108; - int NOTE_STOP_WAKELOCK_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+109; } diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java index fcb7e29..493a348 100644 --- a/services/java/com/android/server/PowerManagerService.java +++ b/services/java/com/android/server/PowerManagerService.java @@ -728,12 +728,6 @@ class PowerManagerService extends IPowerManager.Stub if (acquireType >= 0) { try { - mActivityService.noteStartWakeLock(acquireUid, acquireName, acquireType); - } catch (RemoteException e) { - // Ignore - } - - try { mBatteryStats.noteStartWakelock(acquireUid, acquireName, acquireType); } catch (RemoteException e) { // Ignore @@ -802,12 +796,6 @@ class PowerManagerService extends IPowerManager.Stub releaseType = wl.monitorType; if (releaseType >= 0) { - try { - mActivityService.noteStopWakeLock(releaseUid, releaseName, releaseType); - } catch (RemoteException e) { - // Ignore - } - long origId = Binder.clearCallingIdentity(); try { mBatteryStats.noteStopWakelock(releaseUid, releaseName, releaseType); diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index 73ecdaa..0c11940 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -702,11 +702,6 @@ public final class ActivityManagerService extends ActivityManagerNative implemen = new ArrayList<ServiceRecord>(); /** - * Count of WakeLocks held per uid - */ - final HashMap<Integer, Integer> mUidWakeLocks = new HashMap<Integer, Integer>(); - - /** * Backup/restore process management */ String mBackupAppName = null; @@ -4410,39 +4405,6 @@ public final class ActivityManagerService extends ActivityManagerNative implemen Binder.restoreCallingIdentity(origId); } } - - public void noteStartWakeLock(int uid, String tag, int type) { - Integer iuid = Integer.valueOf(uid); - synchronized (this) { - Integer count = mUidWakeLocks.get(iuid); - if (count == null) { - count = new Integer(1); - mUidWakeLocks.put(iuid, count); - updateOomAdjLocked(); - } else { - ++count; - mUidWakeLocks.put(iuid, count); - } - } - } - - public void noteStopWakeLock(int uid, String tag, int type) { - Integer iuid = Integer.valueOf(uid); - synchronized (this) { - Integer count = mUidWakeLocks.get(iuid); - if (count != null) { - if (--count > 0) { - mUidWakeLocks.put(iuid, count); - } else { - mUidWakeLocks.remove(iuid); - updateOomAdjLocked(); - } - } else { - Log.e(TAG, "Stopping stopped wake lock for uid " - + uid + ": " + tag); - } - } - } /** * Perform clean-up of service connections in an activity record. @@ -13880,12 +13842,6 @@ public final class ActivityManagerService extends ActivityManagerNative implemen adj = FOREGROUND_APP_ADJ; schedGroup = Process.THREAD_GROUP_DEFAULT; app.adjType = "exec-service"; - } else if (mUidWakeLocks.get(app.info.uid) != null) { - // An app that is currently holding a wakelock also - // counts as being in the foreground. - adj = FOREGROUND_APP_ADJ; - schedGroup = Process.THREAD_GROUP_DEFAULT; - app.adjType = "wakelock"; } else if (app.foregroundServices) { // The user is aware of this app, so make it visible. adj = VISIBLE_APP_ADJ; |