Snap for 12702769 from 851bf18783
to 25Q1-release
Change-Id: I76b4be2604f387b8fcfaa6ea76a044e4612990d3
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
package: "com.android.settings.keyboard"
|
||||||
|
container: "system"
|
||||||
|
|
||||||
|
flag {
|
||||||
|
name: "keyboard_layout_picker_activity_enabled"
|
||||||
|
namespace: "input"
|
||||||
|
description: "This flag enables or disables exposed page of keyboard layout picker"
|
||||||
|
bug: "345399212"
|
||||||
|
}
|
@@ -20,7 +20,8 @@
|
|||||||
<com.android.settingslib.widget.TopIntroPreference
|
<com.android.settingslib.widget.TopIntroPreference
|
||||||
android:key="accessibility_button_intro"
|
android:key="accessibility_button_intro"
|
||||||
android:persistent="false"
|
android:persistent="false"
|
||||||
android:title="@string/accessibility_button_intro_text" />
|
android:title="@string/accessibility_button_intro_text"
|
||||||
|
settings:searchable="false" />
|
||||||
|
|
||||||
<com.android.settingslib.widget.IllustrationPreference
|
<com.android.settingslib.widget.IllustrationPreference
|
||||||
android:key="accessibility_button_preview"
|
android:key="accessibility_button_preview"
|
||||||
|
@@ -110,10 +110,6 @@ public class RestrictedPreferenceHelper {
|
|||||||
*/
|
*/
|
||||||
public List<AccessibilityActivityPreference> createAccessibilityActivityPreferenceList(
|
public List<AccessibilityActivityPreference> createAccessibilityActivityPreferenceList(
|
||||||
List<AccessibilityShortcutInfo> installedShortcuts) {
|
List<AccessibilityShortcutInfo> installedShortcuts) {
|
||||||
final Set<ComponentName> enabledServices =
|
|
||||||
AccessibilityUtils.getEnabledServicesFromSettings(mContext);
|
|
||||||
final List<String> permittedServices = mDpm.getPermittedAccessibilityServices(
|
|
||||||
UserHandle.myUserId());
|
|
||||||
|
|
||||||
final int installedShortcutsSize = installedShortcuts.size();
|
final int installedShortcutsSize = installedShortcuts.size();
|
||||||
final List<AccessibilityActivityPreference> preferenceList = new ArrayList<>(
|
final List<AccessibilityActivityPreference> preferenceList = new ArrayList<>(
|
||||||
@@ -124,17 +120,12 @@ public class RestrictedPreferenceHelper {
|
|||||||
final ActivityInfo activityInfo = info.getActivityInfo();
|
final ActivityInfo activityInfo = info.getActivityInfo();
|
||||||
final ComponentName componentName = info.getComponentName();
|
final ComponentName componentName = info.getComponentName();
|
||||||
|
|
||||||
final boolean serviceEnabled = enabledServices.contains(componentName);
|
|
||||||
AccessibilityActivityPreference preference = new AccessibilityActivityPreference(
|
AccessibilityActivityPreference preference = new AccessibilityActivityPreference(
|
||||||
mContext, componentName.getPackageName(), activityInfo.applicationInfo.uid,
|
mContext, componentName.getPackageName(), activityInfo.applicationInfo.uid,
|
||||||
info);
|
info);
|
||||||
if (Flags.neverRestrictAccessibilityActivity()) {
|
// Accessibility Activities do not have elevated privileges so restricting
|
||||||
// Accessibility Activities do not have elevated privileges so restricting
|
// them based on ECM or device admin does not give any value.
|
||||||
// them based on ECM or device admin does not give any value.
|
preference.setEnabled(true);
|
||||||
preference.setEnabled(true);
|
|
||||||
} else {
|
|
||||||
setRestrictedPreferenceEnabled(preference, permittedServices, serviceEnabled);
|
|
||||||
}
|
|
||||||
preferenceList.add(preference);
|
preferenceList.add(preference);
|
||||||
}
|
}
|
||||||
return preferenceList;
|
return preferenceList;
|
||||||
|
@@ -270,7 +270,8 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
|||||||
R.integer.config_biometrics_header_scroll_duration);
|
R.integer.config_biometrics_header_scroll_duration);
|
||||||
layoutView.adjustScrollableHeaderHeight(
|
layoutView.adjustScrollableHeaderHeight(
|
||||||
headerScrollView, mShouldShowLottie);
|
headerScrollView, mShouldShowLottie);
|
||||||
layoutView.headerVerticalScrolling(headerScrollView, headerScrollDuration);
|
layoutView.headerVerticalScrolling(headerScrollView, headerScrollDuration,
|
||||||
|
mIsAccessibilityEnabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -547,6 +548,9 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateTitleAndDescriptionForUdfps() {
|
private void updateTitleAndDescriptionForUdfps() {
|
||||||
|
final UdfpsEnrollEnrollingView layoutView = (UdfpsEnrollEnrollingView) getLayout();
|
||||||
|
final boolean shouldSetFocusOnDescription = Flags.enrollLayoutTruncateImprovement()
|
||||||
|
&& mIsAccessibilityEnabled;
|
||||||
switch (getCurrentStage()) {
|
switch (getCurrentStage()) {
|
||||||
case STAGE_CENTER:
|
case STAGE_CENTER:
|
||||||
setHeaderText(R.string.security_settings_fingerprint_enroll_repeat_title);
|
setHeaderText(R.string.security_settings_fingerprint_enroll_repeat_title);
|
||||||
@@ -560,6 +564,10 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
|||||||
);
|
);
|
||||||
configureEnrollmentStage(R.raw.udfps_center_hint_lottie);
|
configureEnrollmentStage(R.raw.udfps_center_hint_lottie);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shouldSetFocusOnDescription) {
|
||||||
|
layoutView.setFocusOnDescription();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STAGE_GUIDED:
|
case STAGE_GUIDED:
|
||||||
@@ -574,6 +582,10 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
|||||||
// TODO(b/228100413) Could customize guided lottie animation
|
// TODO(b/228100413) Could customize guided lottie animation
|
||||||
configureEnrollmentStage(R.raw.udfps_center_hint_lottie);
|
configureEnrollmentStage(R.raw.udfps_center_hint_lottie);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shouldSetFocusOnDescription) {
|
||||||
|
layoutView.setFocusOnDescription();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case STAGE_FINGERTIP:
|
case STAGE_FINGERTIP:
|
||||||
setHeaderText(R.string.security_settings_udfps_enroll_fingertip_title);
|
setHeaderText(R.string.security_settings_udfps_enroll_fingertip_title);
|
||||||
@@ -584,6 +596,10 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
|||||||
);
|
);
|
||||||
configureEnrollmentStage(R.raw.udfps_tip_hint_lottie);
|
configureEnrollmentStage(R.raw.udfps_tip_hint_lottie);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shouldSetFocusOnDescription) {
|
||||||
|
layoutView.setFocusOnDescription();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case STAGE_LEFT_EDGE:
|
case STAGE_LEFT_EDGE:
|
||||||
setHeaderText(R.string.security_settings_udfps_enroll_left_edge_title);
|
setHeaderText(R.string.security_settings_udfps_enroll_left_edge_title);
|
||||||
@@ -601,6 +617,10 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
|||||||
setDescriptionText(R.string.security_settings_udfps_enroll_edge_message);
|
setDescriptionText(R.string.security_settings_udfps_enroll_edge_message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shouldSetFocusOnDescription) {
|
||||||
|
layoutView.setFocusOnDescription();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case STAGE_RIGHT_EDGE:
|
case STAGE_RIGHT_EDGE:
|
||||||
setHeaderText(R.string.security_settings_udfps_enroll_right_edge_title);
|
setHeaderText(R.string.security_settings_udfps_enroll_right_edge_title);
|
||||||
@@ -619,6 +639,10 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
|||||||
setDescriptionText(R.string.security_settings_udfps_enroll_edge_message);
|
setDescriptionText(R.string.security_settings_udfps_enroll_edge_message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shouldSetFocusOnDescription) {
|
||||||
|
layoutView.setFocusOnDescription();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STAGE_UNKNOWN:
|
case STAGE_UNKNOWN:
|
||||||
|
@@ -25,6 +25,7 @@ import android.graphics.Insets;
|
|||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
|
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
|
||||||
|
import android.os.Handler;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
@@ -44,6 +45,7 @@ import android.widget.FrameLayout;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.ColorInt;
|
import androidx.annotation.ColorInt;
|
||||||
import androidx.annotation.LayoutRes;
|
import androidx.annotation.LayoutRes;
|
||||||
@@ -200,7 +202,26 @@ public class UdfpsEnrollEnrollingView extends GlifLayout {
|
|||||||
return footerBarMinHeight;
|
return footerBarMinHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
void headerVerticalScrolling(ScrollView headerScrollView, long duration) {
|
void setFocusOnDescription() {
|
||||||
|
final ScrollView headerScrollView = findViewById(R.id.sud_header_scroll_view);
|
||||||
|
final TextView descriptionView = getDescriptionTextView();
|
||||||
|
if (descriptionView != null && !descriptionView.getText().isEmpty()) {
|
||||||
|
descriptionView.post(
|
||||||
|
() -> {
|
||||||
|
Rect scrollBounds = new Rect();
|
||||||
|
headerScrollView.getHitRect(scrollBounds);
|
||||||
|
boolean isVisible = descriptionView.getLocalVisibleRect(scrollBounds);
|
||||||
|
if (!isVisible) {
|
||||||
|
descriptionView.setFocusable(true);
|
||||||
|
descriptionView.setFocusableInTouchMode(true);
|
||||||
|
descriptionView.requestFocus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void headerVerticalScrolling(ScrollView headerScrollView, long duration,
|
||||||
|
boolean isAccessibilityEnabled) {
|
||||||
headerScrollView.post(new Runnable() {
|
headerScrollView.post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -216,13 +237,23 @@ public class UdfpsEnrollEnrollingView extends GlifLayout {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(@NonNull Animator animation) {
|
public void onAnimationEnd(@NonNull Animator animation) {
|
||||||
mHeaderScrollAnimator.removeAllListeners();
|
headerScrollView.post(new Runnable() {
|
||||||
headerScrollView.post(new Runnable() {
|
@Override
|
||||||
@Override
|
public void run() {
|
||||||
public void run() {
|
mHeaderScrollAnimator.removeAllListeners();
|
||||||
mHeaderScrollAnimator.reverse();
|
mHeaderScrollAnimator.reverse();
|
||||||
}
|
if (isAccessibilityEnabled) {
|
||||||
});
|
new Handler().postDelayed(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (!mHeaderScrollAnimator.isRunning()) {
|
||||||
|
setFocusOnDescription();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, duration + 200);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -320,6 +351,19 @@ public class UdfpsEnrollEnrollingView extends GlifLayout {
|
|||||||
R.id.udfps_enroll_animation_fp_view);
|
R.id.udfps_enroll_animation_fp_view);
|
||||||
fingerprintView.setPadding(0, -layoutLottieAnimationPadding,
|
fingerprintView.setPadding(0, -layoutLottieAnimationPadding,
|
||||||
0, layoutLottieAnimationPadding);
|
0, layoutLottieAnimationPadding);
|
||||||
|
|
||||||
|
// TODO(b/260970216) Instead of hiding the description text view, we should
|
||||||
|
// make the header view scrollable if the text is too long.
|
||||||
|
// If description text view has overlap with udfps progress view, hide it.
|
||||||
|
if (!Flags.enrollLayoutTruncateImprovement()) {
|
||||||
|
final View descView = getDescriptionTextView();
|
||||||
|
getViewTreeObserver().addOnDrawListener(() -> {
|
||||||
|
if (descView.getVisibility() == View.VISIBLE
|
||||||
|
&& hasOverlap(descView, mUdfpsEnrollView)) {
|
||||||
|
descView.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setOnHoverListener() {
|
private void setOnHoverListener() {
|
||||||
|
@@ -44,9 +44,9 @@ import java.util.Arrays;
|
|||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utilities of keyboard settings
|
* Utilities of input peripherals settings
|
||||||
*/
|
*/
|
||||||
public class NewKeyboardSettingsUtils {
|
public class InputPeripheralsSettingsUtils {
|
||||||
|
|
||||||
static final String EXTRA_TITLE = "keyboard_layout_picker_title";
|
static final String EXTRA_TITLE = "keyboard_layout_picker_title";
|
||||||
static final String EXTRA_USER_ID = "user_id";
|
static final String EXTRA_USER_ID = "user_id";
|
@@ -308,7 +308,7 @@ public class KeyboardLayoutDialogFragment extends InstrumentedDialogFragment
|
|||||||
public Keyboards loadInBackground() {
|
public Keyboards loadInBackground() {
|
||||||
Keyboards keyboards = new Keyboards();
|
Keyboards keyboards = new Keyboards();
|
||||||
InputManager im = (InputManager)getContext().getSystemService(Context.INPUT_SERVICE);
|
InputManager im = (InputManager)getContext().getSystemService(Context.INPUT_SERVICE);
|
||||||
if (mInputDeviceIdentifier == null || NewKeyboardSettingsUtils.getInputDevice(
|
if (mInputDeviceIdentifier == null || InputPeripheralsSettingsUtils.getInputDevice(
|
||||||
im, mInputDeviceIdentifier) == null) {
|
im, mInputDeviceIdentifier) == null) {
|
||||||
keyboards.keyboardLayouts.add(null); // default layout
|
keyboards.keyboardLayouts.add(null); // default layout
|
||||||
keyboards.current = 0;
|
keyboards.current = 0;
|
||||||
|
@@ -68,11 +68,13 @@ public class KeyboardLayoutPickerController extends BasePreferenceController imp
|
|||||||
public void onStart() {
|
public void onStart() {
|
||||||
mIm.registerInputDeviceListener(this, null);
|
mIm.registerInputDeviceListener(this, null);
|
||||||
if (mInputDeviceIdentifier == null
|
if (mInputDeviceIdentifier == null
|
||||||
|| NewKeyboardSettingsUtils.getInputDevice(mIm, mInputDeviceIdentifier) == null) {
|
|| InputPeripheralsSettingsUtils.getInputDevice(mIm, mInputDeviceIdentifier)
|
||||||
|
== null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mInputDeviceId =
|
mInputDeviceId =
|
||||||
NewKeyboardSettingsUtils.getInputDevice(mIm, mInputDeviceIdentifier).getId();
|
InputPeripheralsSettingsUtils.getInputDevice(mIm,
|
||||||
|
mInputDeviceIdentifier).getId();
|
||||||
updateCheckedState();
|
updateCheckedState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -46,7 +46,7 @@ public class KeyboardLayoutPickerFragment extends DashboardFragment {
|
|||||||
final InputDeviceIdentifier inputDeviceIdentifier = getActivity().getIntent().
|
final InputDeviceIdentifier inputDeviceIdentifier = getActivity().getIntent().
|
||||||
getParcelableExtra(EXTRA_INPUT_DEVICE_IDENTIFIER);
|
getParcelableExtra(EXTRA_INPUT_DEVICE_IDENTIFIER);
|
||||||
final InputManager im = context.getSystemService(InputManager.class);
|
final InputManager im = context.getSystemService(InputManager.class);
|
||||||
if (NewKeyboardSettingsUtils.getInputDevice(im, inputDeviceIdentifier) == null) {
|
if (InputPeripheralsSettingsUtils.getInputDevice(im, inputDeviceIdentifier) == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
use(KeyboardLayoutPickerController.class).initialize(this /*parent*/,
|
use(KeyboardLayoutPickerController.class).initialize(this /*parent*/,
|
||||||
|
@@ -40,7 +40,7 @@ import com.android.settings.Utils;
|
|||||||
import com.android.settings.core.SubSettingLauncher;
|
import com.android.settings.core.SubSettingLauncher;
|
||||||
import com.android.settings.dashboard.DashboardFragment;
|
import com.android.settings.dashboard.DashboardFragment;
|
||||||
import com.android.settings.dashboard.profileselector.ProfileSelectFragment;
|
import com.android.settings.dashboard.profileselector.ProfileSelectFragment;
|
||||||
import com.android.settings.inputmethod.NewKeyboardSettingsUtils.KeyboardInfo;
|
import com.android.settings.inputmethod.InputPeripheralsSettingsUtils.KeyboardInfo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@@ -117,14 +117,15 @@ public class NewKeyboardLayoutEnabledLocalesFragment extends DashboardFragment
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mInputDeviceIdentifier =
|
mInputDeviceIdentifier =
|
||||||
arguments.getParcelable(NewKeyboardSettingsUtils.EXTRA_INPUT_DEVICE_IDENTIFIER,
|
arguments.getParcelable(
|
||||||
|
InputPeripheralsSettingsUtils.EXTRA_INPUT_DEVICE_IDENTIFIER,
|
||||||
InputDeviceIdentifier.class);
|
InputDeviceIdentifier.class);
|
||||||
if (mInputDeviceIdentifier == null) {
|
if (mInputDeviceIdentifier == null) {
|
||||||
Log.e(TAG, "The inputDeviceIdentifier should not be null");
|
Log.e(TAG, "The inputDeviceIdentifier should not be null");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
InputDevice inputDevice =
|
InputDevice inputDevice =
|
||||||
NewKeyboardSettingsUtils.getInputDevice(mIm, mInputDeviceIdentifier);
|
InputPeripheralsSettingsUtils.getInputDevice(mIm, mInputDeviceIdentifier);
|
||||||
if (inputDevice == null) {
|
if (inputDevice == null) {
|
||||||
Log.e(TAG, "inputDevice is null");
|
Log.e(TAG, "inputDevice is null");
|
||||||
return;
|
return;
|
||||||
@@ -138,7 +139,7 @@ public class NewKeyboardLayoutEnabledLocalesFragment extends DashboardFragment
|
|||||||
super.onStart();
|
super.onStart();
|
||||||
mIm.registerInputDeviceListener(this, null);
|
mIm.registerInputDeviceListener(this, null);
|
||||||
InputDevice inputDevice =
|
InputDevice inputDevice =
|
||||||
NewKeyboardSettingsUtils.getInputDevice(mIm, mInputDeviceIdentifier);
|
InputPeripheralsSettingsUtils.getInputDevice(mIm, mInputDeviceIdentifier);
|
||||||
if (inputDevice == null) {
|
if (inputDevice == null) {
|
||||||
Log.e(TAG, "Unable to start: input device is null");
|
Log.e(TAG, "Unable to start: input device is null");
|
||||||
getActivity().finish();
|
getActivity().finish();
|
||||||
@@ -161,7 +162,7 @@ public class NewKeyboardLayoutEnabledLocalesFragment extends DashboardFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateCheckedState() {
|
private void updateCheckedState() {
|
||||||
if (NewKeyboardSettingsUtils.getInputDevice(mIm, mInputDeviceIdentifier) == null) {
|
if (InputPeripheralsSettingsUtils.getInputDevice(mIm, mInputDeviceIdentifier) == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,9 +208,9 @@ public class NewKeyboardLayoutEnabledLocalesFragment extends DashboardFragment
|
|||||||
private void mapLanguageWithLayout(InputMethodInfo info, InputMethodSubtype subtype) {
|
private void mapLanguageWithLayout(InputMethodInfo info, InputMethodSubtype subtype) {
|
||||||
CharSequence subtypeLabel = getSubtypeLabel(mContext, info, subtype);
|
CharSequence subtypeLabel = getSubtypeLabel(mContext, info, subtype);
|
||||||
KeyboardLayout[] keyboardLayouts =
|
KeyboardLayout[] keyboardLayouts =
|
||||||
NewKeyboardSettingsUtils.getKeyboardLayouts(
|
InputPeripheralsSettingsUtils.getKeyboardLayouts(
|
||||||
mIm, mUserId, mInputDeviceIdentifier, info, subtype);
|
mIm, mUserId, mInputDeviceIdentifier, info, subtype);
|
||||||
KeyboardLayoutSelectionResult result = NewKeyboardSettingsUtils.getKeyboardLayout(
|
KeyboardLayoutSelectionResult result = InputPeripheralsSettingsUtils.getKeyboardLayout(
|
||||||
mIm, mUserId, mInputDeviceIdentifier, info, subtype);
|
mIm, mUserId, mInputDeviceIdentifier, info, subtype);
|
||||||
if (result.getLayoutDescriptor() != null) {
|
if (result.getLayoutDescriptor() != null) {
|
||||||
for (int i = 0; i < keyboardLayouts.length; i++) {
|
for (int i = 0; i < keyboardLayouts.length; i++) {
|
||||||
@@ -316,13 +317,14 @@ public class NewKeyboardLayoutEnabledLocalesFragment extends DashboardFragment
|
|||||||
InputMethodSubtype inputMethodSubtype) {
|
InputMethodSubtype inputMethodSubtype) {
|
||||||
Bundle arguments = new Bundle();
|
Bundle arguments = new Bundle();
|
||||||
arguments.putParcelable(
|
arguments.putParcelable(
|
||||||
NewKeyboardSettingsUtils.EXTRA_INPUT_DEVICE_IDENTIFIER, inputDeviceIdentifier);
|
InputPeripheralsSettingsUtils.EXTRA_INPUT_DEVICE_IDENTIFIER,
|
||||||
|
inputDeviceIdentifier);
|
||||||
arguments.putParcelable(
|
arguments.putParcelable(
|
||||||
NewKeyboardSettingsUtils.EXTRA_INPUT_METHOD_INFO, inputMethodInfo);
|
InputPeripheralsSettingsUtils.EXTRA_INPUT_METHOD_INFO, inputMethodInfo);
|
||||||
arguments.putParcelable(
|
arguments.putParcelable(
|
||||||
NewKeyboardSettingsUtils.EXTRA_INPUT_METHOD_SUBTYPE, inputMethodSubtype);
|
InputPeripheralsSettingsUtils.EXTRA_INPUT_METHOD_SUBTYPE, inputMethodSubtype);
|
||||||
arguments.putInt(NewKeyboardSettingsUtils.EXTRA_USER_ID, userId);
|
arguments.putInt(InputPeripheralsSettingsUtils.EXTRA_USER_ID, userId);
|
||||||
arguments.putCharSequence(NewKeyboardSettingsUtils.EXTRA_TITLE, subtypeLabel);
|
arguments.putCharSequence(InputPeripheralsSettingsUtils.EXTRA_TITLE, subtypeLabel);
|
||||||
new SubSettingLauncher(mContext)
|
new SubSettingLauncher(mContext)
|
||||||
.setSourceMetricsCategory(getMetricsCategory())
|
.setSourceMetricsCategory(getMetricsCategory())
|
||||||
.setDestination(NewKeyboardLayoutPickerFragment.class.getName())
|
.setDestination(NewKeyboardLayoutPickerFragment.class.getName())
|
||||||
|
@@ -48,9 +48,9 @@ public class NewKeyboardLayoutPickerContent extends DashboardFragment {
|
|||||||
InputManager im = getContext().getSystemService(InputManager.class);
|
InputManager im = getContext().getSystemService(InputManager.class);
|
||||||
InputDeviceIdentifier identifier =
|
InputDeviceIdentifier identifier =
|
||||||
getArguments().getParcelable(
|
getArguments().getParcelable(
|
||||||
NewKeyboardSettingsUtils.EXTRA_INPUT_DEVICE_IDENTIFIER);
|
InputPeripheralsSettingsUtils.EXTRA_INPUT_DEVICE_IDENTIFIER);
|
||||||
if (identifier == null
|
if (identifier == null
|
||||||
|| NewKeyboardSettingsUtils.getInputDevice(im, identifier) == null) {
|
|| InputPeripheralsSettingsUtils.getInputDevice(im, identifier) == null) {
|
||||||
getActivity().finish();
|
getActivity().finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -73,19 +73,21 @@ public class NewKeyboardLayoutPickerController extends BasePreferenceController
|
|||||||
public void initialize(Fragment parent) {
|
public void initialize(Fragment parent) {
|
||||||
mParent = parent;
|
mParent = parent;
|
||||||
Bundle arguments = parent.getArguments();
|
Bundle arguments = parent.getArguments();
|
||||||
mTitle = arguments.getCharSequence(NewKeyboardSettingsUtils.EXTRA_TITLE);
|
mTitle = arguments.getCharSequence(InputPeripheralsSettingsUtils.EXTRA_TITLE);
|
||||||
mUserId = arguments.getInt(NewKeyboardSettingsUtils.EXTRA_USER_ID);
|
mUserId = arguments.getInt(InputPeripheralsSettingsUtils.EXTRA_USER_ID);
|
||||||
mInputDeviceIdentifier =
|
mInputDeviceIdentifier =
|
||||||
arguments.getParcelable(NewKeyboardSettingsUtils.EXTRA_INPUT_DEVICE_IDENTIFIER);
|
arguments.getParcelable(
|
||||||
|
InputPeripheralsSettingsUtils.EXTRA_INPUT_DEVICE_IDENTIFIER);
|
||||||
mInputMethodInfo =
|
mInputMethodInfo =
|
||||||
arguments.getParcelable(NewKeyboardSettingsUtils.EXTRA_INPUT_METHOD_INFO);
|
arguments.getParcelable(InputPeripheralsSettingsUtils.EXTRA_INPUT_METHOD_INFO);
|
||||||
mInputMethodSubtype =
|
mInputMethodSubtype =
|
||||||
arguments.getParcelable(NewKeyboardSettingsUtils.EXTRA_INPUT_METHOD_SUBTYPE);
|
arguments.getParcelable(
|
||||||
|
InputPeripheralsSettingsUtils.EXTRA_INPUT_METHOD_SUBTYPE);
|
||||||
mLayout = getSelectedLayoutLabel();
|
mLayout = getSelectedLayoutLabel();
|
||||||
mFinalSelectedLayout = mLayout;
|
mFinalSelectedLayout = mLayout;
|
||||||
mKeyboardLayouts = mIm.getKeyboardLayoutListForInputDevice(
|
mKeyboardLayouts = mIm.getKeyboardLayoutListForInputDevice(
|
||||||
mInputDeviceIdentifier, mUserId, mInputMethodInfo, mInputMethodSubtype);
|
mInputDeviceIdentifier, mUserId, mInputMethodInfo, mInputMethodSubtype);
|
||||||
NewKeyboardSettingsUtils.sortKeyboardLayoutsByLabel(mKeyboardLayouts);
|
InputPeripheralsSettingsUtils.sortKeyboardLayoutsByLabel(mKeyboardLayouts);
|
||||||
parent.getActivity().setTitle(mTitle);
|
parent.getActivity().setTitle(mTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,11 +95,13 @@ public class NewKeyboardLayoutPickerController extends BasePreferenceController
|
|||||||
public void onStart() {
|
public void onStart() {
|
||||||
mIm.registerInputDeviceListener(this, null);
|
mIm.registerInputDeviceListener(this, null);
|
||||||
if (mInputDeviceIdentifier == null
|
if (mInputDeviceIdentifier == null
|
||||||
|| NewKeyboardSettingsUtils.getInputDevice(mIm, mInputDeviceIdentifier) == null) {
|
|| InputPeripheralsSettingsUtils.getInputDevice(mIm, mInputDeviceIdentifier)
|
||||||
|
== null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mInputDeviceId =
|
mInputDeviceId =
|
||||||
NewKeyboardSettingsUtils.getInputDevice(mIm, mInputDeviceIdentifier).getId();
|
InputPeripheralsSettingsUtils.getInputDevice(mIm,
|
||||||
|
mInputDeviceIdentifier).getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -202,9 +206,9 @@ public class NewKeyboardLayoutPickerController extends BasePreferenceController
|
|||||||
|
|
||||||
private String getSelectedLayoutLabel() {
|
private String getSelectedLayoutLabel() {
|
||||||
String label = mContext.getString(R.string.keyboard_default_layout);
|
String label = mContext.getString(R.string.keyboard_default_layout);
|
||||||
KeyboardLayoutSelectionResult result = NewKeyboardSettingsUtils.getKeyboardLayout(
|
KeyboardLayoutSelectionResult result = InputPeripheralsSettingsUtils.getKeyboardLayout(
|
||||||
mIm, mUserId, mInputDeviceIdentifier, mInputMethodInfo, mInputMethodSubtype);
|
mIm, mUserId, mInputDeviceIdentifier, mInputMethodInfo, mInputMethodSubtype);
|
||||||
KeyboardLayout[] keyboardLayouts = NewKeyboardSettingsUtils.getKeyboardLayouts(
|
KeyboardLayout[] keyboardLayouts = InputPeripheralsSettingsUtils.getKeyboardLayouts(
|
||||||
mIm, mUserId, mInputDeviceIdentifier, mInputMethodInfo, mInputMethodSubtype);
|
mIm, mUserId, mInputDeviceIdentifier, mInputMethodInfo, mInputMethodSubtype);
|
||||||
if (result.getLayoutDescriptor() != null) {
|
if (result.getLayoutDescriptor() != null) {
|
||||||
for (KeyboardLayout keyboardLayout : keyboardLayouts) {
|
for (KeyboardLayout keyboardLayout : keyboardLayouts) {
|
||||||
|
@@ -317,7 +317,7 @@ public final class PhysicalKeyboardFragment extends DashboardFragment
|
|||||||
final Preference pref = new Preference(getPrefContext());
|
final Preference pref = new Preference(getPrefContext());
|
||||||
pref.setTitle(hardKeyboardDeviceInfo.mDeviceName);
|
pref.setTitle(hardKeyboardDeviceInfo.mDeviceName);
|
||||||
String currentLayout =
|
String currentLayout =
|
||||||
NewKeyboardSettingsUtils.getSelectedKeyboardLayoutLabelForUser(context,
|
InputPeripheralsSettingsUtils.getSelectedKeyboardLayoutLabelForUser(context,
|
||||||
UserHandle.myUserId(), hardKeyboardDeviceInfo.mDeviceIdentifier);
|
UserHandle.myUserId(), hardKeyboardDeviceInfo.mDeviceIdentifier);
|
||||||
if (currentLayout != null) {
|
if (currentLayout != null) {
|
||||||
pref.setSummary(currentLayout);
|
pref.setSummary(currentLayout);
|
||||||
@@ -369,7 +369,7 @@ public final class PhysicalKeyboardFragment extends DashboardFragment
|
|||||||
|
|
||||||
private void showEnabledLocalesKeyboardLayoutList(InputDeviceIdentifier inputDeviceIdentifier) {
|
private void showEnabledLocalesKeyboardLayoutList(InputDeviceIdentifier inputDeviceIdentifier) {
|
||||||
Bundle arguments = new Bundle();
|
Bundle arguments = new Bundle();
|
||||||
arguments.putParcelable(NewKeyboardSettingsUtils.EXTRA_INPUT_DEVICE_IDENTIFIER,
|
arguments.putParcelable(InputPeripheralsSettingsUtils.EXTRA_INPUT_DEVICE_IDENTIFIER,
|
||||||
inputDeviceIdentifier);
|
inputDeviceIdentifier);
|
||||||
new SubSettingLauncher(getContext())
|
new SubSettingLauncher(getContext())
|
||||||
.setSourceMetricsCategory(getMetricsCategory())
|
.setSourceMetricsCategory(getMetricsCategory())
|
||||||
|
@@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
package com.android.settings.inputmethod;
|
package com.android.settings.inputmethod;
|
||||||
|
|
||||||
import static com.android.settings.inputmethod.NewKeyboardSettingsUtils.isMouse;
|
import static com.android.settings.inputmethod.InputPeripheralsSettingsUtils.isMouse;
|
||||||
import static com.android.settings.inputmethod.NewKeyboardSettingsUtils.isTouchpad;
|
import static com.android.settings.inputmethod.InputPeripheralsSettingsUtils.isTouchpad;
|
||||||
|
|
||||||
import android.app.settings.SettingsEnums;
|
import android.app.settings.SettingsEnums;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
@@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
package com.android.settings.inputmethod;
|
package com.android.settings.inputmethod;
|
||||||
|
|
||||||
import static com.android.settings.inputmethod.NewKeyboardSettingsUtils.isMouse;
|
import static com.android.settings.inputmethod.InputPeripheralsSettingsUtils.isMouse;
|
||||||
import static com.android.settings.inputmethod.NewKeyboardSettingsUtils.isTouchpad;
|
import static com.android.settings.inputmethod.InputPeripheralsSettingsUtils.isTouchpad;
|
||||||
|
|
||||||
import android.app.settings.SettingsEnums;
|
import android.app.settings.SettingsEnums;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
@@ -32,8 +32,8 @@ public class PointerTouchpadPreferenceController extends BasePreferenceControlle
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAvailabilityStatus() {
|
public int getAvailabilityStatus() {
|
||||||
boolean isTouchpad = NewKeyboardSettingsUtils.isTouchpad();
|
boolean isTouchpad = InputPeripheralsSettingsUtils.isTouchpad();
|
||||||
boolean isMouse = NewKeyboardSettingsUtils.isMouse();
|
boolean isMouse = InputPeripheralsSettingsUtils.isMouse();
|
||||||
return (isTouchpad || isMouse) ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
return (isTouchpad || isMouse) ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -74,7 +74,7 @@ public class TouchGesturesButtonPreferenceController extends BasePreferenceContr
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAvailabilityStatus() {
|
public int getAvailabilityStatus() {
|
||||||
boolean isTouchpad = NewKeyboardSettingsUtils.isTouchpad();
|
boolean isTouchpad = InputPeripheralsSettingsUtils.isTouchpad();
|
||||||
return isTouchpad ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
return isTouchpad ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package com.android.settings.inputmethod;
|
package com.android.settings.inputmethod;
|
||||||
|
|
||||||
import static com.android.settings.inputmethod.NewKeyboardSettingsUtils.isTouchpad;
|
import static com.android.settings.inputmethod.InputPeripheralsSettingsUtils.isTouchpad;
|
||||||
|
|
||||||
import android.app.settings.SettingsEnums;
|
import android.app.settings.SettingsEnums;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
@@ -65,7 +65,7 @@ public class TouchpadThreeFingerTapPreferenceController extends BasePreferenceCo
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAvailabilityStatus() {
|
public int getAvailabilityStatus() {
|
||||||
boolean isTouchpad = NewKeyboardSettingsUtils.isTouchpad();
|
boolean isTouchpad = InputPeripheralsSettingsUtils.isTouchpad();
|
||||||
return (InputSettings.isTouchpadThreeFingerTapShortcutFeatureFlagEnabled() && isTouchpad)
|
return (InputSettings.isTouchpadThreeFingerTapShortcutFeatureFlagEnabled() && isTouchpad)
|
||||||
? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
@@ -49,7 +49,7 @@ public class TrackpadBottomPreferenceController extends TogglePreferenceControll
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAvailabilityStatus() {
|
public int getAvailabilityStatus() {
|
||||||
boolean isTouchpad = NewKeyboardSettingsUtils.isTouchpad();
|
boolean isTouchpad = InputPeripheralsSettingsUtils.isTouchpad();
|
||||||
return isTouchpad ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
return isTouchpad ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -49,7 +49,7 @@ public class TrackpadReverseScrollingPreferenceController extends TogglePreferen
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAvailabilityStatus() {
|
public int getAvailabilityStatus() {
|
||||||
boolean isTouchpad = NewKeyboardSettingsUtils.isTouchpad();
|
boolean isTouchpad = InputPeripheralsSettingsUtils.isTouchpad();
|
||||||
return isTouchpad ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
return isTouchpad ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -43,7 +43,7 @@ public class TrackpadSettings extends DashboardFragment {
|
|||||||
public void onCreate(@NonNull Bundle icicle) {
|
public void onCreate(@NonNull Bundle icicle) {
|
||||||
super.onCreate(icicle);
|
super.onCreate(icicle);
|
||||||
getPreferenceScreen().setTitle(
|
getPreferenceScreen().setTitle(
|
||||||
NewKeyboardSettingsUtils.getTouchpadAndMouseTitleTitleResId());
|
InputPeripheralsSettingsUtils.getTouchpadAndMouseTitleTitleResId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -67,7 +67,7 @@ public class TrackpadSettings extends DashboardFragment {
|
|||||||
protected boolean isPageSearchEnabled(Context context) {
|
protected boolean isPageSearchEnabled(Context context) {
|
||||||
return FeatureFlagUtils
|
return FeatureFlagUtils
|
||||||
.isEnabled(context, FeatureFlagUtils.SETTINGS_NEW_KEYBOARD_TRACKPAD)
|
.isEnabled(context, FeatureFlagUtils.SETTINGS_NEW_KEYBOARD_TRACKPAD)
|
||||||
&& NewKeyboardSettingsUtils.isTouchpad();
|
&& InputPeripheralsSettingsUtils.isTouchpad();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -77,17 +77,17 @@ public class TrackpadSettingsController extends BasePreferenceController
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mPreference.setVisible(isAvailable());
|
mPreference.setVisible(isAvailable());
|
||||||
mPreference.setTitle(NewKeyboardSettingsUtils.getTouchpadAndMouseTitleTitleResId());
|
mPreference.setTitle(InputPeripheralsSettingsUtils.getTouchpadAndMouseTitleTitleResId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAvailabilityStatus() {
|
public int getAvailabilityStatus() {
|
||||||
boolean isFeatureOn = FeatureFlagUtils
|
boolean isFeatureOn = FeatureFlagUtils
|
||||||
.isEnabled(mContext, FeatureFlagUtils.SETTINGS_NEW_KEYBOARD_TRACKPAD);
|
.isEnabled(mContext, FeatureFlagUtils.SETTINGS_NEW_KEYBOARD_TRACKPAD);
|
||||||
boolean isTouchpad = NewKeyboardSettingsUtils.isTouchpad();
|
boolean isTouchpad = InputPeripheralsSettingsUtils.isTouchpad();
|
||||||
boolean isPointerCustomizationEnabled =
|
boolean isPointerCustomizationEnabled =
|
||||||
android.view.flags.Flags.enableVectorCursorA11ySettings();
|
android.view.flags.Flags.enableVectorCursorA11ySettings();
|
||||||
boolean isMouse = NewKeyboardSettingsUtils.isMouse();
|
boolean isMouse = InputPeripheralsSettingsUtils.isMouse();
|
||||||
return (isFeatureOn && isTouchpad) || (isPointerCustomizationEnabled && isMouse) ? AVAILABLE
|
return (isFeatureOn && isTouchpad) || (isPointerCustomizationEnabled && isMouse) ? AVAILABLE
|
||||||
: CONDITIONALLY_UNAVAILABLE;
|
: CONDITIONALLY_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
@@ -49,7 +49,7 @@ public class TrackpadTapDraggingPreferenceController extends TogglePreferenceCon
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAvailabilityStatus() {
|
public int getAvailabilityStatus() {
|
||||||
boolean isTouchpad = NewKeyboardSettingsUtils.isTouchpad();
|
boolean isTouchpad = InputPeripheralsSettingsUtils.isTouchpad();
|
||||||
return (InputSettings.isTouchpadTapDraggingFeatureFlagEnabled() && isTouchpad)
|
return (InputSettings.isTouchpadTapDraggingFeatureFlagEnabled() && isTouchpad)
|
||||||
? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
@@ -49,7 +49,7 @@ public class TrackpadTapToClickPreferenceController extends TogglePreferenceCont
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAvailabilityStatus() {
|
public int getAvailabilityStatus() {
|
||||||
boolean isTouchpad = NewKeyboardSettingsUtils.isTouchpad();
|
boolean isTouchpad = InputPeripheralsSettingsUtils.isTouchpad();
|
||||||
return isTouchpad ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
return isTouchpad ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -59,7 +59,7 @@ public class TrackpadTouchGestureSettings extends DashboardFragment {
|
|||||||
.isEnabled(
|
.isEnabled(
|
||||||
context,
|
context,
|
||||||
FeatureFlagUtils.SETTINGS_NEW_KEYBOARD_TRACKPAD_GESTURE)
|
FeatureFlagUtils.SETTINGS_NEW_KEYBOARD_TRACKPAD_GESTURE)
|
||||||
&& NewKeyboardSettingsUtils.isTouchpad();
|
&& InputPeripheralsSettingsUtils.isTouchpad();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -31,7 +31,7 @@ public class TrackpadTouchGestureSettingsController extends BasePreferenceContro
|
|||||||
public int getAvailabilityStatus() {
|
public int getAvailabilityStatus() {
|
||||||
boolean isFeatureOn = FeatureFlagUtils
|
boolean isFeatureOn = FeatureFlagUtils
|
||||||
.isEnabled(mContext, FeatureFlagUtils.SETTINGS_NEW_KEYBOARD_TRACKPAD_GESTURE);
|
.isEnabled(mContext, FeatureFlagUtils.SETTINGS_NEW_KEYBOARD_TRACKPAD_GESTURE);
|
||||||
boolean isTouchpad = NewKeyboardSettingsUtils.isTouchpad();
|
boolean isTouchpad = InputPeripheralsSettingsUtils.isTouchpad();
|
||||||
return (isFeatureOn && isTouchpad) ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
return (isFeatureOn && isTouchpad) ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -125,7 +125,7 @@ public class CellularSecurityPreferenceController extends BasePreferenceControll
|
|||||||
return super.handlePreferenceTreeClick(preference);
|
return super.handlePreferenceTreeClick(preference);
|
||||||
}
|
}
|
||||||
boolean isSafetyCenterSupported = isSafetyCenterSupported();
|
boolean isSafetyCenterSupported = isSafetyCenterSupported();
|
||||||
if (isSafetyCenterSupported) {
|
if (isSafetyCenterSupported && areNotificationsEnabled()) {
|
||||||
Intent safetyCenterIntent = new Intent(Intent.ACTION_SAFETY_CENTER);
|
Intent safetyCenterIntent = new Intent(Intent.ACTION_SAFETY_CENTER);
|
||||||
safetyCenterIntent.putExtra(SafetyCenterManager.EXTRA_SAFETY_SOURCES_GROUP_ID,
|
safetyCenterIntent.putExtra(SafetyCenterManager.EXTRA_SAFETY_SOURCES_GROUP_ID,
|
||||||
"AndroidCellularNetworkSecuritySources");
|
"AndroidCellularNetworkSecuritySources");
|
||||||
|
@@ -36,6 +36,7 @@ public class UserCapabilities {
|
|||||||
boolean mIsAdmin;
|
boolean mIsAdmin;
|
||||||
boolean mIsGuest;
|
boolean mIsGuest;
|
||||||
boolean mIsEphemeral;
|
boolean mIsEphemeral;
|
||||||
|
boolean mUserSwitchingUiEnabled;
|
||||||
boolean mUserSwitcherEnabled;
|
boolean mUserSwitcherEnabled;
|
||||||
boolean mCanAddGuest;
|
boolean mCanAddGuest;
|
||||||
boolean mDisallowAddUser;
|
boolean mDisallowAddUser;
|
||||||
@@ -68,7 +69,8 @@ public class UserCapabilities {
|
|||||||
caps.mCanAddRestrictedProfile =
|
caps.mCanAddRestrictedProfile =
|
||||||
offerRestricted && !dpm.isDeviceManaged() && userManager.isUserTypeEnabled(
|
offerRestricted && !dpm.isDeviceManaged() && userManager.isUserTypeEnabled(
|
||||||
UserManager.USER_TYPE_FULL_RESTRICTED);
|
UserManager.USER_TYPE_FULL_RESTRICTED);
|
||||||
|
caps.mUserSwitchingUiEnabled = context.getResources().getBoolean(
|
||||||
|
com.android.internal.R.bool.config_allowChangeUserSwitcherEnabled);
|
||||||
caps.updateAddUserCapabilities(context);
|
caps.updateAddUserCapabilities(context);
|
||||||
return caps;
|
return caps;
|
||||||
}
|
}
|
||||||
@@ -134,6 +136,7 @@ public class UserCapabilities {
|
|||||||
", mEnforcedAdmin=" + mEnforcedAdmin +
|
", mEnforcedAdmin=" + mEnforcedAdmin +
|
||||||
", mDisallowSwitchUser=" + mDisallowSwitchUser +
|
", mDisallowSwitchUser=" + mDisallowSwitchUser +
|
||||||
", mDisallowAddUserSetByAdmin=" + mDisallowAddUserSetByAdmin +
|
", mDisallowAddUserSetByAdmin=" + mDisallowAddUserSetByAdmin +
|
||||||
|
", mUserSwitchingUiEnabled=" + mUserSwitchingUiEnabled +
|
||||||
", mUserSwitcherEnabled=" + mUserSwitcherEnabled +
|
", mUserSwitcherEnabled=" + mUserSwitcherEnabled +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
|
@@ -354,6 +354,8 @@ public class UserDetailsSettings extends SettingsPreferenceFragment
|
|||||||
|
|
||||||
mGrantAdminPref.setChecked(mUserInfo.isAdmin());
|
mGrantAdminPref.setChecked(mUserInfo.isAdmin());
|
||||||
|
|
||||||
|
mSwitchUserPref.setVisible(mUserCaps.mUserSwitchingUiEnabled);
|
||||||
|
|
||||||
mSwitchUserPref.setTitle(
|
mSwitchUserPref.setTitle(
|
||||||
context.getString(com.android.settingslib.R.string.user_switch_to_user,
|
context.getString(com.android.settingslib.R.string.user_switch_to_user,
|
||||||
mUserInfo.name));
|
mUserInfo.name));
|
||||||
|
@@ -287,7 +287,7 @@ public class UserSettings extends SettingsPreferenceFragment
|
|||||||
final SettingsActivity activity = (SettingsActivity) getActivity();
|
final SettingsActivity activity = (SettingsActivity) getActivity();
|
||||||
final SettingsMainSwitchBar switchBar = activity.getSwitchBar();
|
final SettingsMainSwitchBar switchBar = activity.getSwitchBar();
|
||||||
switchBar.setTitle(getContext().getString(R.string.multiple_users_main_switch_title));
|
switchBar.setTitle(getContext().getString(R.string.multiple_users_main_switch_title));
|
||||||
if (!mUserCaps.mIsGuest) {
|
if (!mUserCaps.mIsGuest && mUserCaps.mUserSwitchingUiEnabled) {
|
||||||
switchBar.show();
|
switchBar.show();
|
||||||
} else {
|
} else {
|
||||||
switchBar.hide();
|
switchBar.hide();
|
||||||
|
@@ -31,7 +31,6 @@ import android.content.pm.ActivityInfo;
|
|||||||
import android.content.pm.ApplicationInfo;
|
import android.content.pm.ApplicationInfo;
|
||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
import android.content.pm.ServiceInfo;
|
import android.content.pm.ServiceInfo;
|
||||||
import android.platform.test.annotations.DisableFlags;
|
|
||||||
import android.platform.test.annotations.EnableFlags;
|
import android.platform.test.annotations.EnableFlags;
|
||||||
import android.platform.test.flag.junit.SetFlagsRule;
|
import android.platform.test.flag.junit.SetFlagsRule;
|
||||||
|
|
||||||
@@ -141,27 +140,10 @@ public class RestrictedPreferenceHelperTest {
|
|||||||
assertThat(preference.getKey()).isEqualTo(key);
|
assertThat(preference.getKey()).isEqualTo(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@EnableFlags(value = {android.security.Flags.FLAG_EXTEND_ECM_TO_ALL_SETTINGS,
|
|
||||||
android.permission.flags.Flags.FLAG_ENHANCED_CONFIRMATION_MODE_APIS_ENABLED})
|
|
||||||
@DisableFlags(Flags.FLAG_NEVER_RESTRICT_ACCESSIBILITY_ACTIVITY)
|
|
||||||
public void createAccessibilityActivityPreference_ecmRestricted_prefIsEcmRestricted() {
|
|
||||||
setMockAccessibilityShortcutInfo(mShortcutInfo);
|
|
||||||
ShadowRestrictedLockUtilsInternal.setEcmRestrictedPkgs(PACKAGE_NAME);
|
|
||||||
|
|
||||||
final List<AccessibilityActivityPreference> preferenceList =
|
|
||||||
mHelper.createAccessibilityActivityPreferenceList(List.of(mShortcutInfo));
|
|
||||||
assertThat(preferenceList).hasSize(1);
|
|
||||||
final RestrictedPreference preference = preferenceList.get(0);
|
|
||||||
|
|
||||||
assertThat(preference.isDisabledByEcm()).isTrue();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@EnableFlags(value = {
|
@EnableFlags(value = {
|
||||||
android.security.Flags.FLAG_EXTEND_ECM_TO_ALL_SETTINGS,
|
android.security.Flags.FLAG_EXTEND_ECM_TO_ALL_SETTINGS,
|
||||||
android.permission.flags.Flags.FLAG_ENHANCED_CONFIRMATION_MODE_APIS_ENABLED,
|
android.permission.flags.Flags.FLAG_ENHANCED_CONFIRMATION_MODE_APIS_ENABLED,
|
||||||
Flags.FLAG_NEVER_RESTRICT_ACCESSIBILITY_ACTIVITY,
|
|
||||||
})
|
})
|
||||||
public void createAccessibilityActivityPreference_ecmRestricted_prefIsNotEcmRestricted() {
|
public void createAccessibilityActivityPreference_ecmRestricted_prefIsNotEcmRestricted() {
|
||||||
setMockAccessibilityShortcutInfo(mShortcutInfo);
|
setMockAccessibilityShortcutInfo(mShortcutInfo);
|
||||||
|
@@ -72,7 +72,7 @@ public class TrackpadSettingsControllerTest {
|
|||||||
InputDevice.SOURCE_TOUCHPAD);
|
InputDevice.SOURCE_TOUCHPAD);
|
||||||
ShadowInputDevice.addDevice(deviceId, device);
|
ShadowInputDevice.addDevice(deviceId, device);
|
||||||
String expectedTitle = mContext.getString(
|
String expectedTitle = mContext.getString(
|
||||||
NewKeyboardSettingsUtils.getTouchpadAndMouseTitleTitleResId());
|
InputPeripheralsSettingsUtils.getTouchpadAndMouseTitleTitleResId());
|
||||||
|
|
||||||
mController.updateState(mPreference);
|
mController.updateState(mPreference);
|
||||||
|
|
||||||
|
@@ -152,6 +152,10 @@ public final class CellularSecurityPreferenceControllerTest {
|
|||||||
public void handlePreferenceTreeClick_safetyCenterSupported_shouldRedirectToSafetyCenter() {
|
public void handlePreferenceTreeClick_safetyCenterSupported_shouldRedirectToSafetyCenter() {
|
||||||
final ArgumentCaptor<Intent> intentCaptor = ArgumentCaptor.forClass(Intent.class);
|
final ArgumentCaptor<Intent> intentCaptor = ArgumentCaptor.forClass(Intent.class);
|
||||||
|
|
||||||
|
doReturn(true).when(mTelephonyManager).isNullCipherNotificationsEnabled();
|
||||||
|
doReturn(true).when(mTelephonyManager)
|
||||||
|
.isCellularIdentifierDisclosureNotificationsEnabled();
|
||||||
|
doReturn(true).when(mTelephonyManager).isNullCipherAndIntegrityPreferenceEnabled();
|
||||||
boolean prefHandled = mController.handlePreferenceTreeClick(mPreference);
|
boolean prefHandled = mController.handlePreferenceTreeClick(mPreference);
|
||||||
|
|
||||||
assertThat(prefHandled).isTrue();
|
assertThat(prefHandled).isTrue();
|
||||||
|
Reference in New Issue
Block a user