use of android.os.WorkSource in project android_frameworks_base by AOSPA.
the class LocationManagerService method removeUpdates.
@Override
public void removeUpdates(ILocationListener listener, PendingIntent intent, String packageName) {
checkPackageName(packageName);
final int pid = Binder.getCallingPid();
final int uid = Binder.getCallingUid();
synchronized (mLock) {
WorkSource workSource = null;
boolean hideFromAppOps = false;
Receiver receiver = checkListenerOrIntentLocked(listener, intent, pid, uid, packageName, workSource, hideFromAppOps);
// providers may use public location API's, need to clear identity
long identity = Binder.clearCallingIdentity();
try {
removeUpdatesLocked(receiver);
} finally {
Binder.restoreCallingIdentity(identity);
}
}
}
use of android.os.WorkSource in project android_frameworks_base by DirtyUnicorns.
the class PackageDexOptimizer method performDexOpt.
/**
* Performs dexopt on all code paths and libraries of the specified package for specified
* instruction sets.
*
* <p>Calls to {@link com.android.server.pm.Installer#dexopt} on {@link #mInstaller} are
* synchronized on {@link #mInstallLock}.
*/
int performDexOpt(PackageParser.Package pkg, String[] sharedLibraries, String[] instructionSets, boolean checkProfiles, String targetCompilationFilter, CompilerStats.PackageStats packageStats) {
synchronized (mInstallLock) {
final boolean useLock = mSystemReady;
if (useLock) {
mDexoptWakeLock.setWorkSource(new WorkSource(pkg.applicationInfo.uid));
mDexoptWakeLock.acquire();
}
try {
return performDexOptLI(pkg, sharedLibraries, instructionSets, checkProfiles, targetCompilationFilter, packageStats);
} finally {
if (useLock) {
mDexoptWakeLock.release();
}
}
}
}
use of android.os.WorkSource in project android_frameworks_base by AOSPA.
the class GnssLocationProvider method handleDisable.
private void handleDisable() {
if (DEBUG)
Log.d(TAG, "handleDisable");
updateClientUids(new WorkSource());
stopNavigating();
mAlarmManager.cancel(mWakeupIntent);
mAlarmManager.cancel(mTimeoutIntent);
// do this before releasing wakelock
native_cleanup();
mGnssMeasurementsProvider.onGpsEnabledChanged();
mGnssNavigationMessageProvider.onGpsEnabledChanged();
}
use of android.os.WorkSource in project android_frameworks_base by AOSPA.
the class PackageDexOptimizer method performDexOpt.
/**
* Performs dexopt on all code paths and libraries of the specified package for specified
* instruction sets.
*
* <p>Calls to {@link com.android.server.pm.Installer#dexopt} on {@link #mInstaller} are
* synchronized on {@link #mInstallLock}.
*/
int performDexOpt(PackageParser.Package pkg, String[] sharedLibraries, String[] instructionSets, boolean checkProfiles, String targetCompilationFilter, CompilerStats.PackageStats packageStats) {
synchronized (mInstallLock) {
final boolean useLock = mSystemReady;
if (useLock) {
mDexoptWakeLock.setWorkSource(new WorkSource(pkg.applicationInfo.uid));
mDexoptWakeLock.acquire();
}
try {
return performDexOptLI(pkg, sharedLibraries, instructionSets, checkProfiles, targetCompilationFilter, packageStats);
} finally {
if (useLock) {
mDexoptWakeLock.release();
}
}
}
}
use of android.os.WorkSource in project platform_frameworks_base by android.
the class WindowState method pokeDrawLockLw.
public void pokeDrawLockLw(long timeout) {
if (isVisibleOrAdding()) {
if (mDrawLock == null) {
// We want the tag name to be somewhat stable so that it is easier to correlate
// in wake lock statistics. So in particular, we don't want to include the
// window's hash code as in toString().
final CharSequence tag = getWindowTag();
mDrawLock = mService.mPowerManager.newWakeLock(PowerManager.DRAW_WAKE_LOCK, "Window:" + tag);
mDrawLock.setReferenceCounted(false);
mDrawLock.setWorkSource(new WorkSource(mOwnerUid, mAttrs.packageName));
}
// Each call to acquire resets the timeout.
if (DEBUG_POWER) {
Slog.d(TAG, "pokeDrawLock: poking draw lock on behalf of visible window owned by " + mAttrs.packageName);
}
mDrawLock.acquire(timeout);
} else if (DEBUG_POWER) {
Slog.d(TAG, "pokeDrawLock: suppressed draw lock request for invisible window " + "owned by " + mAttrs.packageName);
}
}
Aggregations