Merge "Merge "Give hidden API behavior to legacy apps." into rvc-dev am: a7a96ad6f8 am: 314eb8f16b" into rvc-d1-dev-plus-aosp am: 059370c6f9
Change-Id: I4a44989ab335c4743173b6d3de5184b62473b4a5
This commit is contained in:
@@ -9881,7 +9881,7 @@ package android.content {
|
|||||||
method public void notifyChange(@NonNull android.net.Uri, @Nullable android.database.ContentObserver);
|
method public void notifyChange(@NonNull android.net.Uri, @Nullable android.database.ContentObserver);
|
||||||
method @Deprecated public void notifyChange(@NonNull android.net.Uri, @Nullable android.database.ContentObserver, boolean);
|
method @Deprecated public void notifyChange(@NonNull android.net.Uri, @Nullable android.database.ContentObserver, boolean);
|
||||||
method public void notifyChange(@NonNull android.net.Uri, @Nullable android.database.ContentObserver, int);
|
method public void notifyChange(@NonNull android.net.Uri, @Nullable android.database.ContentObserver, int);
|
||||||
method public void notifyChange(@NonNull Iterable<android.net.Uri>, @Nullable android.database.ContentObserver, int);
|
method public void notifyChange(@NonNull java.util.Collection<android.net.Uri>, @Nullable android.database.ContentObserver, int);
|
||||||
method @Nullable public final android.content.res.AssetFileDescriptor openAssetFile(@NonNull android.net.Uri, @NonNull String, @Nullable android.os.CancellationSignal) throws java.io.FileNotFoundException;
|
method @Nullable public final android.content.res.AssetFileDescriptor openAssetFile(@NonNull android.net.Uri, @NonNull String, @Nullable android.os.CancellationSignal) throws java.io.FileNotFoundException;
|
||||||
method @Nullable public final android.content.res.AssetFileDescriptor openAssetFileDescriptor(@NonNull android.net.Uri, @NonNull String) throws java.io.FileNotFoundException;
|
method @Nullable public final android.content.res.AssetFileDescriptor openAssetFileDescriptor(@NonNull android.net.Uri, @NonNull String) throws java.io.FileNotFoundException;
|
||||||
method @Nullable public final android.content.res.AssetFileDescriptor openAssetFileDescriptor(@NonNull android.net.Uri, @NonNull String, @Nullable android.os.CancellationSignal) throws java.io.FileNotFoundException;
|
method @Nullable public final android.content.res.AssetFileDescriptor openAssetFileDescriptor(@NonNull android.net.Uri, @NonNull String, @Nullable android.os.CancellationSignal) throws java.io.FileNotFoundException;
|
||||||
@@ -12972,11 +12972,11 @@ package android.database {
|
|||||||
method @Deprecated public final void dispatchChange(boolean);
|
method @Deprecated public final void dispatchChange(boolean);
|
||||||
method public final void dispatchChange(boolean, @Nullable android.net.Uri);
|
method public final void dispatchChange(boolean, @Nullable android.net.Uri);
|
||||||
method public final void dispatchChange(boolean, @Nullable android.net.Uri, int);
|
method public final void dispatchChange(boolean, @Nullable android.net.Uri, int);
|
||||||
method public final void dispatchChange(boolean, @NonNull Iterable<android.net.Uri>, int);
|
method public final void dispatchChange(boolean, @NonNull java.util.Collection<android.net.Uri>, int);
|
||||||
method public void onChange(boolean);
|
method public void onChange(boolean);
|
||||||
method public void onChange(boolean, @Nullable android.net.Uri);
|
method public void onChange(boolean, @Nullable android.net.Uri);
|
||||||
method public void onChange(boolean, @Nullable android.net.Uri, int);
|
method public void onChange(boolean, @Nullable android.net.Uri, int);
|
||||||
method public void onChange(boolean, @NonNull Iterable<android.net.Uri>, int);
|
method public void onChange(boolean, @NonNull java.util.Collection<android.net.Uri>, int);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface CrossProcessCursor extends android.database.Cursor {
|
public interface CrossProcessCursor extends android.database.Cursor {
|
||||||
|
|||||||
@@ -69,6 +69,10 @@ package android.app.usage {
|
|||||||
|
|
||||||
package android.content {
|
package android.content {
|
||||||
|
|
||||||
|
public abstract class ContentResolver {
|
||||||
|
method @Deprecated public void notifyChange(@NonNull Iterable<android.net.Uri>, @Nullable android.database.ContentObserver, int);
|
||||||
|
}
|
||||||
|
|
||||||
public abstract class Context {
|
public abstract class Context {
|
||||||
method public abstract android.content.SharedPreferences getSharedPreferences(java.io.File, int);
|
method public abstract android.content.SharedPreferences getSharedPreferences(java.io.File, int);
|
||||||
method public abstract java.io.File getSharedPreferencesPath(String);
|
method public abstract java.io.File getSharedPreferencesPath(String);
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ import java.io.OutputStream;
|
|||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
@@ -2670,6 +2671,15 @@ public abstract class ContentResolver implements ContentInterface {
|
|||||||
ContentProvider.getUserIdFromUri(uri, mContext.getUserId()));
|
ContentProvider.getUserIdFromUri(uri, mContext.getUserId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @removed */
|
||||||
|
@Deprecated
|
||||||
|
public void notifyChange(@NonNull Iterable<Uri> uris, @Nullable ContentObserver observer,
|
||||||
|
@NotifyFlags int flags) {
|
||||||
|
final Collection<Uri> asCollection = new ArrayList<>();
|
||||||
|
uris.forEach(asCollection::add);
|
||||||
|
notifyChange(asCollection, observer, flags);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notify registered observers that several rows have been updated.
|
* Notify registered observers that several rows have been updated.
|
||||||
* <p>
|
* <p>
|
||||||
@@ -2694,7 +2704,7 @@ public abstract class ContentResolver implements ContentInterface {
|
|||||||
* @param flags Flags such as {@link #NOTIFY_SYNC_TO_NETWORK} or
|
* @param flags Flags such as {@link #NOTIFY_SYNC_TO_NETWORK} or
|
||||||
* {@link #NOTIFY_SKIP_NOTIFY_FOR_DESCENDANTS}.
|
* {@link #NOTIFY_SKIP_NOTIFY_FOR_DESCENDANTS}.
|
||||||
*/
|
*/
|
||||||
public void notifyChange(@NonNull Iterable<Uri> uris, @Nullable ContentObserver observer,
|
public void notifyChange(@NonNull Collection<Uri> uris, @Nullable ContentObserver observer,
|
||||||
@NotifyFlags int flags) {
|
@NotifyFlags int flags) {
|
||||||
Objects.requireNonNull(uris, "uris");
|
Objects.requireNonNull(uris, "uris");
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ package android.database;
|
|||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
import android.annotation.UserIdInt;
|
import android.annotation.UserIdInt;
|
||||||
|
import android.app.compat.CompatChanges;
|
||||||
|
import android.compat.annotation.ChangeId;
|
||||||
|
import android.compat.annotation.EnabledAfter;
|
||||||
import android.compat.annotation.UnsupportedAppUsage;
|
import android.compat.annotation.UnsupportedAppUsage;
|
||||||
import android.content.ContentResolver.NotifyFlags;
|
import android.content.ContentResolver.NotifyFlags;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
@@ -26,12 +29,26 @@ import android.os.Handler;
|
|||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Receives call backs for changes to content.
|
* Receives call backs for changes to content.
|
||||||
* Must be implemented by objects which are added to a {@link ContentObservable}.
|
* Must be implemented by objects which are added to a {@link ContentObservable}.
|
||||||
*/
|
*/
|
||||||
public abstract class ContentObserver {
|
public abstract class ContentObserver {
|
||||||
|
/**
|
||||||
|
* Starting in {@link android.os.Build.VERSION_CODES#R}, there is a new
|
||||||
|
* public API overload {@link #onChange(boolean, Uri, int)} that delivers a
|
||||||
|
* {@code int flags} argument.
|
||||||
|
* <p>
|
||||||
|
* Some apps may be relying on a previous hidden API that delivered a
|
||||||
|
* {@code int userId} argument, and this change is used to control delivery
|
||||||
|
* of the new {@code int flags} argument in its place.
|
||||||
|
*/
|
||||||
|
@ChangeId
|
||||||
|
@EnabledAfter(targetSdkVersion=android.os.Build.VERSION_CODES.Q)
|
||||||
|
private static final long ADD_CONTENT_OBSERVER_FLAGS = 150939131L;
|
||||||
|
|
||||||
private final Object mLock = new Object();
|
private final Object mLock = new Object();
|
||||||
private Transport mTransport; // guarded by mLock
|
private Transport mTransport; // guarded by mLock
|
||||||
|
|
||||||
@@ -164,16 +181,26 @@ public abstract class ContentObserver {
|
|||||||
* @param uris The Uris of the changed content.
|
* @param uris The Uris of the changed content.
|
||||||
* @param flags Flags indicating details about this change.
|
* @param flags Flags indicating details about this change.
|
||||||
*/
|
*/
|
||||||
public void onChange(boolean selfChange, @NonNull Iterable<Uri> uris, @NotifyFlags int flags) {
|
public void onChange(boolean selfChange, @NonNull Collection<Uri> uris,
|
||||||
|
@NotifyFlags int flags) {
|
||||||
for (Uri uri : uris) {
|
for (Uri uri : uris) {
|
||||||
onChange(selfChange, uri, flags);
|
onChange(selfChange, uri, flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
public void onChange(boolean selfChange, @NonNull Iterable<Uri> uris, @NotifyFlags int flags,
|
public void onChange(boolean selfChange, @NonNull Collection<Uri> uris,
|
||||||
@UserIdInt int userId) {
|
@NotifyFlags int flags, @UserIdInt int userId) {
|
||||||
onChange(selfChange, uris, flags);
|
// There are dozens of people relying on the hidden API inside the
|
||||||
|
// system UID, so hard-code the old behavior for all of them; for
|
||||||
|
// everyone else we gate based on a specific change
|
||||||
|
if (!CompatChanges.isChangeEnabled(ADD_CONTENT_OBSERVER_FLAGS)
|
||||||
|
|| android.os.Process.myUid() == android.os.Process.SYSTEM_UID) {
|
||||||
|
// Deliver userId through argument to preserve hidden API behavior
|
||||||
|
onChange(selfChange, uris, userId);
|
||||||
|
} else {
|
||||||
|
onChange(selfChange, uris, flags);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -186,7 +213,7 @@ public abstract class ContentObserver {
|
|||||||
*
|
*
|
||||||
* @deprecated Callers should migrate towards using a richer overload that
|
* @deprecated Callers should migrate towards using a richer overload that
|
||||||
* provides more details about the change, such as
|
* provides more details about the change, such as
|
||||||
* {@link #dispatchChange(boolean, Iterable, int)}.
|
* {@link #dispatchChange(boolean, Collection, int)}.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public final void dispatchChange(boolean selfChange) {
|
public final void dispatchChange(boolean selfChange) {
|
||||||
@@ -206,7 +233,7 @@ public abstract class ContentObserver {
|
|||||||
* @param uri The Uri of the changed content.
|
* @param uri The Uri of the changed content.
|
||||||
*/
|
*/
|
||||||
public final void dispatchChange(boolean selfChange, @Nullable Uri uri) {
|
public final void dispatchChange(boolean selfChange, @Nullable Uri uri) {
|
||||||
dispatchChange(selfChange, Arrays.asList(uri), 0, UserHandle.getCallingUserId());
|
dispatchChange(selfChange, uri, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -224,7 +251,7 @@ public abstract class ContentObserver {
|
|||||||
*/
|
*/
|
||||||
public final void dispatchChange(boolean selfChange, @Nullable Uri uri,
|
public final void dispatchChange(boolean selfChange, @Nullable Uri uri,
|
||||||
@NotifyFlags int flags) {
|
@NotifyFlags int flags) {
|
||||||
dispatchChange(selfChange, Arrays.asList(uri), flags, UserHandle.getCallingUserId());
|
dispatchChange(selfChange, Arrays.asList(uri), flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -240,13 +267,13 @@ public abstract class ContentObserver {
|
|||||||
* @param uris The Uri of the changed content.
|
* @param uris The Uri of the changed content.
|
||||||
* @param flags Flags indicating details about this change.
|
* @param flags Flags indicating details about this change.
|
||||||
*/
|
*/
|
||||||
public final void dispatchChange(boolean selfChange, @NonNull Iterable<Uri> uris,
|
public final void dispatchChange(boolean selfChange, @NonNull Collection<Uri> uris,
|
||||||
@NotifyFlags int flags) {
|
@NotifyFlags int flags) {
|
||||||
dispatchChange(selfChange, uris, flags, UserHandle.getCallingUserId());
|
dispatchChange(selfChange, uris, flags, UserHandle.getCallingUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
public final void dispatchChange(boolean selfChange, @NonNull Iterable<Uri> uris,
|
public final void dispatchChange(boolean selfChange, @NonNull Collection<Uri> uris,
|
||||||
@NotifyFlags int flags, @UserIdInt int userId) {
|
@NotifyFlags int flags, @UserIdInt int userId) {
|
||||||
if (mHandler == null) {
|
if (mHandler == null) {
|
||||||
onChange(selfChange, uris, flags, userId);
|
onChange(selfChange, uris, flags, userId);
|
||||||
|
|||||||
@@ -20,10 +20,12 @@ import android.annotation.NonNull;
|
|||||||
import android.annotation.UserIdInt;
|
import android.annotation.UserIdInt;
|
||||||
import android.content.ContentResolver.NotifyFlags;
|
import android.content.ContentResolver.NotifyFlags;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.*;
|
import android.os.Bundle;
|
||||||
|
import android.os.IBinder;
|
||||||
|
import android.os.RemoteException;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wraps a BulkCursor around an existing Cursor making it remotable.
|
* Wraps a BulkCursor around an existing Cursor making it remotable.
|
||||||
@@ -81,7 +83,7 @@ public final class CursorToBulkCursorAdaptor extends BulkCursorNative
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onChange(boolean selfChange, @NonNull Iterable<Uri> uris,
|
public void onChange(boolean selfChange, @NonNull Collection<Uri> uris,
|
||||||
@NotifyFlags int flags, @UserIdInt int userId) {
|
@NotifyFlags int flags, @UserIdInt int userId) {
|
||||||
// Since we deliver changes from the most-specific to least-specific
|
// Since we deliver changes from the most-specific to least-specific
|
||||||
// overloads, we only need to redirect from the most-specific local
|
// overloads, we only need to redirect from the most-specific local
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ import com.android.internal.util.function.pooled.PooledLambda;
|
|||||||
|
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
@@ -133,7 +134,7 @@ public class AccessibilityShortcutController {
|
|||||||
// Keep track of state of shortcut settings
|
// Keep track of state of shortcut settings
|
||||||
final ContentObserver co = new ContentObserver(handler) {
|
final ContentObserver co = new ContentObserver(handler) {
|
||||||
@Override
|
@Override
|
||||||
public void onChange(boolean selfChange, Uri uri, int userId) {
|
public void onChange(boolean selfChange, Collection<Uri> uris, int flags, int userId) {
|
||||||
if (userId == mUserId) {
|
if (userId == mUserId) {
|
||||||
onSettingsChanged();
|
onSettingsChanged();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import android.util.Slog;
|
|||||||
import com.android.internal.annotations.VisibleForTesting;
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
@@ -99,7 +100,7 @@ public class KernelCpuThreadReaderSettingsObserver extends ContentObserver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onChange(boolean selfChange, Uri uri, int userId) {
|
public void onChange(boolean selfChange, Collection<Uri> uris, int flags, int userId) {
|
||||||
updateReader();
|
updateReader();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import android.provider.Settings;
|
|||||||
import android.service.notification.StatusBarNotification;
|
import android.service.notification.StatusBarNotification;
|
||||||
import android.util.ArrayMap;
|
import android.util.ArrayMap;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -77,8 +78,8 @@ public class NotificationMessagingUtil {
|
|||||||
private final ContentObserver mSmsContentObserver = new ContentObserver(
|
private final ContentObserver mSmsContentObserver = new ContentObserver(
|
||||||
new Handler(Looper.getMainLooper())) {
|
new Handler(Looper.getMainLooper())) {
|
||||||
@Override
|
@Override
|
||||||
public void onChange(boolean selfChange, Uri uri, int userId) {
|
public void onChange(boolean selfChange, Collection<Uri> uris, int flags, int userId) {
|
||||||
if (Settings.Secure.getUriFor(DEFAULT_SMS_APP_SETTING).equals(uri)) {
|
if (uris.contains(Settings.Secure.getUriFor(DEFAULT_SMS_APP_SETTING))) {
|
||||||
cacheDefaultSmsApp(userId);
|
cacheDefaultSmsApp(userId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@@ -194,8 +195,8 @@ abstract class AbstractCrossUserContentResolverTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onChange(boolean selfChange, Uri uri, int userId) {
|
public void onChange(boolean selfChange, Collection<Uri> uris, int flags, int userId) {
|
||||||
if (mExpectedUri.equals(uri) && mExpectedUserId == userId) {
|
if (uris.contains(mExpectedUri) && mExpectedUserId == userId) {
|
||||||
mLatch.countDown();
|
mLatch.countDown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ import com.android.systemui.shared.plugins.PluginManager;
|
|||||||
import com.android.systemui.util.InjectionInflationController;
|
import com.android.systemui.util.InjectionInflationController;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -74,8 +75,8 @@ public final class ClockManager {
|
|||||||
private final ContentObserver mContentObserver =
|
private final ContentObserver mContentObserver =
|
||||||
new ContentObserver(mMainHandler) {
|
new ContentObserver(mMainHandler) {
|
||||||
@Override
|
@Override
|
||||||
public void onChange(boolean selfChange, Uri uri, int userId) {
|
public void onChange(boolean selfChange, Collection<Uri> uris,
|
||||||
super.onChange(selfChange, uri, userId);
|
int flags, int userId) {
|
||||||
if (Objects.equals(userId,
|
if (Objects.equals(userId,
|
||||||
mCurrentUserObservable.getCurrentUser().getValue())) {
|
mCurrentUserObservable.getCurrentUser().getValue())) {
|
||||||
reload();
|
reload();
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ class ControlsControllerImpl @Inject constructor (
|
|||||||
internal val settingObserver = object : ContentObserver(null) {
|
internal val settingObserver = object : ContentObserver(null) {
|
||||||
override fun onChange(
|
override fun onChange(
|
||||||
selfChange: Boolean,
|
selfChange: Boolean,
|
||||||
uris: MutableIterable<Uri>,
|
uris: Collection<Uri>,
|
||||||
flags: Int,
|
flags: Int,
|
||||||
userId: Int
|
userId: Int
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ import com.android.systemui.util.sensors.ProximitySensor;
|
|||||||
import com.android.systemui.util.wakelock.WakeLock;
|
import com.android.systemui.util.wakelock.WakeLock;
|
||||||
|
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
@@ -261,7 +262,7 @@ public class DozeSensors {
|
|||||||
|
|
||||||
private final ContentObserver mSettingsObserver = new ContentObserver(mHandler) {
|
private final ContentObserver mSettingsObserver = new ContentObserver(mHandler) {
|
||||||
@Override
|
@Override
|
||||||
public void onChange(boolean selfChange, Iterable<Uri> uris, int flags, int userId) {
|
public void onChange(boolean selfChange, Collection<Uri> uris, int flags, int userId) {
|
||||||
if (userId != ActivityManager.getCurrentUser()) {
|
if (userId != ActivityManager.getCurrentUser()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ import com.google.android.collect.Sets;
|
|||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -101,7 +102,7 @@ public class ThemeOverlayController extends SystemUI {
|
|||||||
new ContentObserver(mBgHandler) {
|
new ContentObserver(mBgHandler) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onChange(boolean selfChange, Iterable<Uri> uris, int flags,
|
public void onChange(boolean selfChange, Collection<Uri> uris, int flags,
|
||||||
int userId) {
|
int userId) {
|
||||||
if (DEBUG) Log.d(TAG, "Overlay changed for user: " + userId);
|
if (DEBUG) Log.d(TAG, "Overlay changed for user: " + userId);
|
||||||
if (ActivityManager.getCurrentUser() == userId) {
|
if (ActivityManager.getCurrentUser() == userId) {
|
||||||
|
|||||||
@@ -262,7 +262,8 @@ public class TunerServiceImpl extends TunerService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onChange(boolean selfChange, Iterable<Uri> uris, int flags, int userId) {
|
public void onChange(boolean selfChange, java.util.Collection<Uri> uris,
|
||||||
|
int flags, int userId) {
|
||||||
if (userId == ActivityManager.getCurrentUser()) {
|
if (userId == ActivityManager.getCurrentUser()) {
|
||||||
for (Uri u : uris) {
|
for (Uri u : uris) {
|
||||||
reloadSetting(u);
|
reloadSetting(u);
|
||||||
|
|||||||
@@ -288,6 +288,7 @@ import java.lang.ref.WeakReference;
|
|||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -680,7 +681,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onChange(boolean selfChange, Iterable<Uri> uris, int flags,
|
public void onChange(boolean selfChange, Collection<Uri> uris, int flags,
|
||||||
@UserIdInt int userId) {
|
@UserIdInt int userId) {
|
||||||
for (Uri uri : uris) {
|
for (Uri uri : uris) {
|
||||||
if (mFontScaleUri.equals(uri)) {
|
if (mFontScaleUri.equals(uri)) {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import android.content.IContentProvider;
|
|||||||
import android.database.ContentObserver;
|
import android.database.ContentObserver;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -172,7 +173,7 @@ public class MockContentResolver extends ContentResolver {
|
|||||||
* from observers elsewhere in the system.
|
* from observers elsewhere in the system.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void notifyChange(@NonNull Iterable<Uri> uris, @Nullable ContentObserver observer,
|
public void notifyChange(@NonNull Collection<Uri> uris, @Nullable ContentObserver observer,
|
||||||
@NotifyFlags int flags) {
|
@NotifyFlags int flags) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user