[Fix settings] Multi user for settings wrapper
Audit and fix SettingsProxy usages to account for multiple users. Note that this does not fix any Settings usages that does not use SettingsProxy. There maybe be outstanding files to change, but from a glance, most of the usages seem to be user aware. Bug: 226391543 Test: Manual and fixed unit tests Change-Id: Ia8ff59fe55049cc79ac73237087d3aaca2cbb3b3
This commit is contained in:
@@ -25,6 +25,7 @@ import static com.android.keyguard.KeyguardClockSwitch.SMALL;
|
|||||||
import android.app.WallpaperManager;
|
import android.app.WallpaperManager;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.database.ContentObserver;
|
import android.database.ContentObserver;
|
||||||
|
import android.os.UserHandle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -264,10 +265,11 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
|
|||||||
mKeyguardUnlockAnimationController.setLockscreenSmartspace(mSmartspaceView);
|
mKeyguardUnlockAnimationController.setLockscreenSmartspace(mSmartspaceView);
|
||||||
}
|
}
|
||||||
|
|
||||||
mSecureSettings.registerContentObserver(
|
mSecureSettings.registerContentObserverForUser(
|
||||||
Settings.Secure.getUriFor(Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK),
|
Settings.Secure.getUriFor(Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK),
|
||||||
false, /* notifyForDescendants */
|
false, /* notifyForDescendants */
|
||||||
mDoubleLineClockObserver
|
mDoubleLineClockObserver,
|
||||||
|
UserHandle.USER_ALL
|
||||||
);
|
);
|
||||||
|
|
||||||
updateDoubleLineClock();
|
updateDoubleLineClock();
|
||||||
@@ -476,8 +478,9 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateDoubleLineClock() {
|
private void updateDoubleLineClock() {
|
||||||
mCanShowDoubleLineClock = mSecureSettings.getInt(
|
mCanShowDoubleLineClock = mSecureSettings.getIntForUser(
|
||||||
Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK, 1) != 0;
|
Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK, 1,
|
||||||
|
UserHandle.USER_CURRENT) != 0;
|
||||||
|
|
||||||
if (!mCanShowDoubleLineClock) {
|
if (!mCanShowDoubleLineClock) {
|
||||||
mUiExecutor.execute(() -> displayClock(KeyguardClockSwitch.SMALL, /* animate */ true));
|
mUiExecutor.execute(() -> displayClock(KeyguardClockSwitch.SMALL, /* animate */ true));
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package com.android.systemui.controls.dagger
|
|||||||
import android.content.ContentResolver
|
import android.content.ContentResolver
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.database.ContentObserver
|
import android.database.ContentObserver
|
||||||
|
import android.os.UserHandle
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
import com.android.systemui.controls.controller.ControlsController
|
import com.android.systemui.controls.controller.ControlsController
|
||||||
import com.android.systemui.controls.management.ControlsListingController
|
import com.android.systemui.controls.management.ControlsListingController
|
||||||
@@ -73,10 +74,11 @@ class ControlsComponent @Inject constructor(
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
if (featureEnabled) {
|
if (featureEnabled) {
|
||||||
secureSettings.registerContentObserver(
|
secureSettings.registerContentObserverForUser(
|
||||||
Settings.Secure.getUriFor(Settings.Secure.LOCKSCREEN_SHOW_CONTROLS),
|
Settings.Secure.getUriFor(Settings.Secure.LOCKSCREEN_SHOW_CONTROLS),
|
||||||
false, /* notifyForDescendants */
|
false, /* notifyForDescendants */
|
||||||
showWhileLockedObserver
|
showWhileLockedObserver,
|
||||||
|
UserHandle.USER_ALL
|
||||||
)
|
)
|
||||||
updateShowWhileLocked()
|
updateShowWhileLocked()
|
||||||
}
|
}
|
||||||
@@ -123,8 +125,8 @@ class ControlsComponent @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun updateShowWhileLocked() {
|
private fun updateShowWhileLocked() {
|
||||||
canShowWhileLockedSetting = secureSettings.getInt(
|
canShowWhileLockedSetting = secureSettings.getIntForUser(
|
||||||
Settings.Secure.LOCKSCREEN_SHOW_CONTROLS, 0) != 0
|
Settings.Secure.LOCKSCREEN_SHOW_CONTROLS, 0, UserHandle.USER_CURRENT) != 0
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class Visibility {
|
enum class Visibility {
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import android.content.pm.ResolveInfo
|
|||||||
import android.database.ContentObserver
|
import android.database.ContentObserver
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
|
import android.os.UserHandle
|
||||||
import android.os.VibrationEffect
|
import android.os.VibrationEffect
|
||||||
import android.provider.Settings.Secure
|
import android.provider.Settings.Secure
|
||||||
import android.service.controls.Control
|
import android.service.controls.Control
|
||||||
@@ -74,10 +75,10 @@ class ControlActionCoordinatorImpl @Inject constructor(
|
|||||||
private var actionsInProgress = mutableSetOf<String>()
|
private var actionsInProgress = mutableSetOf<String>()
|
||||||
private val isLocked: Boolean
|
private val isLocked: Boolean
|
||||||
get() = !keyguardStateController.isUnlocked()
|
get() = !keyguardStateController.isUnlocked()
|
||||||
private var mAllowTrivialControls: Boolean = secureSettings.getInt(
|
private var mAllowTrivialControls: Boolean = secureSettings.getIntForUser(
|
||||||
Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 0) != 0
|
Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 0, UserHandle.USER_CURRENT) != 0
|
||||||
private var mShowDeviceControlsInLockscreen: Boolean = secureSettings.getInt(
|
private var mShowDeviceControlsInLockscreen: Boolean = secureSettings.getIntForUser(
|
||||||
Secure.LOCKSCREEN_SHOW_CONTROLS, 0) != 0
|
Secure.LOCKSCREEN_SHOW_CONTROLS, 0, UserHandle.USER_CURRENT) != 0
|
||||||
override lateinit var activityContext: Context
|
override lateinit var activityContext: Context
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@@ -95,23 +96,25 @@ class ControlActionCoordinatorImpl @Inject constructor(
|
|||||||
super.onChange(selfChange, uri)
|
super.onChange(selfChange, uri)
|
||||||
when (uri) {
|
when (uri) {
|
||||||
lockScreenShowControlsUri -> {
|
lockScreenShowControlsUri -> {
|
||||||
mAllowTrivialControls = secureSettings.getInt(
|
mAllowTrivialControls = secureSettings.getIntForUser(
|
||||||
Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 0) != 0
|
Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS,
|
||||||
|
0, UserHandle.USER_CURRENT) != 0
|
||||||
}
|
}
|
||||||
showControlsUri -> {
|
showControlsUri -> {
|
||||||
mShowDeviceControlsInLockscreen = secureSettings
|
mShowDeviceControlsInLockscreen = secureSettings
|
||||||
.getInt(Secure.LOCKSCREEN_SHOW_CONTROLS, 0) != 0
|
.getIntForUser(Secure.LOCKSCREEN_SHOW_CONTROLS,
|
||||||
|
0, UserHandle.USER_CURRENT) != 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
secureSettings.registerContentObserver(
|
secureSettings.registerContentObserverForUser(
|
||||||
lockScreenShowControlsUri,
|
lockScreenShowControlsUri,
|
||||||
false /* notifyForDescendants */, controlsContentObserver
|
false /* notifyForDescendants */, controlsContentObserver, UserHandle.USER_ALL
|
||||||
)
|
)
|
||||||
secureSettings.registerContentObserver(
|
secureSettings.registerContentObserverForUser(
|
||||||
showControlsUri,
|
showControlsUri,
|
||||||
false /* notifyForDescendants */, controlsContentObserver
|
false /* notifyForDescendants */, controlsContentObserver, UserHandle.USER_ALL
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -311,7 +314,8 @@ class ControlActionCoordinatorImpl @Inject constructor(
|
|||||||
MAX_NUMBER_ATTEMPTS_CONTROLS_DIALOG)
|
MAX_NUMBER_ATTEMPTS_CONTROLS_DIALOG)
|
||||||
.commit()
|
.commit()
|
||||||
}
|
}
|
||||||
secureSettings.putInt(Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 1)
|
secureSettings.putIntForUser(Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 1,
|
||||||
|
UserHandle.USER_CURRENT)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
.create()
|
.create()
|
||||||
@@ -325,8 +329,10 @@ class ControlActionCoordinatorImpl @Inject constructor(
|
|||||||
MAX_NUMBER_ATTEMPTS_CONTROLS_DIALOG)
|
MAX_NUMBER_ATTEMPTS_CONTROLS_DIALOG)
|
||||||
.commit()
|
.commit()
|
||||||
}
|
}
|
||||||
secureSettings.putInt(Secure.LOCKSCREEN_SHOW_CONTROLS, 1)
|
secureSettings.putIntForUser(Secure.LOCKSCREEN_SHOW_CONTROLS,
|
||||||
secureSettings.putInt(Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 1)
|
1, UserHandle.USER_CURRENT)
|
||||||
|
secureSettings.putIntForUser(Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS,
|
||||||
|
1, UserHandle.USER_CURRENT)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
.create()
|
.create()
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import android.content.IntentFilter;
|
|||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
|
import android.os.UserHandle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
@@ -210,7 +211,8 @@ public class FeatureFlagsDebug implements FeatureFlags, Dumpable {
|
|||||||
Log.w(TAG, "Failed to set id " + id + " to " + value);
|
Log.w(TAG, "Failed to set id " + id + " to " + value);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mSecureSettings.putString(mFlagManager.idToSettingsKey(id), data);
|
mSecureSettings.putStringForUser(mFlagManager.idToSettingsKey(id), data,
|
||||||
|
UserHandle.USER_CURRENT);
|
||||||
Log.i(TAG, "Set id " + id + " to " + value);
|
Log.i(TAG, "Set id " + id + " to " + value);
|
||||||
removeFromCache(id);
|
removeFromCache(id);
|
||||||
mFlagManager.dispatchListenersAndMaybeRestart(id, this::restartSystemUI);
|
mFlagManager.dispatchListenersAndMaybeRestart(id, this::restartSystemUI);
|
||||||
@@ -238,7 +240,8 @@ public class FeatureFlagsDebug implements FeatureFlags, Dumpable {
|
|||||||
/** Works just like {@link #eraseFlag(int)} except that it doesn't restart SystemUI. */
|
/** Works just like {@link #eraseFlag(int)} except that it doesn't restart SystemUI. */
|
||||||
private void eraseInternal(int id) {
|
private void eraseInternal(int id) {
|
||||||
// We can't actually "erase" things from sysprops, but we can set them to empty!
|
// We can't actually "erase" things from sysprops, but we can set them to empty!
|
||||||
mSecureSettings.putString(mFlagManager.idToSettingsKey(id), "");
|
mSecureSettings.putStringForUser(mFlagManager.idToSettingsKey(id), "",
|
||||||
|
UserHandle.USER_CURRENT);
|
||||||
Log.i(TAG, "Erase id " + id);
|
Log.i(TAG, "Erase id " + id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.systemui.hdmi;
|
package com.android.systemui.hdmi;
|
||||||
|
|
||||||
|
import android.os.UserHandle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
|
||||||
import com.android.internal.app.LocalePicker;
|
import com.android.internal.app.LocalePicker;
|
||||||
@@ -50,8 +51,8 @@ public class HdmiCecSetMenuLanguageHelper {
|
|||||||
SecureSettings secureSettings) {
|
SecureSettings secureSettings) {
|
||||||
mBackgroundExecutor = executor;
|
mBackgroundExecutor = executor;
|
||||||
mSecureSettings = secureSettings;
|
mSecureSettings = secureSettings;
|
||||||
String denylist = mSecureSettings.getString(
|
String denylist = mSecureSettings.getStringForUser(
|
||||||
Settings.Secure.HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST);
|
Settings.Secure.HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST, UserHandle.USER_CURRENT);
|
||||||
mDenylist = new HashSet<>(denylist == null
|
mDenylist = new HashSet<>(denylist == null
|
||||||
? Collections.EMPTY_SET
|
? Collections.EMPTY_SET
|
||||||
: Arrays.asList(denylist.split(SEPARATOR)));
|
: Arrays.asList(denylist.split(SEPARATOR)));
|
||||||
@@ -91,7 +92,7 @@ public class HdmiCecSetMenuLanguageHelper {
|
|||||||
*/
|
*/
|
||||||
public void declineLocale() {
|
public void declineLocale() {
|
||||||
mDenylist.add(mLocale.toLanguageTag());
|
mDenylist.add(mLocale.toLanguageTag());
|
||||||
mSecureSettings.putString(Settings.Secure.HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST,
|
mSecureSettings.putStringForUser(Settings.Secure.HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST,
|
||||||
String.join(SEPARATOR, mDenylist));
|
String.join(SEPARATOR, mDenylist), UserHandle.USER_CURRENT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import android.content.pm.PackageManager;
|
|||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
import android.os.UserHandle;
|
||||||
import android.service.quickaccesswallet.GetWalletCardsError;
|
import android.service.quickaccesswallet.GetWalletCardsError;
|
||||||
import android.service.quickaccesswallet.GetWalletCardsResponse;
|
import android.service.quickaccesswallet.GetWalletCardsResponse;
|
||||||
import android.service.quickaccesswallet.QuickAccessWalletClient;
|
import android.service.quickaccesswallet.QuickAccessWalletClient;
|
||||||
@@ -182,7 +183,8 @@ public class QuickAccessWalletTile extends QSTileImpl<QSTile.State> {
|
|||||||
public boolean isAvailable() {
|
public boolean isAvailable() {
|
||||||
return mPackageManager.hasSystemFeature(PackageManager.FEATURE_NFC_HOST_CARD_EMULATION)
|
return mPackageManager.hasSystemFeature(PackageManager.FEATURE_NFC_HOST_CARD_EMULATION)
|
||||||
&& !mPackageManager.hasSystemFeature(FEATURE_CHROME_OS)
|
&& !mPackageManager.hasSystemFeature(FEATURE_CHROME_OS)
|
||||||
&& mSecureSettings.getString(NFC_PAYMENT_DEFAULT_COMPONENT) != null;
|
&& mSecureSettings.getStringForUser(NFC_PAYMENT_DEFAULT_COMPONENT,
|
||||||
|
UserHandle.USER_CURRENT) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|||||||
@@ -200,7 +200,8 @@ private class KeyguardNotificationVisibilityProviderImpl @Inject constructor(
|
|||||||
|
|
||||||
private fun readShowSilentNotificationSetting() {
|
private fun readShowSilentNotificationSetting() {
|
||||||
val showSilentNotifs =
|
val showSilentNotifs =
|
||||||
secureSettings.getBool(Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, true)
|
secureSettings.getBoolForUser(Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS,
|
||||||
|
true, UserHandle.USER_CURRENT)
|
||||||
hideSilentNotificationsOnLockscreen = !showSilentNotifs
|
hideSilentNotificationsOnLockscreen = !showSilentNotifs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import android.app.Fragment;
|
|||||||
import android.database.ContentObserver;
|
import android.database.ContentObserver;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
import android.os.UserHandle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.util.SparseArray;
|
import android.util.SparseArray;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@@ -223,7 +224,10 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
|
|||||||
R.array.config_collapsed_statusbar_icon_blocklist));
|
R.array.config_collapsed_statusbar_icon_blocklist));
|
||||||
String vibrateIconSlot = getString(com.android.internal.R.string.status_bar_volume);
|
String vibrateIconSlot = getString(com.android.internal.R.string.status_bar_volume);
|
||||||
boolean showVibrateIcon =
|
boolean showVibrateIcon =
|
||||||
mSecureSettings.getInt(Settings.Secure.STATUS_BAR_SHOW_VIBRATE_ICON, 0) == 0;
|
mSecureSettings.getIntForUser(
|
||||||
|
Settings.Secure.STATUS_BAR_SHOW_VIBRATE_ICON,
|
||||||
|
0,
|
||||||
|
UserHandle.USER_CURRENT) == 0;
|
||||||
|
|
||||||
// Filter out vibrate icon from the blocklist if the setting is on
|
// Filter out vibrate icon from the blocklist if the setting is on
|
||||||
for (int i = 0; i < blockList.size(); i++) {
|
for (int i = 0; i < blockList.size(); i++) {
|
||||||
@@ -260,10 +264,11 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
|
|||||||
initOngoingCallChip();
|
initOngoingCallChip();
|
||||||
mAnimationScheduler.addCallback(this);
|
mAnimationScheduler.addCallback(this);
|
||||||
|
|
||||||
mSecureSettings.registerContentObserver(
|
mSecureSettings.registerContentObserverForUser(
|
||||||
Settings.Secure.getUriFor(Settings.Secure.STATUS_BAR_SHOW_VIBRATE_ICON),
|
Settings.Secure.getUriFor(Settings.Secure.STATUS_BAR_SHOW_VIBRATE_ICON),
|
||||||
false,
|
false,
|
||||||
mVolumeSettingObserver);
|
mVolumeSettingObserver,
|
||||||
|
UserHandle.USER_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -119,8 +119,8 @@ public class LocationControllerImpl extends BroadcastReceiver implements Locatio
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Register to listen for changes in Settings.Secure settings.
|
// Register to listen for changes in Settings.Secure settings.
|
||||||
mSecureSettings.registerContentObserver(
|
mSecureSettings.registerContentObserverForUser(
|
||||||
Settings.Secure.LOCATION_SHOW_SYSTEM_OPS, mContentObserver);
|
Settings.Secure.LOCATION_SHOW_SYSTEM_OPS, mContentObserver, UserHandle.USER_ALL);
|
||||||
|
|
||||||
// Register to listen for changes in DeviceConfig settings.
|
// Register to listen for changes in DeviceConfig settings.
|
||||||
mDeviceConfigProxy.addOnPropertiesChangedListener(
|
mDeviceConfigProxy.addOnPropertiesChangedListener(
|
||||||
@@ -230,7 +230,8 @@ public class LocationControllerImpl extends BroadcastReceiver implements Locatio
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean getShowSystemSetting() {
|
private boolean getShowSystemSetting() {
|
||||||
return mSecureSettings.getInt(Settings.Secure.LOCATION_SHOW_SYSTEM_OPS, 0) == 1;
|
return mSecureSettings.getIntForUser(Settings.Secure.LOCATION_SHOW_SYSTEM_OPS, 0,
|
||||||
|
UserHandle.USER_CURRENT) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean getExperimentStarted() {
|
private boolean getExperimentStarted() {
|
||||||
|
|||||||
@@ -306,8 +306,9 @@ public class ThemeOverlayController extends CoreStartable implements Dumpable {
|
|||||||
Log.d(TAG, "Updating theme setting from "
|
Log.d(TAG, "Updating theme setting from "
|
||||||
+ overlayPackageJson + " to " + jsonObject.toString());
|
+ overlayPackageJson + " to " + jsonObject.toString());
|
||||||
}
|
}
|
||||||
mSecureSettings.putString(Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES,
|
mSecureSettings.putStringForUser(
|
||||||
jsonObject.toString());
|
Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES,
|
||||||
|
jsonObject.toString(), UserHandle.USER_CURRENT);
|
||||||
}
|
}
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
Log.i(TAG, "Failed to parse THEME_CUSTOMIZATION_OVERLAY_PACKAGES.", e);
|
Log.i(TAG, "Failed to parse THEME_CUSTOMIZATION_OVERLAY_PACKAGES.", e);
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import android.app.PendingIntent;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.database.ContentObserver;
|
import android.database.ContentObserver;
|
||||||
|
import android.os.UserHandle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.service.quickaccesswallet.GetWalletCardsRequest;
|
import android.service.quickaccesswallet.GetWalletCardsRequest;
|
||||||
import android.service.quickaccesswallet.QuickAccessWalletClient;
|
import android.service.quickaccesswallet.QuickAccessWalletClient;
|
||||||
@@ -275,10 +276,11 @@ public class QuickAccessWalletController {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
mSecureSettings.registerContentObserver(
|
mSecureSettings.registerContentObserverForUser(
|
||||||
Settings.Secure.getUriFor(Settings.Secure.NFC_PAYMENT_DEFAULT_COMPONENT),
|
Settings.Secure.getUriFor(Settings.Secure.NFC_PAYMENT_DEFAULT_COMPONENT),
|
||||||
false /* notifyForDescendants */,
|
false /* notifyForDescendants */,
|
||||||
mDefaultPaymentAppObserver);
|
mDefaultPaymentAppObserver,
|
||||||
|
UserHandle.USER_ALL);
|
||||||
}
|
}
|
||||||
mDefaultPaymentAppChangeEvents++;
|
mDefaultPaymentAppChangeEvents++;
|
||||||
}
|
}
|
||||||
@@ -294,10 +296,11 @@ public class QuickAccessWalletController {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
mSecureSettings.registerContentObserver(
|
mSecureSettings.registerContentObserverForUser(
|
||||||
Settings.Secure.getUriFor(QuickAccessWalletClientImpl.SETTING_KEY),
|
Settings.Secure.getUriFor(QuickAccessWalletClientImpl.SETTING_KEY),
|
||||||
false /* notifyForDescendants */,
|
false /* notifyForDescendants */,
|
||||||
mWalletPreferenceObserver);
|
mWalletPreferenceObserver,
|
||||||
|
UserHandle.USER_ALL);
|
||||||
}
|
}
|
||||||
mWalletPreferenceChangeEvents++;
|
mWalletPreferenceChangeEvents++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import static org.junit.Assert.assertEquals;
|
|||||||
import static org.mockito.ArgumentMatchers.any;
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
import static org.mockito.ArgumentMatchers.anyBoolean;
|
import static org.mockito.ArgumentMatchers.anyBoolean;
|
||||||
import static org.mockito.ArgumentMatchers.anyInt;
|
import static org.mockito.ArgumentMatchers.anyInt;
|
||||||
|
import static org.mockito.ArgumentMatchers.eq;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.never;
|
import static org.mockito.Mockito.never;
|
||||||
import static org.mockito.Mockito.reset;
|
import static org.mockito.Mockito.reset;
|
||||||
@@ -30,6 +31,7 @@ import static org.mockito.Mockito.when;
|
|||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.database.ContentObserver;
|
import android.database.ContentObserver;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
import android.os.UserHandle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.testing.AndroidTestingRunner;
|
import android.testing.AndroidTestingRunner;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -250,13 +252,14 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testChangeToDoubleLineClockSetsSmallClock() {
|
public void testChangeToDoubleLineClockSetsSmallClock() {
|
||||||
when(mSecureSettings.getInt(Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK, 1))
|
when(mSecureSettings.getIntForUser(Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK, 1,
|
||||||
|
UserHandle.USER_CURRENT))
|
||||||
.thenReturn(0);
|
.thenReturn(0);
|
||||||
ArgumentCaptor<ContentObserver> observerCaptor =
|
ArgumentCaptor<ContentObserver> observerCaptor =
|
||||||
ArgumentCaptor.forClass(ContentObserver.class);
|
ArgumentCaptor.forClass(ContentObserver.class);
|
||||||
mController.init();
|
mController.init();
|
||||||
verify(mSecureSettings).registerContentObserver(any(Uri.class),
|
verify(mSecureSettings).registerContentObserverForUser(any(Uri.class),
|
||||||
anyBoolean(), observerCaptor.capture());
|
anyBoolean(), observerCaptor.capture(), eq(UserHandle.USER_ALL));
|
||||||
ContentObserver observer = observerCaptor.getValue();
|
ContentObserver observer = observerCaptor.getValue();
|
||||||
mExecutor.runAllReady();
|
mExecutor.runAllReady();
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import android.content.SharedPreferences
|
|||||||
import android.database.ContentObserver
|
import android.database.ContentObserver
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
|
import android.os.UserHandle
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
import android.test.suitebuilder.annotation.SmallTest
|
import android.test.suitebuilder.annotation.SmallTest
|
||||||
import android.testing.AndroidTestingRunner
|
import android.testing.AndroidTestingRunner
|
||||||
@@ -40,6 +41,7 @@ import org.junit.Before
|
|||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.junit.runner.RunWith
|
import org.junit.runner.RunWith
|
||||||
import org.mockito.Answers
|
import org.mockito.Answers
|
||||||
|
import org.mockito.ArgumentMatchers.anyInt
|
||||||
import org.mockito.Mock
|
import org.mockito.Mock
|
||||||
import org.mockito.Mockito
|
import org.mockito.Mockito
|
||||||
import org.mockito.Mockito.`when`
|
import org.mockito.Mockito.`when`
|
||||||
@@ -97,7 +99,8 @@ class ControlActionCoordinatorImplTest : SysuiTestCase() {
|
|||||||
`when`(secureSettings.getUriFor(Settings.Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS))
|
`when`(secureSettings.getUriFor(Settings.Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS))
|
||||||
.thenReturn(Settings.Secure
|
.thenReturn(Settings.Secure
|
||||||
.getUriFor(Settings.Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS))
|
.getUriFor(Settings.Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS))
|
||||||
`when`(secureSettings.getInt(Settings.Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 0))
|
`when`(secureSettings.getIntForUser(Settings.Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS,
|
||||||
|
0, UserHandle.USER_CURRENT))
|
||||||
.thenReturn(1)
|
.thenReturn(1)
|
||||||
|
|
||||||
coordinator = spy(ControlActionCoordinatorImpl(
|
coordinator = spy(ControlActionCoordinatorImpl(
|
||||||
@@ -125,8 +128,8 @@ class ControlActionCoordinatorImplTest : SysuiTestCase() {
|
|||||||
`when`(pref.getInt(DeviceControlsControllerImpl.PREFS_SETTINGS_DIALOG_ATTEMPTS, 0))
|
`when`(pref.getInt(DeviceControlsControllerImpl.PREFS_SETTINGS_DIALOG_ATTEMPTS, 0))
|
||||||
.thenReturn(2)
|
.thenReturn(2)
|
||||||
|
|
||||||
verify(secureSettings).registerContentObserver(any(Uri::class.java),
|
verify(secureSettings).registerContentObserverForUser(any(Uri::class.java),
|
||||||
anyBoolean(), any(ContentObserver::class.java))
|
anyBoolean(), any(ContentObserver::class.java), anyInt())
|
||||||
|
|
||||||
`when`(cvh.cws.ci.controlId).thenReturn(ID)
|
`when`(cvh.cws.ci.controlId).thenReturn(ID)
|
||||||
`when`(cvh.cws.control?.isAuthRequired()).thenReturn(true)
|
`when`(cvh.cws.control?.isAuthRequired()).thenReturn(true)
|
||||||
|
|||||||
@@ -137,7 +137,8 @@ class ControlsComponentTest : SysuiTestCase() {
|
|||||||
`when`(lockPatternUtils.getStrongAuthForUser(anyInt()))
|
`when`(lockPatternUtils.getStrongAuthForUser(anyInt()))
|
||||||
.thenReturn(STRONG_AUTH_NOT_REQUIRED)
|
.thenReturn(STRONG_AUTH_NOT_REQUIRED)
|
||||||
`when`(keyguardStateController.isUnlocked()).thenReturn(false)
|
`when`(keyguardStateController.isUnlocked()).thenReturn(false)
|
||||||
`when`(secureSettings.getInt(eq(Settings.Secure.LOCKSCREEN_SHOW_CONTROLS), anyInt()))
|
`when`(secureSettings.getIntForUser(eq(Settings.Secure.LOCKSCREEN_SHOW_CONTROLS),
|
||||||
|
anyInt(), anyInt()))
|
||||||
.thenReturn(1)
|
.thenReturn(1)
|
||||||
val component = setupComponent(true)
|
val component = setupComponent(true)
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import com.google.common.truth.Truth.assertThat
|
|||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
import org.mockito.ArgumentMatchers.anyInt
|
||||||
import org.mockito.Mock
|
import org.mockito.Mock
|
||||||
import org.mockito.Mockito.anyBoolean
|
import org.mockito.Mockito.anyBoolean
|
||||||
import org.mockito.Mockito.anyString
|
import org.mockito.Mockito.anyString
|
||||||
@@ -321,7 +322,7 @@ class FeatureFlagsDebugTest : SysuiTestCase() {
|
|||||||
inOrder(mFlagManager, mSecureSettings).apply {
|
inOrder(mFlagManager, mSecureSettings).apply {
|
||||||
verify(mFlagManager, times(numReads)).readFlagValue(eq(id), any<FlagSerializer<*>>())
|
verify(mFlagManager, times(numReads)).readFlagValue(eq(id), any<FlagSerializer<*>>())
|
||||||
verify(mFlagManager).idToSettingsKey(eq(id))
|
verify(mFlagManager).idToSettingsKey(eq(id))
|
||||||
verify(mSecureSettings).putString(eq("key-$id"), eq(data))
|
verify(mSecureSettings).putStringForUser(eq("key-$id"), eq(data), anyInt())
|
||||||
verify(mFlagManager).dispatchListenersAndMaybeRestart(eq(id), any())
|
verify(mFlagManager).dispatchListenersAndMaybeRestart(eq(id), any())
|
||||||
}.verifyNoMoreInteractions()
|
}.verifyNoMoreInteractions()
|
||||||
verifyNoMoreInteractions(mFlagManager, mSecureSettings)
|
verifyNoMoreInteractions(mFlagManager, mSecureSettings)
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import static org.mockito.Mockito.any;
|
|||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
|
import android.os.UserHandle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.test.suitebuilder.annotation.SmallTest;
|
import android.test.suitebuilder.annotation.SmallTest;
|
||||||
import android.testing.AndroidTestingRunner;
|
import android.testing.AndroidTestingRunner;
|
||||||
@@ -53,8 +54,9 @@ public class HdmiCecSetMenuLanguageHelperTest extends SysuiTestCase {
|
|||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
when(mSecureSettings.getString(
|
when(mSecureSettings.getStringForUser(
|
||||||
Settings.Secure.HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST)).thenReturn(null);
|
Settings.Secure.HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST,
|
||||||
|
UserHandle.USER_CURRENT)).thenReturn(null);
|
||||||
mHdmiCecSetMenuLanguageHelper =
|
mHdmiCecSetMenuLanguageHelper =
|
||||||
new HdmiCecSetMenuLanguageHelper(mExecutor, mSecureSettings);
|
new HdmiCecSetMenuLanguageHelper(mExecutor, mSecureSettings);
|
||||||
}
|
}
|
||||||
@@ -84,8 +86,9 @@ public class HdmiCecSetMenuLanguageHelperTest extends SysuiTestCase {
|
|||||||
mHdmiCecSetMenuLanguageHelper.setLocale("de");
|
mHdmiCecSetMenuLanguageHelper.setLocale("de");
|
||||||
mHdmiCecSetMenuLanguageHelper.declineLocale();
|
mHdmiCecSetMenuLanguageHelper.declineLocale();
|
||||||
assertThat(mHdmiCecSetMenuLanguageHelper.isLocaleDenylisted()).isEqualTo(true);
|
assertThat(mHdmiCecSetMenuLanguageHelper.isLocaleDenylisted()).isEqualTo(true);
|
||||||
verify(mSecureSettings).putString(
|
verify(mSecureSettings).putStringForUser(
|
||||||
Settings.Secure.HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST, "de");
|
Settings.Secure.HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST, "de",
|
||||||
|
UserHandle.USER_CURRENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -93,12 +96,14 @@ public class HdmiCecSetMenuLanguageHelperTest extends SysuiTestCase {
|
|||||||
mHdmiCecSetMenuLanguageHelper.setLocale("de");
|
mHdmiCecSetMenuLanguageHelper.setLocale("de");
|
||||||
mHdmiCecSetMenuLanguageHelper.declineLocale();
|
mHdmiCecSetMenuLanguageHelper.declineLocale();
|
||||||
assertThat(mHdmiCecSetMenuLanguageHelper.isLocaleDenylisted()).isEqualTo(true);
|
assertThat(mHdmiCecSetMenuLanguageHelper.isLocaleDenylisted()).isEqualTo(true);
|
||||||
verify(mSecureSettings).putString(
|
verify(mSecureSettings).putStringForUser(
|
||||||
Settings.Secure.HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST, "de");
|
Settings.Secure.HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST, "de",
|
||||||
|
UserHandle.USER_CURRENT);
|
||||||
mHdmiCecSetMenuLanguageHelper.setLocale("pl");
|
mHdmiCecSetMenuLanguageHelper.setLocale("pl");
|
||||||
mHdmiCecSetMenuLanguageHelper.declineLocale();
|
mHdmiCecSetMenuLanguageHelper.declineLocale();
|
||||||
assertThat(mHdmiCecSetMenuLanguageHelper.isLocaleDenylisted()).isEqualTo(true);
|
assertThat(mHdmiCecSetMenuLanguageHelper.isLocaleDenylisted()).isEqualTo(true);
|
||||||
verify(mSecureSettings).putString(
|
verify(mSecureSettings).putStringForUser(
|
||||||
Settings.Secure.HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST, "de,pl");
|
Settings.Secure.HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST, "de,pl",
|
||||||
|
UserHandle.USER_CURRENT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ import android.graphics.Bitmap;
|
|||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.graphics.drawable.Icon;
|
import android.graphics.drawable.Icon;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
import android.os.UserHandle;
|
||||||
import android.service.quickaccesswallet.GetWalletCardsError;
|
import android.service.quickaccesswallet.GetWalletCardsError;
|
||||||
import android.service.quickaccesswallet.GetWalletCardsResponse;
|
import android.service.quickaccesswallet.GetWalletCardsResponse;
|
||||||
import android.service.quickaccesswallet.QuickAccessWalletClient;
|
import android.service.quickaccesswallet.QuickAccessWalletClient;
|
||||||
@@ -186,7 +187,8 @@ public class QuickAccessWalletTileTest extends SysuiTestCase {
|
|||||||
public void testIsAvailable_qawFeatureAvailable() {
|
public void testIsAvailable_qawFeatureAvailable() {
|
||||||
when(mPackageManager.hasSystemFeature(FEATURE_NFC_HOST_CARD_EMULATION)).thenReturn(true);
|
when(mPackageManager.hasSystemFeature(FEATURE_NFC_HOST_CARD_EMULATION)).thenReturn(true);
|
||||||
when(mPackageManager.hasSystemFeature("org.chromium.arc")).thenReturn(false);
|
when(mPackageManager.hasSystemFeature("org.chromium.arc")).thenReturn(false);
|
||||||
when(mSecureSettings.getString(NFC_PAYMENT_DEFAULT_COMPONENT)).thenReturn("Component");
|
when(mSecureSettings.getStringForUser(NFC_PAYMENT_DEFAULT_COMPONENT,
|
||||||
|
UserHandle.USER_CURRENT)).thenReturn("Component");
|
||||||
|
|
||||||
assertTrue(mTile.isAvailable());
|
assertTrue(mTile.isAvailable());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import android.app.Fragment;
|
|||||||
import android.app.StatusBarManager;
|
import android.app.StatusBarManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.UserHandle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.testing.AndroidTestingRunner;
|
import android.testing.AndroidTestingRunner;
|
||||||
import android.testing.TestableLooper.RunWithLooper;
|
import android.testing.TestableLooper.RunWithLooper;
|
||||||
@@ -329,7 +330,8 @@ public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest {
|
|||||||
String str = mContext.getString(com.android.internal.R.string.status_bar_volume);
|
String str = mContext.getString(com.android.internal.R.string.status_bar_volume);
|
||||||
|
|
||||||
// GIVEN the setting is ON
|
// GIVEN the setting is ON
|
||||||
when(mSecureSettings.getInt(Settings.Secure.STATUS_BAR_SHOW_VIBRATE_ICON, 0))
|
when(mSecureSettings.getIntForUser(Settings.Secure.STATUS_BAR_SHOW_VIBRATE_ICON, 0,
|
||||||
|
UserHandle.USER_CURRENT))
|
||||||
.thenReturn(1);
|
.thenReturn(1);
|
||||||
|
|
||||||
// WHEN CollapsedStatusBarFragment builds the blocklist
|
// WHEN CollapsedStatusBarFragment builds the blocklist
|
||||||
|
|||||||
@@ -292,8 +292,9 @@ public class ThemeOverlayControllerTest extends SysuiTestCase {
|
|||||||
USER_SYSTEM);
|
USER_SYSTEM);
|
||||||
|
|
||||||
ArgumentCaptor<String> updatedSetting = ArgumentCaptor.forClass(String.class);
|
ArgumentCaptor<String> updatedSetting = ArgumentCaptor.forClass(String.class);
|
||||||
verify(mSecureSettings).putString(
|
verify(mSecureSettings).putStringForUser(
|
||||||
eq(Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES), updatedSetting.capture());
|
eq(Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES), updatedSetting.capture(),
|
||||||
|
anyInt());
|
||||||
|
|
||||||
assertThat(updatedSetting.getValue().contains("android.theme.customization.accent_color"))
|
assertThat(updatedSetting.getValue().contains("android.theme.customization.accent_color"))
|
||||||
.isFalse();
|
.isFalse();
|
||||||
@@ -330,8 +331,9 @@ public class ThemeOverlayControllerTest extends SysuiTestCase {
|
|||||||
USER_SYSTEM);
|
USER_SYSTEM);
|
||||||
|
|
||||||
ArgumentCaptor<String> updatedSetting = ArgumentCaptor.forClass(String.class);
|
ArgumentCaptor<String> updatedSetting = ArgumentCaptor.forClass(String.class);
|
||||||
verify(mSecureSettings).putString(
|
verify(mSecureSettings).putStringForUser(
|
||||||
eq(Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES), updatedSetting.capture());
|
eq(Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES), updatedSetting.capture(),
|
||||||
|
anyInt());
|
||||||
|
|
||||||
assertThat(updatedSetting.getValue().contains(
|
assertThat(updatedSetting.getValue().contains(
|
||||||
"android.theme.customization.color_both\":\"0")).isTrue();
|
"android.theme.customization.color_both\":\"0")).isTrue();
|
||||||
@@ -396,8 +398,9 @@ public class ThemeOverlayControllerTest extends SysuiTestCase {
|
|||||||
WallpaperManager.FLAG_SYSTEM | WallpaperManager.FLAG_LOCK, USER_SYSTEM);
|
WallpaperManager.FLAG_SYSTEM | WallpaperManager.FLAG_LOCK, USER_SYSTEM);
|
||||||
|
|
||||||
ArgumentCaptor<String> updatedSetting = ArgumentCaptor.forClass(String.class);
|
ArgumentCaptor<String> updatedSetting = ArgumentCaptor.forClass(String.class);
|
||||||
verify(mSecureSettings).putString(
|
verify(mSecureSettings).putStringForUser(
|
||||||
eq(Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES), updatedSetting.capture());
|
eq(Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES), updatedSetting.capture(),
|
||||||
|
anyInt());
|
||||||
|
|
||||||
assertThat(updatedSetting.getValue().contains(
|
assertThat(updatedSetting.getValue().contains(
|
||||||
"android.theme.customization.color_both\":\"1")).isTrue();
|
"android.theme.customization.color_both\":\"1")).isTrue();
|
||||||
@@ -426,8 +429,9 @@ public class ThemeOverlayControllerTest extends SysuiTestCase {
|
|||||||
USER_SYSTEM);
|
USER_SYSTEM);
|
||||||
|
|
||||||
ArgumentCaptor<String> updatedSetting = ArgumentCaptor.forClass(String.class);
|
ArgumentCaptor<String> updatedSetting = ArgumentCaptor.forClass(String.class);
|
||||||
verify(mSecureSettings).putString(
|
verify(mSecureSettings).putStringForUser(
|
||||||
eq(Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES), updatedSetting.capture());
|
eq(Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES), updatedSetting.capture(),
|
||||||
|
anyInt());
|
||||||
assertThat(updatedSetting.getValue().contains(
|
assertThat(updatedSetting.getValue().contains(
|
||||||
"android.theme.customization.color_source\":\"lock_wallpaper")).isTrue();
|
"android.theme.customization.color_source\":\"lock_wallpaper")).isTrue();
|
||||||
assertThat(updatedSetting.getValue().contains("android.theme.customization.color_index"))
|
assertThat(updatedSetting.getValue().contains("android.theme.customization.color_index"))
|
||||||
@@ -456,8 +460,9 @@ public class ThemeOverlayControllerTest extends SysuiTestCase {
|
|||||||
USER_SYSTEM);
|
USER_SYSTEM);
|
||||||
|
|
||||||
ArgumentCaptor<String> updatedSetting = ArgumentCaptor.forClass(String.class);
|
ArgumentCaptor<String> updatedSetting = ArgumentCaptor.forClass(String.class);
|
||||||
verify(mSecureSettings).putString(
|
verify(mSecureSettings).putStringForUser(
|
||||||
eq(Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES), updatedSetting.capture());
|
eq(Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES), updatedSetting.capture(),
|
||||||
|
anyInt());
|
||||||
assertThat(updatedSetting.getValue().contains(
|
assertThat(updatedSetting.getValue().contains(
|
||||||
"android.theme.customization.color_source\":\"home_wallpaper")).isTrue();
|
"android.theme.customization.color_source\":\"home_wallpaper")).isTrue();
|
||||||
assertThat(updatedSetting.getValue().contains("android.theme.customization.color_index"))
|
assertThat(updatedSetting.getValue().contains("android.theme.customization.color_index"))
|
||||||
@@ -491,8 +496,9 @@ public class ThemeOverlayControllerTest extends SysuiTestCase {
|
|||||||
USER_SYSTEM);
|
USER_SYSTEM);
|
||||||
|
|
||||||
ArgumentCaptor<String> updatedSetting = ArgumentCaptor.forClass(String.class);
|
ArgumentCaptor<String> updatedSetting = ArgumentCaptor.forClass(String.class);
|
||||||
verify(mSecureSettings).putString(
|
verify(mSecureSettings).putStringForUser(
|
||||||
eq(Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES), updatedSetting.capture());
|
eq(Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES), updatedSetting.capture(),
|
||||||
|
anyInt());
|
||||||
|
|
||||||
verify(mThemeOverlayApplier)
|
verify(mThemeOverlayApplier)
|
||||||
.applyCurrentUserOverlays(any(), any(), anyInt(), any());
|
.applyCurrentUserOverlays(any(), any(), anyInt(), any());
|
||||||
|
|||||||
Reference in New Issue
Block a user