aboutsummaryrefslogtreecommitdiff
path: root/tests/CarDeveloperOptions/src/com/android
diff options
context:
space:
mode:
authorJonathan Scott <scottjonathan@google.com>2019-04-18 17:56:20 +0100
committerJonathan Scott <scottjonathan@google.com>2019-04-18 18:03:44 +0100
commit5e99e529a790a2b4d0e7abb79ec40b78fbfcab2e (patch)
treecc57302802f435064b5ae03919db40c0e4cd954b /tests/CarDeveloperOptions/src/com/android
parent4b512b5041c123a3c544cf4898ea3b99b2e36354 (diff)
downloadCar-5e99e529a790a2b4d0e7abb79ec40b78fbfcab2e.tar.gz
Remove cross profile calendar settings (non-relevant).
Test: mm -j Bug: 123930863 Change-Id: I0a389d48bf66fa56d2b7d18f3d83f7c4cadc4d22
Diffstat (limited to 'tests/CarDeveloperOptions/src/com/android')
-rw-r--r--tests/CarDeveloperOptions/src/com/android/car/developeroptions/accounts/CrossProfileCalendarPreferenceController.java77
-rw-r--r--tests/CarDeveloperOptions/src/com/android/car/developeroptions/accounts/ManagedProfileSettings.java1
2 files changed, 0 insertions, 78 deletions
diff --git a/tests/CarDeveloperOptions/src/com/android/car/developeroptions/accounts/CrossProfileCalendarPreferenceController.java b/tests/CarDeveloperOptions/src/com/android/car/developeroptions/accounts/CrossProfileCalendarPreferenceController.java
deleted file mode 100644
index a89411813e..0000000000
--- a/tests/CarDeveloperOptions/src/com/android/car/developeroptions/accounts/CrossProfileCalendarPreferenceController.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the
- * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package com.android.car.developeroptions.accounts;
-
-import static android.provider.Settings.Secure.CROSS_PROFILE_CALENDAR_ENABLED;
-
-import android.content.Context;
-import android.os.UserHandle;
-import android.provider.Settings;
-
-import androidx.preference.Preference;
-
-import com.android.car.developeroptions.core.TogglePreferenceController;
-import com.android.settingslib.RestrictedLockUtils;
-import com.android.settingslib.RestrictedLockUtilsInternal;
-import com.android.settingslib.RestrictedSwitchPreference;
-
-public class CrossProfileCalendarPreferenceController extends TogglePreferenceController {
-
- private UserHandle mManagedUser;
-
- public CrossProfileCalendarPreferenceController(Context context, String key) {
- super(context, key);
- }
-
- public void setManagedUser(UserHandle managedUser) {
- mManagedUser = managedUser;
- }
-
- @Override
- public int getAvailabilityStatus() {
- return (mManagedUser != null) ? AVAILABLE : DISABLED_FOR_USER;
- }
-
- @Override
- public void updateState(Preference preference) {
- super.updateState(preference);
- if (preference instanceof RestrictedSwitchPreference && mManagedUser != null) {
- final RestrictedSwitchPreference pref = (RestrictedSwitchPreference) preference;
- final RestrictedLockUtils.EnforcedAdmin enforcedAdmin =
- RestrictedLockUtilsInternal.getCrossProfileCalendarEnforcingAdmin(
- mContext, mManagedUser.getIdentifier());
- pref.setDisabledByAdmin(enforcedAdmin);
- }
- }
-
- @Override
- public boolean isChecked() {
- if (mManagedUser == null) {
- return false;
- }
- return Settings.Secure.getIntForUser(mContext.getContentResolver(),
- CROSS_PROFILE_CALENDAR_ENABLED, /* default= */ 0,
- mManagedUser.getIdentifier()) == 1;
- }
-
- @Override
- public boolean setChecked(boolean isChecked) {
- if (mManagedUser == null) {
- return false;
- }
- final int value = isChecked ? 1 : 0;
- return Settings.Secure.putIntForUser(mContext.getContentResolver(),
- CROSS_PROFILE_CALENDAR_ENABLED, value, mManagedUser.getIdentifier());
- }
-} \ No newline at end of file
diff --git a/tests/CarDeveloperOptions/src/com/android/car/developeroptions/accounts/ManagedProfileSettings.java b/tests/CarDeveloperOptions/src/com/android/car/developeroptions/accounts/ManagedProfileSettings.java
index fdd531a59f..65d99a6556 100644
--- a/tests/CarDeveloperOptions/src/com/android/car/developeroptions/accounts/ManagedProfileSettings.java
+++ b/tests/CarDeveloperOptions/src/com/android/car/developeroptions/accounts/ManagedProfileSettings.java
@@ -71,7 +71,6 @@ public class ManagedProfileSettings extends DashboardFragment {
}
use(WorkModePreferenceController.class).setManagedUser(mManagedUser);
use(ContactSearchPreferenceController.class).setManagedUser(mManagedUser);
- use(CrossProfileCalendarPreferenceController.class).setManagedUser(mManagedUser);
}
@Override