Loading core/java/android/content/ContentResolver.java +1 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,7 @@ import java.util.concurrent.atomic.AtomicBoolean; * <p>For more information about using a ContentResolver with content providers, read the * <a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a> * developer guide.</p> * </div> */ public abstract class ContentResolver { /** Loading core/java/android/content/pm/RegisteredServicesCache.java +39 −20 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.content.pm; import android.Manifest; import android.annotation.Nullable; import android.annotation.UnsupportedAppUsage; import android.content.BroadcastReceiver; import android.content.ComponentName; Loading Loading @@ -176,7 +177,8 @@ public abstract class RegisteredServicesCache<V> { mContext.registerReceiver(mUserRemovedReceiver, userFilter); } private final void handlePackageEvent(Intent intent, int userId) { @VisibleForTesting protected void handlePackageEvent(Intent intent, int userId) { // Don't regenerate the services map when the package is removed or its // ASEC container unmounted as a step in replacement. The subsequent // _ADDED / _AVAILABLE call will regenerate the map in the final state. Loading Loading @@ -238,6 +240,9 @@ public abstract class RegisteredServicesCache<V> { public void invalidateCache(int userId) { synchronized (mServicesLock) { if (DEBUG) { Slog.d(TAG, "invalidating cache for " + userId + " " + mInterfaceName); } final UserServices<V> user = findOrCreateUserLocked(userId); user.services = null; onServicesChangedLocked(userId); Loading Loading @@ -465,16 +470,37 @@ public abstract class RegisteredServicesCache<V> { * or null to assume that everything is affected. * @param userId the user for whom to update the services map. */ private void generateServicesMap(int[] changedUids, int userId) { private void generateServicesMap(@Nullable int[] changedUids, int userId) { if (DEBUG) { Slog.d(TAG, "generateServicesMap() for " + userId + ", changed UIDs = " + Arrays.toString(changedUids)); } synchronized (mServicesLock) { final UserServices<V> user = findOrCreateUserLocked(userId); final boolean cacheInvalid = user.services == null; if (cacheInvalid) { user.services = Maps.newHashMap(); } final ArrayList<ServiceInfo<V>> serviceInfos = new ArrayList<>(); final List<ResolveInfo> resolveInfos = queryIntentServices(userId); for (ResolveInfo resolveInfo : resolveInfos) { try { // when changedUids == null, we want to do a rescan of everything, this means // it's the initial scan, and containsUid will trivially return true // when changedUids != null, we got here because a package changed, but // invalidateCache could have been called (thus user.services == null), and we // should query from PackageManager again if (!cacheInvalid && !containsUid( changedUids, resolveInfo.serviceInfo.applicationInfo.uid)) { if (DEBUG) { Slog.d(TAG, "Skipping parseServiceInfo for " + resolveInfo); } continue; } ServiceInfo<V> info = parseServiceInfo(resolveInfo); if (info == null) { Log.w(TAG, "Unable to load service info " + resolveInfo.toString()); Loading @@ -486,13 +512,6 @@ public abstract class RegisteredServicesCache<V> { } } synchronized (mServicesLock) { final UserServices<V> user = findOrCreateUserLocked(userId); final boolean firstScan = user.services == null; if (firstScan) { user.services = Maps.newHashMap(); } StringBuilder changes = new StringBuilder(); boolean changed = false; for (ServiceInfo<V> info : serviceInfos) { Loading @@ -513,7 +532,7 @@ public abstract class RegisteredServicesCache<V> { changed = true; user.services.put(info.type, info); user.persistentServices.put(info.type, info.uid); if (!(user.mPersistentServicesFileDidNotExist && firstScan)) { if (!(user.mPersistentServicesFileDidNotExist && cacheInvalid)) { notifyListener(info.type, userId, false /* removed */); } } else if (previousUid == info.uid) { Loading core/java/android/os/Build.java +0 −2 Original line number Diff line number Diff line Loading @@ -233,8 +233,6 @@ public class Build { * increase when the hardware manufacturer provides an OTA update. * <p> * Possible values are defined in {@link Build.VERSION_CODES}. * * @see #FIRST_SDK_INT */ public static final int SDK_INT = SystemProperties.getInt( "ro.build.version.sdk", 0); Loading core/java/android/service/notification/ScheduleCalendar.java +2 −2 Original line number Diff line number Diff line Loading @@ -70,10 +70,10 @@ public class ScheduleCalendar { } // only allow alarms in the future if (nextAlarm > now) { // store earliest alarm if (mSchedule.nextAlarm == 0) { if (mSchedule.nextAlarm == 0 || mSchedule.nextAlarm < now) { mSchedule.nextAlarm = nextAlarm; } else { // store earliest alarm mSchedule.nextAlarm = Math.min(mSchedule.nextAlarm, nextAlarm); } } else if (mSchedule.nextAlarm < now) { Loading core/java/android/view/ViewRootImpl.java +14 −7 Original line number Diff line number Diff line Loading @@ -1378,6 +1378,9 @@ public final class ViewRootImpl implements ViewParent, } if (mStopped) { if (mSurfaceHolder != null) { notifySurfaceDestroyed(); } mSurface.release(); } } Loading Loading @@ -2252,13 +2255,7 @@ public final class ViewRootImpl implements ViewParent, } mIsCreating = false; } else if (hadSurface) { mSurfaceHolder.ungetCallbacks(); SurfaceHolder.Callback callbacks[] = mSurfaceHolder.getCallbacks(); if (callbacks != null) { for (SurfaceHolder.Callback c : callbacks) { c.surfaceDestroyed(mSurfaceHolder); } } notifySurfaceDestroyed(); mSurfaceHolder.mSurfaceLock.lock(); try { mSurfaceHolder.mSurface = new Surface(); Loading Loading @@ -2522,6 +2519,16 @@ public final class ViewRootImpl implements ViewParent, mIsInTraversal = false; } private void notifySurfaceDestroyed() { mSurfaceHolder.ungetCallbacks(); SurfaceHolder.Callback[] callbacks = mSurfaceHolder.getCallbacks(); if (callbacks != null) { for (SurfaceHolder.Callback c : callbacks) { c.surfaceDestroyed(mSurfaceHolder); } } } private void maybeHandleWindowMove(Rect frame) { // TODO: Well, we are checking whether the frame has changed similarly Loading Loading
core/java/android/content/ContentResolver.java +1 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,7 @@ import java.util.concurrent.atomic.AtomicBoolean; * <p>For more information about using a ContentResolver with content providers, read the * <a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a> * developer guide.</p> * </div> */ public abstract class ContentResolver { /** Loading
core/java/android/content/pm/RegisteredServicesCache.java +39 −20 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.content.pm; import android.Manifest; import android.annotation.Nullable; import android.annotation.UnsupportedAppUsage; import android.content.BroadcastReceiver; import android.content.ComponentName; Loading Loading @@ -176,7 +177,8 @@ public abstract class RegisteredServicesCache<V> { mContext.registerReceiver(mUserRemovedReceiver, userFilter); } private final void handlePackageEvent(Intent intent, int userId) { @VisibleForTesting protected void handlePackageEvent(Intent intent, int userId) { // Don't regenerate the services map when the package is removed or its // ASEC container unmounted as a step in replacement. The subsequent // _ADDED / _AVAILABLE call will regenerate the map in the final state. Loading Loading @@ -238,6 +240,9 @@ public abstract class RegisteredServicesCache<V> { public void invalidateCache(int userId) { synchronized (mServicesLock) { if (DEBUG) { Slog.d(TAG, "invalidating cache for " + userId + " " + mInterfaceName); } final UserServices<V> user = findOrCreateUserLocked(userId); user.services = null; onServicesChangedLocked(userId); Loading Loading @@ -465,16 +470,37 @@ public abstract class RegisteredServicesCache<V> { * or null to assume that everything is affected. * @param userId the user for whom to update the services map. */ private void generateServicesMap(int[] changedUids, int userId) { private void generateServicesMap(@Nullable int[] changedUids, int userId) { if (DEBUG) { Slog.d(TAG, "generateServicesMap() for " + userId + ", changed UIDs = " + Arrays.toString(changedUids)); } synchronized (mServicesLock) { final UserServices<V> user = findOrCreateUserLocked(userId); final boolean cacheInvalid = user.services == null; if (cacheInvalid) { user.services = Maps.newHashMap(); } final ArrayList<ServiceInfo<V>> serviceInfos = new ArrayList<>(); final List<ResolveInfo> resolveInfos = queryIntentServices(userId); for (ResolveInfo resolveInfo : resolveInfos) { try { // when changedUids == null, we want to do a rescan of everything, this means // it's the initial scan, and containsUid will trivially return true // when changedUids != null, we got here because a package changed, but // invalidateCache could have been called (thus user.services == null), and we // should query from PackageManager again if (!cacheInvalid && !containsUid( changedUids, resolveInfo.serviceInfo.applicationInfo.uid)) { if (DEBUG) { Slog.d(TAG, "Skipping parseServiceInfo for " + resolveInfo); } continue; } ServiceInfo<V> info = parseServiceInfo(resolveInfo); if (info == null) { Log.w(TAG, "Unable to load service info " + resolveInfo.toString()); Loading @@ -486,13 +512,6 @@ public abstract class RegisteredServicesCache<V> { } } synchronized (mServicesLock) { final UserServices<V> user = findOrCreateUserLocked(userId); final boolean firstScan = user.services == null; if (firstScan) { user.services = Maps.newHashMap(); } StringBuilder changes = new StringBuilder(); boolean changed = false; for (ServiceInfo<V> info : serviceInfos) { Loading @@ -513,7 +532,7 @@ public abstract class RegisteredServicesCache<V> { changed = true; user.services.put(info.type, info); user.persistentServices.put(info.type, info.uid); if (!(user.mPersistentServicesFileDidNotExist && firstScan)) { if (!(user.mPersistentServicesFileDidNotExist && cacheInvalid)) { notifyListener(info.type, userId, false /* removed */); } } else if (previousUid == info.uid) { Loading
core/java/android/os/Build.java +0 −2 Original line number Diff line number Diff line Loading @@ -233,8 +233,6 @@ public class Build { * increase when the hardware manufacturer provides an OTA update. * <p> * Possible values are defined in {@link Build.VERSION_CODES}. * * @see #FIRST_SDK_INT */ public static final int SDK_INT = SystemProperties.getInt( "ro.build.version.sdk", 0); Loading
core/java/android/service/notification/ScheduleCalendar.java +2 −2 Original line number Diff line number Diff line Loading @@ -70,10 +70,10 @@ public class ScheduleCalendar { } // only allow alarms in the future if (nextAlarm > now) { // store earliest alarm if (mSchedule.nextAlarm == 0) { if (mSchedule.nextAlarm == 0 || mSchedule.nextAlarm < now) { mSchedule.nextAlarm = nextAlarm; } else { // store earliest alarm mSchedule.nextAlarm = Math.min(mSchedule.nextAlarm, nextAlarm); } } else if (mSchedule.nextAlarm < now) { Loading
core/java/android/view/ViewRootImpl.java +14 −7 Original line number Diff line number Diff line Loading @@ -1378,6 +1378,9 @@ public final class ViewRootImpl implements ViewParent, } if (mStopped) { if (mSurfaceHolder != null) { notifySurfaceDestroyed(); } mSurface.release(); } } Loading Loading @@ -2252,13 +2255,7 @@ public final class ViewRootImpl implements ViewParent, } mIsCreating = false; } else if (hadSurface) { mSurfaceHolder.ungetCallbacks(); SurfaceHolder.Callback callbacks[] = mSurfaceHolder.getCallbacks(); if (callbacks != null) { for (SurfaceHolder.Callback c : callbacks) { c.surfaceDestroyed(mSurfaceHolder); } } notifySurfaceDestroyed(); mSurfaceHolder.mSurfaceLock.lock(); try { mSurfaceHolder.mSurface = new Surface(); Loading Loading @@ -2522,6 +2519,16 @@ public final class ViewRootImpl implements ViewParent, mIsInTraversal = false; } private void notifySurfaceDestroyed() { mSurfaceHolder.ungetCallbacks(); SurfaceHolder.Callback[] callbacks = mSurfaceHolder.getCallbacks(); if (callbacks != null) { for (SurfaceHolder.Callback c : callbacks) { c.surfaceDestroyed(mSurfaceHolder); } } } private void maybeHandleWindowMove(Rect frame) { // TODO: Well, we are checking whether the frame has changed similarly Loading