Enable use_resource_processor for all sysui deps
This will make the build faster Test: m checkbuild Bug: 295208392 Change-Id: If75acb6b1c3f204e3686c20cef609f7cfabe15cf
This commit is contained in:
@@ -63,7 +63,7 @@ public class FlashNotificationsPreviewPreference extends Preference {
|
|||||||
private void init() {
|
private void init() {
|
||||||
setLayoutResource(R.layout.flash_notification_preview_preference);
|
setLayoutResource(R.layout.flash_notification_preview_preference);
|
||||||
mBackgroundEnabled = getContext().getDrawable(
|
mBackgroundEnabled = getContext().getDrawable(
|
||||||
com.android.settingslib.widget.R.drawable.settingslib_switch_bar_bg_on);
|
com.android.settingslib.widget.mainswitch.R.drawable.settingslib_switch_bar_bg_on);
|
||||||
mBackgroundDisabled = getContext().getDrawable(R.drawable.switch_bar_bg_disabled);
|
mBackgroundDisabled = getContext().getDrawable(R.drawable.switch_bar_bg_disabled);
|
||||||
mTextColorDisabled = Utils.getColorAttrDefaultColor(getContext(),
|
mTextColorDisabled = Utils.getColorAttrDefaultColor(getContext(),
|
||||||
android.R.attr.textColorPrimary);
|
android.R.attr.textColorPrimary);
|
||||||
|
@@ -81,7 +81,7 @@ public class VibrationSettings extends DashboardFragment {
|
|||||||
R.integer.config_vibration_supported_intensity_levels);
|
R.integer.config_vibration_supported_intensity_levels);
|
||||||
if (rv != null && supportedIntensities > 1) {
|
if (rv != null && supportedIntensities > 1) {
|
||||||
final int bottom_padding = res.getDimensionPixelSize(
|
final int bottom_padding = res.getDimensionPixelSize(
|
||||||
com.android.settingslib.widget.R.dimen.settingslib_listPreferredItemPaddingEnd);
|
com.android.settingslib.widget.theme.R.dimen.settingslib_listPreferredItemPaddingEnd);
|
||||||
rv.setPaddingRelative(rv.getPaddingStart(), rv.getPaddingTop(), rv.getPaddingEnd(),
|
rv.setPaddingRelative(rv.getPaddingStart(), rv.getPaddingTop(), rv.getPaddingEnd(),
|
||||||
rv.getPaddingBottom() + bottom_padding);
|
rv.getPaddingBottom() + bottom_padding);
|
||||||
}
|
}
|
||||||
|
@@ -93,7 +93,7 @@ public class AccountTypePreferenceLoader {
|
|||||||
desc.packageName, 0, mUserHandle);
|
desc.packageName, 0, mUserHandle);
|
||||||
final Theme baseTheme = mFragment.getResources().newTheme();
|
final Theme baseTheme = mFragment.getResources().newTheme();
|
||||||
baseTheme.applyStyle(
|
baseTheme.applyStyle(
|
||||||
com.android.settingslib.widget.R.style.Theme_SettingsBase, true);
|
com.android.settingslib.widget.theme.R.style.Theme_SettingsBase, true);
|
||||||
final Context themedCtx =
|
final Context themedCtx =
|
||||||
new LocalClassLoaderContextThemeWrapper(getClass(), targetCtx, 0);
|
new LocalClassLoaderContextThemeWrapper(getClass(), targetCtx, 0);
|
||||||
themedCtx.getTheme().setTo(baseTheme);
|
themedCtx.getTheme().setTo(baseTheme);
|
||||||
|
@@ -127,7 +127,8 @@ public class RadioWithImagePreference extends CheckBoxPreference {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
setWidgetLayoutResource(R.layout.preference_widget_radiobutton);
|
setWidgetLayoutResource(
|
||||||
|
com.android.settingslib.widget.preference.radio.R.layout.preference_widget_radiobutton);
|
||||||
setLayoutResource(R.layout.radio_with_image_preference);
|
setLayoutResource(R.layout.radio_with_image_preference);
|
||||||
setIconSpaceReserved(false);
|
setIconSpaceReserved(false);
|
||||||
}
|
}
|
||||||
|
@@ -88,7 +88,7 @@ public class ExternalSourcesDetails extends AppInfoWithHeader
|
|||||||
UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY,
|
UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY,
|
||||||
userHandle);
|
userHandle);
|
||||||
if ((userRestrictionSource & UserManager.RESTRICTION_SOURCE_SYSTEM) != 0) {
|
if ((userRestrictionSource & UserManager.RESTRICTION_SOURCE_SYSTEM) != 0) {
|
||||||
return context.getString(com.android.settingslib.widget.R.string.disabled_by_admin);
|
return context.getString(com.android.settingslib.widget.restricted.R.string.disabled_by_admin);
|
||||||
} else if (userRestrictionSource != 0) {
|
} else if (userRestrictionSource != 0) {
|
||||||
return context.getString(com.android.settingslib.R.string.disabled);
|
return context.getString(com.android.settingslib.R.string.disabled);
|
||||||
}
|
}
|
||||||
|
@@ -73,7 +73,7 @@ public class ApplicationViewHolder extends RecyclerView.ViewHolder {
|
|||||||
mAppName = itemView.findViewById(android.R.id.title);
|
mAppName = itemView.findViewById(android.R.id.title);
|
||||||
mAppIcon = itemView.findViewById(android.R.id.icon);
|
mAppIcon = itemView.findViewById(android.R.id.icon);
|
||||||
mSummary = itemView.findViewById(android.R.id.summary);
|
mSummary = itemView.findViewById(android.R.id.summary);
|
||||||
mDisabled = itemView.findViewById(com.android.settingslib.widget.R.id.appendix);
|
mDisabled = itemView.findViewById(com.android.settingslib.widget.preference.app.R.id.appendix);
|
||||||
mSwitch = itemView.findViewById(R.id.switchWidget);
|
mSwitch = itemView.findViewById(R.id.switchWidget);
|
||||||
mWidgetContainer = itemView.findViewById(android.R.id.widget_frame);
|
mWidgetContainer = itemView.findViewById(android.R.id.widget_frame);
|
||||||
mAddIcon = itemView.findViewById(R.id.add_preference_widget);
|
mAddIcon = itemView.findViewById(R.id.add_preference_widget);
|
||||||
@@ -86,7 +86,7 @@ public class ApplicationViewHolder extends RecyclerView.ViewHolder {
|
|||||||
|
|
||||||
static View newView(ViewGroup parent, boolean twoTarget, int listType) {
|
static View newView(ViewGroup parent, boolean twoTarget, int listType) {
|
||||||
ViewGroup view = (ViewGroup) LayoutInflater.from(parent.getContext())
|
ViewGroup view = (ViewGroup) LayoutInflater.from(parent.getContext())
|
||||||
.inflate(com.android.settingslib.widget.R.layout.preference_app, parent, false);
|
.inflate(com.android.settingslib.widget.preference.app.R.layout.preference_app, parent, false);
|
||||||
ViewGroup widgetFrame = view.findViewById(android.R.id.widget_frame);
|
ViewGroup widgetFrame = view.findViewById(android.R.id.widget_frame);
|
||||||
if (twoTarget) {
|
if (twoTarget) {
|
||||||
if (widgetFrame != null) {
|
if (widgetFrame != null) {
|
||||||
@@ -98,7 +98,7 @@ public class ApplicationViewHolder extends RecyclerView.ViewHolder {
|
|||||||
.inflate(R.layout.preference_widget_primary_switch, widgetFrame, true);
|
.inflate(R.layout.preference_widget_primary_switch, widgetFrame, true);
|
||||||
}
|
}
|
||||||
View divider = LayoutInflater.from(parent.getContext()).inflate(
|
View divider = LayoutInflater.from(parent.getContext()).inflate(
|
||||||
com.android.settingslib.widget.R.layout.preference_two_target_divider,
|
com.android.settingslib.widget.preference.twotarget.R.layout.preference_two_target_divider,
|
||||||
view, false);
|
view, false);
|
||||||
// second to last, before widget frame
|
// second to last, before widget frame
|
||||||
view.addView(divider, view.getChildCount() - 1);
|
view.addView(divider, view.getChildCount() - 1);
|
||||||
@@ -111,7 +111,7 @@ public class ApplicationViewHolder extends RecyclerView.ViewHolder {
|
|||||||
|
|
||||||
static View newHeader(ViewGroup parent, int resText) {
|
static View newHeader(ViewGroup parent, int resText) {
|
||||||
ViewGroup view = (ViewGroup) LayoutInflater.from(parent.getContext())
|
ViewGroup view = (ViewGroup) LayoutInflater.from(parent.getContext())
|
||||||
.inflate(com.android.settingslib.widget.R.layout.preference_app_header,
|
.inflate(com.android.settingslib.widget.preference.app.R.layout.preference_app_header,
|
||||||
parent, false);
|
parent, false);
|
||||||
TextView textView = view.findViewById(R.id.apps_top_intro_text);
|
TextView textView = view.findViewById(R.id.apps_top_intro_text);
|
||||||
textView.setText(resText);
|
textView.setText(resText);
|
||||||
|
@@ -209,7 +209,7 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
final ImageView personalIconView = mHeader.findViewById(
|
final ImageView personalIconView = mHeader.findViewById(
|
||||||
com.android.settingslib.widget.R.id.entity_header_icon_personal);
|
com.android.settingslib.widget.preference.layout.R.id.entity_header_icon_personal);
|
||||||
if (personalIconView != null) {
|
if (personalIconView != null) {
|
||||||
Drawable icon = IconDrawableFactory.newInstance(mContext)
|
Drawable icon = IconDrawableFactory.newInstance(mContext)
|
||||||
.getBadgedIcon(mPackageInfo.applicationInfo, personalProfile.getIdentifier())
|
.getBadgedIcon(mPackageInfo.applicationInfo, personalProfile.getIdentifier())
|
||||||
@@ -221,7 +221,7 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
final ImageView workIconView = mHeader.findViewById(
|
final ImageView workIconView = mHeader.findViewById(
|
||||||
com.android.settingslib.widget.R.id.entity_header_icon_work);
|
com.android.settingslib.widget.preference.layout.R.id.entity_header_icon_work);
|
||||||
if (workIconView != null) {
|
if (workIconView != null) {
|
||||||
Drawable icon = IconDrawableFactory.newInstance(mContext)
|
Drawable icon = IconDrawableFactory.newInstance(mContext)
|
||||||
.getBadgedIcon(mPackageInfo.applicationInfo, workProfile.getIdentifier())
|
.getBadgedIcon(mPackageInfo.applicationInfo, workProfile.getIdentifier())
|
||||||
@@ -502,11 +502,11 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
|||||||
mSwitchPref.setChecked(true);
|
mSwitchPref.setChecked(true);
|
||||||
mSwitchPref.setTitle(R.string.interact_across_profiles_switch_enabled);
|
mSwitchPref.setTitle(R.string.interact_across_profiles_switch_enabled);
|
||||||
final ImageView horizontalArrowIcon =
|
final ImageView horizontalArrowIcon =
|
||||||
mHeader.findViewById(com.android.settingslib.widget.R.id.entity_header_swap_horiz);
|
mHeader.findViewById(com.android.settingslib.widget.preference.layout.R.id.entity_header_swap_horiz);
|
||||||
if (horizontalArrowIcon != null) {
|
if (horizontalArrowIcon != null) {
|
||||||
horizontalArrowIcon.setImageDrawable(
|
horizontalArrowIcon.setImageDrawable(
|
||||||
mContext.getDrawable(
|
mContext.getDrawable(
|
||||||
com.android.settingslib.widget.R.drawable.ic_swap_horiz_blue));
|
com.android.settingslib.widget.preference.layout.R.drawable.ic_swap_horiz_blue));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -514,11 +514,11 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
|||||||
mSwitchPref.setChecked(false);
|
mSwitchPref.setChecked(false);
|
||||||
mSwitchPref.setTitle(R.string.interact_across_profiles_switch_disabled);
|
mSwitchPref.setTitle(R.string.interact_across_profiles_switch_disabled);
|
||||||
final ImageView horizontalArrowIcon =
|
final ImageView horizontalArrowIcon =
|
||||||
mHeader.findViewById(com.android.settingslib.widget.R.id.entity_header_swap_horiz);
|
mHeader.findViewById(com.android.settingslib.widget.preference.layout.R.id.entity_header_swap_horiz);
|
||||||
if (horizontalArrowIcon != null) {
|
if (horizontalArrowIcon != null) {
|
||||||
horizontalArrowIcon.setImageDrawable(
|
horizontalArrowIcon.setImageDrawable(
|
||||||
mContext.getDrawable(
|
mContext.getDrawable(
|
||||||
com.android.settingslib.widget.R.drawable.ic_swap_horiz_grey));
|
com.android.settingslib.widget.preference.layout.R.drawable.ic_swap_horiz_grey));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -113,7 +113,7 @@ public class BluetoothBroadcastDialog extends InstrumentedDialogFragment {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mAlertDialog = new AlertDialog.Builder(mContext,
|
mAlertDialog = new AlertDialog.Builder(mContext,
|
||||||
com.android.settingslib.widget.R.style.Theme_AlertDialog_SettingsLib)
|
com.android.settingslib.widget.theme.R.style.Theme_AlertDialog_SettingsLib)
|
||||||
.setView(layout)
|
.setView(layout)
|
||||||
.create();
|
.create();
|
||||||
|
|
||||||
|
@@ -60,7 +60,7 @@ class BluetoothBroadcastSourcePreference extends Preference {
|
|||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(final PreferenceViewHolder view) {
|
public void onBindViewHolder(final PreferenceViewHolder view) {
|
||||||
super.onBindViewHolder(view);
|
super.onBindViewHolder(view);
|
||||||
view.findViewById(com.android.settingslib.widget.R.id.two_target_divider)
|
view.findViewById(com.android.settingslib.widget.preference.twotarget.R.id.two_target_divider)
|
||||||
.setVisibility(View.INVISIBLE);
|
.setVisibility(View.INVISIBLE);
|
||||||
final ImageButton imageButton =
|
final ImageButton imageButton =
|
||||||
(ImageButton) view.findViewById(com.android.settingslib.R.id.icon_button);
|
(ImageButton) view.findViewById(com.android.settingslib.R.id.icon_button);
|
||||||
|
@@ -111,9 +111,9 @@ public class SettingsBaseActivity extends FragmentActivity implements CategoryHa
|
|||||||
|
|
||||||
if (isToolbarEnabled() && !isAnySetupWizard) {
|
if (isToolbarEnabled() && !isAnySetupWizard) {
|
||||||
super.setContentView(
|
super.setContentView(
|
||||||
com.android.settingslib.widget.R.layout.collapsing_toolbar_base_layout);
|
com.android.settingslib.collapsingtoolbar.R.layout.collapsing_toolbar_base_layout);
|
||||||
mCollapsingToolbarLayout =
|
mCollapsingToolbarLayout =
|
||||||
findViewById(com.android.settingslib.widget.R.id.collapsing_toolbar);
|
findViewById(com.android.settingslib.collapsingtoolbar.R.id.collapsing_toolbar);
|
||||||
mAppBarLayout = findViewById(R.id.app_bar);
|
mAppBarLayout = findViewById(R.id.app_bar);
|
||||||
if (mCollapsingToolbarLayout != null) {
|
if (mCollapsingToolbarLayout != null) {
|
||||||
mCollapsingToolbarLayout.setLineSpacingMultiplier(TOOLBAR_LINE_SPACING_MULTIPLIER);
|
mCollapsingToolbarLayout.setLineSpacingMultiplier(TOOLBAR_LINE_SPACING_MULTIPLIER);
|
||||||
|
@@ -176,7 +176,7 @@ public class UnrestrictedDataAccessPreference extends AppSwitchPreference implem
|
|||||||
if (mDataUsageState != null) {
|
if (mDataUsageState != null) {
|
||||||
setChecked(mDataUsageState.isDataSaverAllowlisted);
|
setChecked(mDataUsageState.isDataSaverAllowlisted);
|
||||||
if (isDisabledByAdmin()) {
|
if (isDisabledByAdmin()) {
|
||||||
setSummary(com.android.settingslib.widget.R.string.disabled_by_admin);
|
setSummary(com.android.settingslib.widget.restricted.R.string.disabled_by_admin);
|
||||||
} else if (mDataUsageState.isDataSaverDenylisted) {
|
} else if (mDataUsageState.isDataSaverDenylisted) {
|
||||||
setSummary(R.string.restrict_background_blocklisted);
|
setSummary(R.string.restrict_background_blocklisted);
|
||||||
} else {
|
} else {
|
||||||
|
@@ -36,7 +36,7 @@ public class AppViewHolder {
|
|||||||
static public AppViewHolder createOrRecycle(LayoutInflater inflater, View convertView) {
|
static public AppViewHolder createOrRecycle(LayoutInflater inflater, View convertView) {
|
||||||
if (convertView == null) {
|
if (convertView == null) {
|
||||||
convertView =
|
convertView =
|
||||||
inflater.inflate(com.android.settingslib.widget.R.layout.preference_app, null);
|
inflater.inflate(com.android.settingslib.widget.preference.app.R.layout.preference_app, null);
|
||||||
|
|
||||||
// Creates a ViewHolder and store references to the two children views
|
// Creates a ViewHolder and store references to the two children views
|
||||||
// we want to bind data to.
|
// we want to bind data to.
|
||||||
@@ -46,7 +46,7 @@ public class AppViewHolder {
|
|||||||
holder.appIcon = convertView.findViewById(android.R.id.icon);
|
holder.appIcon = convertView.findViewById(android.R.id.icon);
|
||||||
holder.summary = convertView.findViewById(android.R.id.summary);
|
holder.summary = convertView.findViewById(android.R.id.summary);
|
||||||
holder.disabled =
|
holder.disabled =
|
||||||
convertView.findViewById(com.android.settingslib.widget.R.id.appendix);
|
convertView.findViewById(com.android.settingslib.widget.preference.app.R.id.appendix);
|
||||||
holder.widget = convertView.findViewById(android.R.id.widget_frame);
|
holder.widget = convertView.findViewById(android.R.id.widget_frame);
|
||||||
convertView.setTag(holder);
|
convertView.setTag(holder);
|
||||||
return holder;
|
return holder;
|
||||||
|
@@ -108,7 +108,7 @@ public class ScreenResolutionFragment extends RadioButtonPickerFragment {
|
|||||||
footerPreference.setTitle(R.string.screen_resolution_footer);
|
footerPreference.setTitle(R.string.screen_resolution_footer);
|
||||||
footerPreference.setSelectable(false);
|
footerPreference.setSelectable(false);
|
||||||
footerPreference.setLayoutResource(
|
footerPreference.setLayoutResource(
|
||||||
com.android.settingslib.widget.R.layout.preference_footer);
|
com.android.settingslib.widget.preference.footer.R.layout.preference_footer);
|
||||||
screen.addPreference(footerPreference);
|
screen.addPreference(footerPreference);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -129,7 +129,7 @@ public class ScreenTimeoutSettings extends RadioButtonPickerFragment implements
|
|||||||
mPrivacyPreference.setTitle(R.string.adaptive_sleep_privacy);
|
mPrivacyPreference.setTitle(R.string.adaptive_sleep_privacy);
|
||||||
mPrivacyPreference.setSelectable(false);
|
mPrivacyPreference.setSelectable(false);
|
||||||
mPrivacyPreference.setLayoutResource(
|
mPrivacyPreference.setLayoutResource(
|
||||||
com.android.settingslib.widget.R.layout.preference_footer);
|
com.android.settingslib.widget.preference.footer.R.layout.preference_footer);
|
||||||
mPrivacyManager = SensorPrivacyManager.getInstance(context);
|
mPrivacyManager = SensorPrivacyManager.getInstance(context);
|
||||||
mPrivacyChangedListener = (sensor, enabled) -> mAdaptiveSleepController.updatePreference();
|
mPrivacyChangedListener = (sensor, enabled) -> mAdaptiveSleepController.updatePreference();
|
||||||
}
|
}
|
||||||
@@ -203,7 +203,7 @@ public class ScreenTimeoutSettings extends RadioButtonPickerFragment implements
|
|||||||
mPrivacyPreference.setTitle(R.string.adaptive_sleep_privacy);
|
mPrivacyPreference.setTitle(R.string.adaptive_sleep_privacy);
|
||||||
mPrivacyPreference.setSelectable(false);
|
mPrivacyPreference.setSelectable(false);
|
||||||
mPrivacyPreference.setLayoutResource(
|
mPrivacyPreference.setLayoutResource(
|
||||||
com.android.settingslib.widget.R.layout.preference_footer);
|
com.android.settingslib.widget.preference.footer.R.layout.preference_footer);
|
||||||
|
|
||||||
if (isScreenAttentionAvailable(getContext())) {
|
if (isScreenAttentionAvailable(getContext())) {
|
||||||
mAdaptiveSleepPermissionController.addToScreen(screen);
|
mAdaptiveSleepPermissionController.addToScreen(screen);
|
||||||
|
@@ -271,7 +271,7 @@ public class NetworkProviderSettings extends RestrictedSettingsFragment
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setPinnedHeaderView(com.android.settingslib.widget.R.layout.progress_header);
|
setPinnedHeaderView(com.android.settingslib.widget.progressbar.R.layout.progress_header);
|
||||||
setProgressBarVisible(false);
|
setProgressBarVisible(false);
|
||||||
|
|
||||||
if (hasWifiManager()) {
|
if (hasWifiManager()) {
|
||||||
|
@@ -195,8 +195,8 @@ public class NetworkSelectSettings extends DashboardFragment {
|
|||||||
final Activity activity = getActivity();
|
final Activity activity = getActivity();
|
||||||
if (activity != null) {
|
if (activity != null) {
|
||||||
mProgressHeader = setPinnedHeaderView(
|
mProgressHeader = setPinnedHeaderView(
|
||||||
com.android.settingslib.widget.R.layout.progress_header)
|
com.android.settingslib.widget.progressbar.R.layout.progress_header)
|
||||||
.findViewById(com.android.settingslib.widget.R.id.progress_bar_animation);
|
.findViewById(com.android.settingslib.widget.progressbar.R.id.progress_bar_animation);
|
||||||
setProgressBarVisible(false);
|
setProgressBarVisible(false);
|
||||||
}
|
}
|
||||||
forceUpdateConnectedPreferenceCategory();
|
forceUpdateConnectedPreferenceCategory();
|
||||||
|
@@ -85,7 +85,7 @@ public class AndroidBeam extends InstrumentedFragment
|
|||||||
return new View(getContext());
|
return new View(getContext());
|
||||||
}
|
}
|
||||||
mView = inflater.inflate(
|
mView = inflater.inflate(
|
||||||
com.android.settingslib.widget.R.layout.preference_footer, container, false);
|
com.android.settingslib.widget.preference.footer.R.layout.preference_footer, container, false);
|
||||||
|
|
||||||
ImageView iconInfo = mView.findViewById(android.R.id.icon);
|
ImageView iconInfo = mView.findViewById(android.R.id.icon);
|
||||||
iconInfo.setImageResource(R.drawable.ic_info_outline_24dp);
|
iconInfo.setImageResource(R.drawable.ic_info_outline_24dp);
|
||||||
|
@@ -86,8 +86,8 @@ public class SearchMenuController implements LifecycleObserver, OnCreateOptionsM
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final MenuItem searchItem = menu.add(Menu.NONE, MENU_SEARCH, 0 /* order */,
|
final MenuItem searchItem = menu.add(Menu.NONE, MENU_SEARCH, 0 /* order */,
|
||||||
com.android.settingslib.search.R.string.search_menu);
|
com.android.settingslib.search.widget.R.string.search_menu);
|
||||||
searchItem.setIcon(com.android.settingslib.search.R.drawable.ic_search_24dp);
|
searchItem.setIcon(com.android.settingslib.search.widget.R.drawable.ic_search_24dp);
|
||||||
searchItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
|
searchItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
|
||||||
|
|
||||||
searchItem.setOnMenuItemClickListener(target -> {
|
searchItem.setOnMenuItemClickListener(target -> {
|
||||||
|
@@ -83,7 +83,7 @@ public class CredentialManagementAppHeaderController extends BasePreferenceContr
|
|||||||
TextView titleView = headerPref.findViewById(R.id.entity_header_title);
|
TextView titleView = headerPref.findViewById(R.id.entity_header_title);
|
||||||
TextView summary1 = headerPref.findViewById(R.id.entity_header_summary);
|
TextView summary1 = headerPref.findViewById(R.id.entity_header_summary);
|
||||||
TextView summary2 = headerPref.findViewById(
|
TextView summary2 = headerPref.findViewById(
|
||||||
com.android.settingslib.widget.R.id.entity_header_second_summary);
|
com.android.settingslib.widget.preference.layout.R.id.entity_header_second_summary);
|
||||||
summary2.setVisibility(View.GONE);
|
summary2.setVisibility(View.GONE);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@@ -227,7 +227,7 @@ public class SettingsSliceProvider extends SliceProvider {
|
|||||||
final boolean nightMode = Utils.isNightMode(getContext());
|
final boolean nightMode = Utils.isNightMode(getContext());
|
||||||
if (mNightMode == null) {
|
if (mNightMode == null) {
|
||||||
mNightMode = nightMode;
|
mNightMode = nightMode;
|
||||||
getContext().setTheme(com.android.settingslib.widget.R.style.Theme_SettingsBase);
|
getContext().setTheme(com.android.settingslib.widget.theme.R.style.Theme_SettingsBase);
|
||||||
} else if (mNightMode != nightMode) {
|
} else if (mNightMode != nightMode) {
|
||||||
Log.d(TAG, "Night mode changed, reload theme");
|
Log.d(TAG, "Night mode changed, reload theme");
|
||||||
mNightMode = nightMode;
|
mNightMode = nightMode;
|
||||||
|
@@ -71,7 +71,7 @@ public class VpnInfoPreference extends RestrictedPreference implements View.OnCl
|
|||||||
|
|
||||||
// Hide the divider from view
|
// Hide the divider from view
|
||||||
final View divider =
|
final View divider =
|
||||||
holder.findViewById(com.android.settingslib.widget.R.id.two_target_divider);
|
holder.findViewById(com.android.settingslib.widget.preference.twotarget.R.id.two_target_divider);
|
||||||
divider.setVisibility(View.GONE);
|
divider.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,20 +31,24 @@ import androidx.preference.PreferenceViewHolder;
|
|||||||
public class AppCheckBoxPreference extends CheckBoxPreference {
|
public class AppCheckBoxPreference extends CheckBoxPreference {
|
||||||
public AppCheckBoxPreference(Context context, AttributeSet attrs) {
|
public AppCheckBoxPreference(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
setLayoutResource(com.android.settingslib.widget.R.layout.preference_app);
|
setLayoutResource(com.android.settingslib.widget.preference.app.R.layout.preference_app);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AppCheckBoxPreference(Context context) {
|
public AppCheckBoxPreference(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
setLayoutResource(com.android.settingslib.widget.R.layout.preference_app);
|
setLayoutResource(com.android.settingslib.widget.preference.app.R.layout.preference_app);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(PreferenceViewHolder holder) {
|
public void onBindViewHolder(PreferenceViewHolder holder) {
|
||||||
super.onBindViewHolder(holder);
|
super.onBindViewHolder(holder);
|
||||||
|
|
||||||
final LinearLayout layout = (LinearLayout) holder
|
// NOTE: All the summary_container resources IDs in the different dependency widget packages
|
||||||
.findViewById(com.android.settingslib.widget.R.id.summary_container);
|
// are equivalent, so it does not matter which one we use. For example,
|
||||||
|
// com.android.settingslib.widget.preference.radio.R.id.summary_container ==
|
||||||
|
// com.android.settingslib.widget.preference.selector.R.id.summary_container
|
||||||
|
final LinearLayout layout = (LinearLayout) holder.findViewById(
|
||||||
|
com.android.settingslib.widget.preference.radio.R.id.summary_container);
|
||||||
if (layout != null) {
|
if (layout != null) {
|
||||||
// If summary doesn't exist, make it gone
|
// If summary doesn't exist, make it gone
|
||||||
layout.setVisibility(TextUtils.isEmpty(getSummary()) ? View.GONE : View.VISIBLE);
|
layout.setVisibility(TextUtils.isEmpty(getSummary()) ? View.GONE : View.VISIBLE);
|
||||||
|
@@ -110,7 +110,7 @@ public class EntityHeaderController {
|
|||||||
mHeader = header;
|
mHeader = header;
|
||||||
} else {
|
} else {
|
||||||
mHeader = LayoutInflater.from(fragment.getContext())
|
mHeader = LayoutInflater.from(fragment.getContext())
|
||||||
.inflate(com.android.settingslib.widget.R.layout.settings_entity_header,
|
.inflate(com.android.settingslib.widget.preference.layout.R.layout.settings_entity_header,
|
||||||
null /* root */);
|
null /* root */);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -236,9 +236,9 @@ public class EntityHeaderController {
|
|||||||
}
|
}
|
||||||
setText(R.id.entity_header_title, mLabel);
|
setText(R.id.entity_header_title, mLabel);
|
||||||
setText(R.id.entity_header_summary, mSummary);
|
setText(R.id.entity_header_summary, mSummary);
|
||||||
setText(com.android.settingslib.widget.R.id.entity_header_second_summary, mSecondSummary);
|
setText(com.android.settingslib.widget.preference.layout.R.id.entity_header_second_summary, mSecondSummary);
|
||||||
if (mIsInstantApp) {
|
if (mIsInstantApp) {
|
||||||
setText(com.android.settingslib.widget.R.id.install_type,
|
setText(com.android.settingslib.widget.preference.layout.R.id.install_type,
|
||||||
mHeader.getResources().getString(R.string.install_type_instant));
|
mHeader.getResources().getString(R.string.install_type_instant));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,7 +254,7 @@ public class EntityHeaderController {
|
|||||||
*/
|
*/
|
||||||
public EntityHeaderController bindHeaderButtons() {
|
public EntityHeaderController bindHeaderButtons() {
|
||||||
final View entityHeaderContent = mHeader.findViewById(
|
final View entityHeaderContent = mHeader.findViewById(
|
||||||
com.android.settingslib.widget.R.id.entity_header_content);
|
com.android.settingslib.widget.preference.layout.R.id.entity_header_content);
|
||||||
final ImageButton button1 = mHeader.findViewById(android.R.id.button1);
|
final ImageButton button1 = mHeader.findViewById(android.R.id.button1);
|
||||||
final ImageButton button2 = mHeader.findViewById(android.R.id.button2);
|
final ImageButton button2 = mHeader.findViewById(android.R.id.button2);
|
||||||
bindAppInfoLink(entityHeaderContent);
|
bindAppInfoLink(entityHeaderContent);
|
||||||
|
@@ -59,7 +59,7 @@ public class SingleTargetGearPreference extends Preference {
|
|||||||
public void onBindViewHolder(PreferenceViewHolder holder) {
|
public void onBindViewHolder(PreferenceViewHolder holder) {
|
||||||
super.onBindViewHolder(holder);
|
super.onBindViewHolder(holder);
|
||||||
final View divider = holder.findViewById(
|
final View divider = holder.findViewById(
|
||||||
com.android.settingslib.widget.R.id.two_target_divider);
|
com.android.settingslib.widget.preference.twotarget.R.id.two_target_divider);
|
||||||
if (divider != null) {
|
if (divider != null) {
|
||||||
divider.setVisibility(View.INVISIBLE);
|
divider.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
@@ -56,7 +56,7 @@ public class ConnectedWifiEntryPreference extends LongPressWifiEntryPreference i
|
|||||||
holder.findViewById(R.id.settings_button_no_background).setVisibility(
|
holder.findViewById(R.id.settings_button_no_background).setVisibility(
|
||||||
canSignIn ? View.INVISIBLE : View.VISIBLE);
|
canSignIn ? View.INVISIBLE : View.VISIBLE);
|
||||||
gear.setVisibility(canSignIn ? View.VISIBLE : View.INVISIBLE);
|
gear.setVisibility(canSignIn ? View.VISIBLE : View.INVISIBLE);
|
||||||
holder.findViewById(com.android.settingslib.widget.R.id.two_target_divider).setVisibility(
|
holder.findViewById(com.android.settingslib.widget.preference.twotarget.R.id.two_target_divider).setVisibility(
|
||||||
canSignIn ? View.VISIBLE : View.INVISIBLE);
|
canSignIn ? View.VISIBLE : View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -49,7 +49,7 @@ public class LinkablePreference extends Preference {
|
|||||||
|
|
||||||
public LinkablePreference(Context ctx, AttributeSet attrs) {
|
public LinkablePreference(Context ctx, AttributeSet attrs) {
|
||||||
this(ctx, attrs, TypedArrayUtils.getAttr(
|
this(ctx, attrs, TypedArrayUtils.getAttr(
|
||||||
ctx, com.android.settingslib.widget.R.attr.footerPreferenceStyle,
|
ctx, com.android.settingslib.widget.theme.R.attr.footerPreferenceStyle,
|
||||||
android.R.attr.preferenceStyle));
|
android.R.attr.preferenceStyle));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -326,7 +326,7 @@ public class NetworkRequestDialogFragment extends NetworkRequestDialogBaseFragme
|
|||||||
view = mInflater.inflate(mResourceId, parent, false);
|
view = mInflater.inflate(mResourceId, parent, false);
|
||||||
|
|
||||||
final View divider = view.findViewById(
|
final View divider = view.findViewById(
|
||||||
com.android.settingslib.widget.R.id.two_target_divider);
|
com.android.settingslib.widget.preference.twotarget.R.id.two_target_divider);
|
||||||
divider.setVisibility(View.GONE);
|
divider.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -122,7 +122,7 @@ public class WifiEntryPreference extends RestrictedPreference implements
|
|||||||
view.itemView.setContentDescription(mContentDescription);
|
view.itemView.setContentDescription(mContentDescription);
|
||||||
|
|
||||||
// Turn off divider
|
// Turn off divider
|
||||||
view.findViewById(com.android.settingslib.widget.R.id.two_target_divider)
|
view.findViewById(com.android.settingslib.widget.preference.twotarget.R.id.two_target_divider)
|
||||||
.setVisibility(View.INVISIBLE);
|
.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
// Enable the icon button when the help string in this WifiEntry is not null.
|
// Enable the icon button when the help string in this WifiEntry is not null.
|
||||||
|
@@ -550,7 +550,7 @@ public class AddAppNetworksFragment extends InstrumentedFragment implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
final View divider = view.findViewById(
|
final View divider = view.findViewById(
|
||||||
com.android.settingslib.widget.R.id.two_target_divider);
|
com.android.settingslib.widget.preference.twotarget.R.id.two_target_divider);
|
||||||
if (divider != null) {
|
if (divider != null) {
|
||||||
divider.setVisibility(View.GONE);
|
divider.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
@@ -68,7 +68,7 @@ public class WifiTetherSsidPreference extends ValidatedEditTextPreference {
|
|||||||
|
|
||||||
private void initialize() {
|
private void initialize() {
|
||||||
// TODO(b/129019971): use methods of divider line in parent object
|
// TODO(b/129019971): use methods of divider line in parent object
|
||||||
setLayoutResource(com.android.settingslib.widget.R.layout.preference_two_target);
|
setLayoutResource(com.android.settingslib.widget.preference.twotarget.R.layout.preference_two_target);
|
||||||
setWidgetLayoutResource(R.layout.wifi_button_preference_widget);
|
setWidgetLayoutResource(R.layout.wifi_button_preference_widget);
|
||||||
|
|
||||||
mShareIconDrawable = getDrawable(R.drawable.ic_qrcode_24dp);
|
mShareIconDrawable = getDrawable(R.drawable.ic_qrcode_24dp);
|
||||||
@@ -80,7 +80,7 @@ public class WifiTetherSsidPreference extends ValidatedEditTextPreference {
|
|||||||
|
|
||||||
final ImageButton shareButton = (ImageButton) holder.findViewById(R.id.button_icon);
|
final ImageButton shareButton = (ImageButton) holder.findViewById(R.id.button_icon);
|
||||||
final View dividerView = holder.findViewById(
|
final View dividerView = holder.findViewById(
|
||||||
com.android.settingslib.widget.R.id.two_target_divider);
|
com.android.settingslib.widget.preference.twotarget.R.id.two_target_divider);
|
||||||
|
|
||||||
if (mVisible) {
|
if (mVisible) {
|
||||||
shareButton.setOnClickListener(mClickListener);
|
shareButton.setOnClickListener(mClickListener);
|
||||||
|
@@ -73,7 +73,7 @@ public class AccessibilityFooterPreferenceControllerTest {
|
|||||||
|
|
||||||
final LayoutInflater inflater = LayoutInflater.from(mContext);
|
final LayoutInflater inflater = LayoutInflater.from(mContext);
|
||||||
final View view = inflater.inflate(
|
final View view = inflater.inflate(
|
||||||
com.android.settingslib.widget.R.layout.preference_footer, null);
|
com.android.settingslib.widget.preference.footer.R.layout.preference_footer, null);
|
||||||
mPreferenceViewHolder = PreferenceViewHolder.createInstanceForTests(view);
|
mPreferenceViewHolder = PreferenceViewHolder.createInstanceForTests(view);
|
||||||
mPreference.onBindViewHolder(mPreferenceViewHolder);
|
mPreference.onBindViewHolder(mPreferenceViewHolder);
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ public class AccessibilityFooterPreferenceControllerTest {
|
|||||||
mPreference.onBindViewHolder(mPreferenceViewHolder);
|
mPreference.onBindViewHolder(mPreferenceViewHolder);
|
||||||
|
|
||||||
final TextView learnMoreView = (TextView) mPreferenceViewHolder
|
final TextView learnMoreView = (TextView) mPreferenceViewHolder
|
||||||
.findViewById(com.android.settingslib.widget.R.id.settingslib_learn_more);
|
.findViewById(com.android.settingslib.widget.preference.footer.R.id.settingslib_learn_more);
|
||||||
assertThat(learnMoreView.getContentDescription()).isNull();
|
assertThat(learnMoreView.getContentDescription()).isNull();
|
||||||
assertThat(learnMoreView.getVisibility()).isEqualTo(View.GONE);
|
assertThat(learnMoreView.getVisibility()).isEqualTo(View.GONE);
|
||||||
assertThat(mPreference.isLinkEnabled()).isFalse();
|
assertThat(mPreference.isLinkEnabled()).isFalse();
|
||||||
|
@@ -46,7 +46,7 @@ public final class AccessibilityFooterPreferenceTest {
|
|||||||
|
|
||||||
final LayoutInflater inflater = LayoutInflater.from(context);
|
final LayoutInflater inflater = LayoutInflater.from(context);
|
||||||
final View view =
|
final View view =
|
||||||
inflater.inflate(com.android.settingslib.widget.R.layout.preference_footer, null);
|
inflater.inflate(com.android.settingslib.widget.preference.footer.R.layout.preference_footer, null);
|
||||||
mPreferenceViewHolder = PreferenceViewHolder.createInstanceForTests(view);
|
mPreferenceViewHolder = PreferenceViewHolder.createInstanceForTests(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -112,7 +112,7 @@ public class AccessibilityQuickSettingsPrimarySwitchPreferenceControllerTest {
|
|||||||
mPreference.setTitle(TEST_TITLE);
|
mPreference.setTitle(TEST_TITLE);
|
||||||
LayoutInflater inflater = LayoutInflater.from(mContext);
|
LayoutInflater inflater = LayoutInflater.from(mContext);
|
||||||
mHolder = PreferenceViewHolder.createInstanceForTests(inflater.inflate(
|
mHolder = PreferenceViewHolder.createInstanceForTests(inflater.inflate(
|
||||||
com.android.settingslib.widget.R.layout.preference_two_target, null));
|
com.android.settingslib.widget.preference.twotarget.R.layout.preference_two_target, null));
|
||||||
LinearLayout mWidgetView = mHolder.itemView.findViewById(android.R.id.widget_frame);
|
LinearLayout mWidgetView = mHolder.itemView.findViewById(android.R.id.widget_frame);
|
||||||
inflater.inflate(R.layout.preference_widget_primary_switch, mWidgetView, true);
|
inflater.inflate(R.layout.preference_widget_primary_switch, mWidgetView, true);
|
||||||
mPreference.onBindViewHolder(mHolder);
|
mPreference.onBindViewHolder(mHolder);
|
||||||
|
@@ -69,7 +69,7 @@ public class FlashNotificationsPreviewPreferenceTest {
|
|||||||
final View frame = mPreferenceViewHolder.findViewById(R.id.frame);
|
final View frame = mPreferenceViewHolder.findViewById(R.id.frame);
|
||||||
final int backgroundResId = Shadows.shadowOf(frame.getBackground()).getCreatedFromResId();
|
final int backgroundResId = Shadows.shadowOf(frame.getBackground()).getCreatedFromResId();
|
||||||
assertThat(backgroundResId).isEqualTo(
|
assertThat(backgroundResId).isEqualTo(
|
||||||
com.android.settingslib.widget.R.drawable.settingslib_switch_bar_bg_on);
|
com.android.settingslib.widget.mainswitch.R.drawable.settingslib_switch_bar_bg_on);
|
||||||
final TextView title = (TextView) mPreferenceViewHolder.findViewById(android.R.id.title);
|
final TextView title = (TextView) mPreferenceViewHolder.findViewById(android.R.id.title);
|
||||||
assertThat(title.getAlpha()).isEqualTo(1f);
|
assertThat(title.getAlpha()).isEqualTo(1f);
|
||||||
assertThat(title.getCurrentTextColor()).isEqualTo(textColorEnabled);
|
assertThat(title.getCurrentTextColor()).isEqualTo(textColorEnabled);
|
||||||
|
@@ -73,7 +73,7 @@ public class AccountHeaderPreferenceControllerTest {
|
|||||||
FakeFeatureFactory.setupForTest();
|
FakeFeatureFactory.setupForTest();
|
||||||
mHeaderPreference = new LayoutPreference(
|
mHeaderPreference = new LayoutPreference(
|
||||||
RuntimeEnvironment.application,
|
RuntimeEnvironment.application,
|
||||||
com.android.settingslib.widget.R.layout.settings_entity_header);
|
com.android.settingslib.widget.preference.layout.R.layout.settings_entity_header);
|
||||||
doReturn(RuntimeEnvironment.application).when(mActivity).getApplicationContext();
|
doReturn(RuntimeEnvironment.application).when(mActivity).getApplicationContext();
|
||||||
mLifecycleOwner = () -> mLifecycle;
|
mLifecycleOwner = () -> mLifecycle;
|
||||||
mLifecycle = new Lifecycle(mLifecycleOwner);
|
mLifecycle = new Lifecycle(mLifecycleOwner);
|
||||||
|
@@ -80,7 +80,7 @@ public class AppHeaderViewPreferenceControllerTest {
|
|||||||
mLifecycleOwner = () -> mLifecycle;
|
mLifecycleOwner = () -> mLifecycle;
|
||||||
mLifecycle = new Lifecycle(mLifecycleOwner);
|
mLifecycle = new Lifecycle(mLifecycleOwner);
|
||||||
mHeader = LayoutInflater.from(mContext).inflate(
|
mHeader = LayoutInflater.from(mContext).inflate(
|
||||||
com.android.settingslib.widget.R.layout.settings_entity_header, null);
|
com.android.settingslib.widget.preference.layout.R.layout.settings_entity_header, null);
|
||||||
|
|
||||||
when(mFragment.getActivity()).thenReturn(mActivity);
|
when(mFragment.getActivity()).thenReturn(mActivity);
|
||||||
when(mScreen.findPreference(anyString())).thenReturn(mPreference);
|
when(mScreen.findPreference(anyString())).thenReturn(mPreference);
|
||||||
|
@@ -72,7 +72,7 @@ public class DomainAppPreferenceControllerTest {
|
|||||||
final DomainAppPreference pref = new DomainAppPreference(mContext, mAppEntry);
|
final DomainAppPreference pref = new DomainAppPreference(mContext, mAppEntry);
|
||||||
|
|
||||||
assertThat(pref.getLayoutResource())
|
assertThat(pref.getLayoutResource())
|
||||||
.isEqualTo(com.android.settingslib.widget.R.layout.preference_app);
|
.isEqualTo(com.android.settingslib.widget.preference.app.R.layout.preference_app);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ApplicationInfo createApplicationInfo(String packageName) {
|
private ApplicationInfo createApplicationInfo(String packageName) {
|
||||||
|
@@ -55,10 +55,10 @@ public class BluetoothDetailsButtonsControllerTest extends BluetoothDetailsContr
|
|||||||
super.setUp();
|
super.setUp();
|
||||||
final View buttons = View.inflate(
|
final View buttons = View.inflate(
|
||||||
RuntimeEnvironment.application,
|
RuntimeEnvironment.application,
|
||||||
com.android.settingslib.widget.R.layout.settingslib_action_buttons,
|
com.android.settingslib.widget.preference.actionbuttons.R.layout.settingslib_action_buttons,
|
||||||
null /* parent */);
|
null /* parent */);
|
||||||
mConnectButton = buttons.findViewById(com.android.settingslib.widget.R.id.button2);
|
mConnectButton = buttons.findViewById(com.android.settingslib.widget.preference.actionbuttons.R.id.button2);
|
||||||
mForgetButton = buttons.findViewById(com.android.settingslib.widget.R.id.button1);
|
mForgetButton = buttons.findViewById(com.android.settingslib.widget.preference.actionbuttons.R.id.button1);
|
||||||
mController =
|
mController =
|
||||||
new BluetoothDetailsButtonsController(mContext, mFragment, mCachedDevice,
|
new BluetoothDetailsButtonsController(mContext, mFragment, mCachedDevice,
|
||||||
mLifecycle);
|
mLifecycle);
|
||||||
|
@@ -72,7 +72,7 @@ public class BluetoothDetailsHeaderControllerTest extends BluetoothDetailsContro
|
|||||||
mController =
|
mController =
|
||||||
new BluetoothDetailsHeaderController(mContext, mFragment, mCachedDevice, mLifecycle);
|
new BluetoothDetailsHeaderController(mContext, mFragment, mCachedDevice, mLifecycle);
|
||||||
mPreference = new LayoutPreference(
|
mPreference = new LayoutPreference(
|
||||||
mContext, com.android.settingslib.widget.R.layout.settings_entity_header);
|
mContext, com.android.settingslib.widget.preference.layout.R.layout.settings_entity_header);
|
||||||
mPreference.setKey(mController.getPreferenceKey());
|
mPreference.setKey(mController.getPreferenceKey());
|
||||||
mScreen.addPreference(mPreference);
|
mScreen.addPreference(mPreference);
|
||||||
setupDevice(mDeviceConfig);
|
setupDevice(mDeviceConfig);
|
||||||
|
@@ -94,7 +94,7 @@ public class UsbDetailsHeaderControllerTest {
|
|||||||
ShadowEntityHeaderController.setUseMock(mHeaderController);
|
ShadowEntityHeaderController.setUseMock(mHeaderController);
|
||||||
mDetailsHeaderController = new UsbDetailsHeaderController(mContext, mFragment, mUsbBackend);
|
mDetailsHeaderController = new UsbDetailsHeaderController(mContext, mFragment, mUsbBackend);
|
||||||
mPreference = new LayoutPreference(
|
mPreference = new LayoutPreference(
|
||||||
mContext, com.android.settingslib.widget.R.layout.settings_entity_header);
|
mContext, com.android.settingslib.widget.preference.layout.R.layout.settings_entity_header);
|
||||||
mPreference.setKey(mDetailsHeaderController.getPreferenceKey());
|
mPreference.setKey(mDetailsHeaderController.getPreferenceKey());
|
||||||
mScreen.addPreference(mPreference);
|
mScreen.addPreference(mPreference);
|
||||||
}
|
}
|
||||||
|
@@ -91,7 +91,7 @@ public class AppDataUsagePreferenceTest {
|
|||||||
mPreference = new AppDataUsagePreference(RuntimeEnvironment.application, mAppItem,
|
mPreference = new AppDataUsagePreference(RuntimeEnvironment.application, mAppItem,
|
||||||
50 /* percent */, mUidDetailProvider);
|
50 /* percent */, mUidDetailProvider);
|
||||||
final View view = LayoutInflater.from(RuntimeEnvironment.application).inflate(
|
final View view = LayoutInflater.from(RuntimeEnvironment.application).inflate(
|
||||||
com.android.settingslib.widget.R.layout.preference_app, null);
|
com.android.settingslib.widget.preference.app.R.layout.preference_app, null);
|
||||||
final PreferenceViewHolder preferenceViewHolder =
|
final PreferenceViewHolder preferenceViewHolder =
|
||||||
PreferenceViewHolder.createInstanceForTests(view);
|
PreferenceViewHolder.createInstanceForTests(view);
|
||||||
final ProgressBar progressBar = (ProgressBar) preferenceViewHolder.findViewById(
|
final ProgressBar progressBar = (ProgressBar) preferenceViewHolder.findViewById(
|
||||||
|
@@ -141,7 +141,7 @@ public class UnrestrictedDataAccessPreferenceControllerTest {
|
|||||||
assertThat(preference.isDisabledByAdmin()).isTrue();
|
assertThat(preference.isDisabledByAdmin()).isTrue();
|
||||||
assertThat(preference.getSummary()).isEqualTo(
|
assertThat(preference.getSummary()).isEqualTo(
|
||||||
mContext.getString(
|
mContext.getString(
|
||||||
com.android.settingslib.widget.R.string.disabled_by_admin));
|
com.android.settingslib.widget.restricted.R.string.disabled_by_admin));
|
||||||
}
|
}
|
||||||
assertThat(preference.isChecked()).isFalse();
|
assertThat(preference.isChecked()).isFalse();
|
||||||
preference.performClick();
|
preference.performClick();
|
||||||
|
@@ -54,7 +54,7 @@ public class PowerGaugePreferenceTest {
|
|||||||
|
|
||||||
mContext = RuntimeEnvironment.application;
|
mContext = RuntimeEnvironment.application;
|
||||||
mRootView = LayoutInflater.from(mContext)
|
mRootView = LayoutInflater.from(mContext)
|
||||||
.inflate(com.android.settingslib.widget.R.layout.preference_app, null);
|
.inflate(com.android.settingslib.widget.preference.app.R.layout.preference_app, null);
|
||||||
mWidgetView =
|
mWidgetView =
|
||||||
LayoutInflater.from(mContext).inflate(R.layout.preference_widget_summary, null);
|
LayoutInflater.from(mContext).inflate(R.layout.preference_widget_summary, null);
|
||||||
final LinearLayout widgetFrame = mRootView.findViewById(android.R.id.widget_frame);
|
final LinearLayout widgetFrame = mRootView.findViewById(android.R.id.widget_frame);
|
||||||
@@ -64,7 +64,7 @@ public class PowerGaugePreferenceTest {
|
|||||||
|
|
||||||
mPowerGaugePreference = new PowerGaugePreference(mContext);
|
mPowerGaugePreference = new PowerGaugePreference(mContext);
|
||||||
assertThat(mPowerGaugePreference.getLayoutResource())
|
assertThat(mPowerGaugePreference.getLayoutResource())
|
||||||
.isEqualTo(com.android.settingslib.widget.R.layout.preference_app);
|
.isEqualTo(com.android.settingslib.widget.preference.app.R.layout.preference_app);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@@ -80,7 +80,7 @@ public class RecentLocationAccessPreferenceControllerTest {
|
|||||||
mController.init(mDashboardFragment);
|
mController.init(mDashboardFragment);
|
||||||
final String key = mController.getPreferenceKey();
|
final String key = mController.getPreferenceKey();
|
||||||
mAppEntitiesHeaderView = LayoutInflater.from(mContext).inflate(
|
mAppEntitiesHeaderView = LayoutInflater.from(mContext).inflate(
|
||||||
com.android.settingslib.widget.R.layout.app_entities_header, null /* root */);
|
com.android.settingslib.widget.entityheader.R.layout.app_entities_header, null /* root */);
|
||||||
when(mScreen.findPreference(key)).thenReturn(mLayoutPreference);
|
when(mScreen.findPreference(key)).thenReturn(mLayoutPreference);
|
||||||
when(mLayoutPreference.getKey()).thenReturn(key);
|
when(mLayoutPreference.getKey()).thenReturn(key);
|
||||||
when(mLayoutPreference.getContext()).thenReturn(mContext);
|
when(mLayoutPreference.getContext()).thenReturn(mContext);
|
||||||
@@ -109,7 +109,7 @@ public class RecentLocationAccessPreferenceControllerTest {
|
|||||||
assertThat(title.getText()).isEqualTo(
|
assertThat(title.getText()).isEqualTo(
|
||||||
mContext.getText(R.string.location_category_recent_location_access));
|
mContext.getText(R.string.location_category_recent_location_access));
|
||||||
final TextView details = mAppEntitiesHeaderView
|
final TextView details = mAppEntitiesHeaderView
|
||||||
.findViewById(com.android.settingslib.widget.R.id.header_details);
|
.findViewById(com.android.settingslib.widget.entityheader.R.id.header_details);
|
||||||
assertThat(details.getText()).isEqualTo(
|
assertThat(details.getText()).isEqualTo(
|
||||||
mContext.getText(R.string.location_recent_location_access_view_details));
|
mContext.getText(R.string.location_recent_location_access_view_details));
|
||||||
assertThat(details.hasOnClickListeners()).isTrue();
|
assertThat(details.hasOnClickListeners()).isTrue();
|
||||||
|
@@ -74,7 +74,7 @@ public class SearchMenuControllerTest {
|
|||||||
|
|
||||||
when(mHost.getActivity()).thenReturn(mActivity);
|
when(mHost.getActivity()).thenReturn(mActivity);
|
||||||
when(mMenu.add(Menu.NONE, MENU_SEARCH, 0 /* order */,
|
when(mMenu.add(Menu.NONE, MENU_SEARCH, 0 /* order */,
|
||||||
com.android.settingslib.search.R.string.search_menu))
|
com.android.settingslib.search.widget.R.string.search_menu))
|
||||||
.thenReturn(mock(MenuItem.class));
|
.thenReturn(mock(MenuItem.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ public class SearchMenuControllerTest {
|
|||||||
mHost.getSettingsLifecycle().onCreateOptionsMenu(mMenu, null /* inflater */);
|
mHost.getSettingsLifecycle().onCreateOptionsMenu(mMenu, null /* inflater */);
|
||||||
|
|
||||||
verify(mMenu).add(Menu.NONE, MENU_SEARCH, 0 /* order */,
|
verify(mMenu).add(Menu.NONE, MENU_SEARCH, 0 /* order */,
|
||||||
com.android.settingslib.search.R.string.search_menu);
|
com.android.settingslib.search.widget.R.string.search_menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@@ -45,15 +45,15 @@ public class AppCheckBoxPreferenceTest {
|
|||||||
mAttrPreference = new AppCheckBoxPreference(mContext, null /* attrs */);
|
mAttrPreference = new AppCheckBoxPreference(mContext, null /* attrs */);
|
||||||
mPreferenceViewHolder = PreferenceViewHolder.createInstanceForTests(
|
mPreferenceViewHolder = PreferenceViewHolder.createInstanceForTests(
|
||||||
LayoutInflater.from(mContext)
|
LayoutInflater.from(mContext)
|
||||||
.inflate(com.android.settingslib.widget.R.layout.preference_app, null));
|
.inflate(com.android.settingslib.widget.preference.app.R.layout.preference_app, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetLayoutResource() {
|
public void testGetLayoutResource() {
|
||||||
assertThat(mPreference.getLayoutResource())
|
assertThat(mPreference.getLayoutResource())
|
||||||
.isEqualTo(com.android.settingslib.widget.R.layout.preference_app);
|
.isEqualTo(com.android.settingslib.widget.preference.app.R.layout.preference_app);
|
||||||
assertThat(mAttrPreference.getLayoutResource())
|
assertThat(mAttrPreference.getLayoutResource())
|
||||||
.isEqualTo(com.android.settingslib.widget.R.layout.preference_app);
|
.isEqualTo(com.android.settingslib.widget.preference.app.R.layout.preference_app);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -61,7 +61,7 @@ public class AppCheckBoxPreferenceTest {
|
|||||||
mPreference.onBindViewHolder(mPreferenceViewHolder);
|
mPreference.onBindViewHolder(mPreferenceViewHolder);
|
||||||
|
|
||||||
View appendix =
|
View appendix =
|
||||||
mPreferenceViewHolder.findViewById(com.android.settingslib.widget.R.id.appendix);
|
mPreferenceViewHolder.findViewById(com.android.settingslib.widget.preference.app.R.id.appendix);
|
||||||
assertThat(appendix.getVisibility()).isEqualTo(View.GONE);
|
assertThat(appendix.getVisibility()).isEqualTo(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -100,7 +100,7 @@ public class EntityHeaderControllerTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testBuildView_constructedWithView_shouldReturnSameView() {
|
public void testBuildView_constructedWithView_shouldReturnSameView() {
|
||||||
View inputView = mLayoutInflater.inflate(
|
View inputView = mLayoutInflater.inflate(
|
||||||
com.android.settingslib.widget.R.layout.settings_entity_header, null /* root */);
|
com.android.settingslib.widget.preference.layout.R.layout.settings_entity_header, null /* root */);
|
||||||
mController = EntityHeaderController.newInstance(mActivity, mFragment, inputView);
|
mController = EntityHeaderController.newInstance(mActivity, mFragment, inputView);
|
||||||
View view = mController.done();
|
View view = mController.done();
|
||||||
|
|
||||||
@@ -111,11 +111,11 @@ public class EntityHeaderControllerTest {
|
|||||||
public void bindViews_shouldBindAllData() {
|
public void bindViews_shouldBindAllData() {
|
||||||
final String testString = "test";
|
final String testString = "test";
|
||||||
final View header = mLayoutInflater.inflate(
|
final View header = mLayoutInflater.inflate(
|
||||||
com.android.settingslib.widget.R.layout.settings_entity_header, null /* root */);
|
com.android.settingslib.widget.preference.layout.R.layout.settings_entity_header, null /* root */);
|
||||||
final TextView label = header.findViewById(R.id.entity_header_title);
|
final TextView label = header.findViewById(R.id.entity_header_title);
|
||||||
final TextView summary = header.findViewById(R.id.entity_header_summary);
|
final TextView summary = header.findViewById(R.id.entity_header_summary);
|
||||||
final TextView secondSummary = header.findViewById(
|
final TextView secondSummary = header.findViewById(
|
||||||
com.android.settingslib.widget.R.id.entity_header_second_summary);
|
com.android.settingslib.widget.preference.layout.R.id.entity_header_second_summary);
|
||||||
|
|
||||||
mController = EntityHeaderController.newInstance(mActivity, mFragment, header);
|
mController = EntityHeaderController.newInstance(mActivity, mFragment, header);
|
||||||
mController.setLabel(testString);
|
mController.setLabel(testString);
|
||||||
@@ -139,7 +139,7 @@ public class EntityHeaderControllerTest {
|
|||||||
info.activityInfo.packageName = "123";
|
info.activityInfo.packageName = "123";
|
||||||
info.activityInfo.name = "321";
|
info.activityInfo.name = "321";
|
||||||
final View view = mLayoutInflater.inflate(
|
final View view = mLayoutInflater.inflate(
|
||||||
com.android.settingslib.widget.R.layout.settings_entity_header, null /* root */);
|
com.android.settingslib.widget.preference.layout.R.layout.settings_entity_header, null /* root */);
|
||||||
when(mActivity.getApplicationContext()).thenReturn(mContext);
|
when(mActivity.getApplicationContext()).thenReturn(mContext);
|
||||||
|
|
||||||
mController = EntityHeaderController.newInstance(mActivity, mFragment, view);
|
mController = EntityHeaderController.newInstance(mActivity, mFragment, view);
|
||||||
@@ -163,7 +163,7 @@ public class EntityHeaderControllerTest {
|
|||||||
info.activityInfo.packageName = "123";
|
info.activityInfo.packageName = "123";
|
||||||
info.activityInfo.name = "321";
|
info.activityInfo.name = "321";
|
||||||
final View view = mLayoutInflater.inflate(
|
final View view = mLayoutInflater.inflate(
|
||||||
com.android.settingslib.widget.R.layout.settings_entity_header, null /* root */);
|
com.android.settingslib.widget.preference.layout.R.layout.settings_entity_header, null /* root */);
|
||||||
when(mActivity.getApplicationContext()).thenReturn(mContext);
|
when(mActivity.getApplicationContext()).thenReturn(mContext);
|
||||||
|
|
||||||
mController = EntityHeaderController.newInstance(mActivity, mFragment, view);
|
mController = EntityHeaderController.newInstance(mActivity, mFragment, view);
|
||||||
@@ -180,7 +180,7 @@ public class EntityHeaderControllerTest {
|
|||||||
@Test
|
@Test
|
||||||
public void bindButton_noAppInfo_shouldNotAttachClickListener() {
|
public void bindButton_noAppInfo_shouldNotAttachClickListener() {
|
||||||
final View appLinks = mLayoutInflater.inflate(
|
final View appLinks = mLayoutInflater.inflate(
|
||||||
com.android.settingslib.widget.R.layout.settings_entity_header, null /* root */);
|
com.android.settingslib.widget.preference.layout.R.layout.settings_entity_header, null /* root */);
|
||||||
final FragmentActivity activity = mock(FragmentActivity.class);
|
final FragmentActivity activity = mock(FragmentActivity.class);
|
||||||
when(mFragment.getActivity()).thenReturn(activity);
|
when(mFragment.getActivity()).thenReturn(activity);
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ public class EntityHeaderControllerTest {
|
|||||||
assertThat(appLinks.findViewById(android.R.id.button2).getVisibility())
|
assertThat(appLinks.findViewById(android.R.id.button2).getVisibility())
|
||||||
.isEqualTo(View.GONE);
|
.isEqualTo(View.GONE);
|
||||||
|
|
||||||
appLinks.findViewById(com.android.settingslib.widget.R.id.entity_header_content)
|
appLinks.findViewById(com.android.settingslib.widget.preference.layout.R.id.entity_header_content)
|
||||||
.performClick();
|
.performClick();
|
||||||
verify(mFragment, never()).getActivity();
|
verify(mFragment, never()).getActivity();
|
||||||
verify(activity, never()).startActivity(any(Intent.class));
|
verify(activity, never()).startActivity(any(Intent.class));
|
||||||
@@ -206,7 +206,7 @@ public class EntityHeaderControllerTest {
|
|||||||
@Test
|
@Test
|
||||||
public void bindButton_hasAppInfo_shouldAttachClickListener() {
|
public void bindButton_hasAppInfo_shouldAttachClickListener() {
|
||||||
final View appLinks = mLayoutInflater.inflate(
|
final View appLinks = mLayoutInflater.inflate(
|
||||||
com.android.settingslib.widget.R.layout.settings_entity_header, null /* root */);
|
com.android.settingslib.widget.preference.layout.R.layout.settings_entity_header, null /* root */);
|
||||||
final FragmentActivity activity = mock(FragmentActivity.class);
|
final FragmentActivity activity = mock(FragmentActivity.class);
|
||||||
when(mFragment.getActivity()).thenReturn(activity);
|
when(mFragment.getActivity()).thenReturn(activity);
|
||||||
when(mContext.getString(eq(R.string.application_info_label))).thenReturn("App Info");
|
when(mContext.getString(eq(R.string.application_info_label))).thenReturn("App Info");
|
||||||
@@ -220,7 +220,7 @@ public class EntityHeaderControllerTest {
|
|||||||
EntityHeaderController.ActionType.ACTION_NONE);
|
EntityHeaderController.ActionType.ACTION_NONE);
|
||||||
mController.done();
|
mController.done();
|
||||||
|
|
||||||
appLinks.findViewById(com.android.settingslib.widget.R.id.entity_header_content)
|
appLinks.findViewById(com.android.settingslib.widget.preference.layout.R.id.entity_header_content)
|
||||||
.performClick();
|
.performClick();
|
||||||
verify(activity)
|
verify(activity)
|
||||||
.startActivityForResultAsUser(any(Intent.class), anyInt(), any(UserHandle.class));
|
.startActivityForResultAsUser(any(Intent.class), anyInt(), any(UserHandle.class));
|
||||||
@@ -229,7 +229,7 @@ public class EntityHeaderControllerTest {
|
|||||||
@Test
|
@Test
|
||||||
public void iconContentDescription_shouldWorkWithSetIcon() {
|
public void iconContentDescription_shouldWorkWithSetIcon() {
|
||||||
final View view = mLayoutInflater.inflate(
|
final View view = mLayoutInflater.inflate(
|
||||||
com.android.settingslib.widget.R.layout.settings_entity_header, null /* root */);
|
com.android.settingslib.widget.preference.layout.R.layout.settings_entity_header, null /* root */);
|
||||||
when(mFragment.getActivity()).thenReturn(mock(FragmentActivity.class));
|
when(mFragment.getActivity()).thenReturn(mock(FragmentActivity.class));
|
||||||
mController = EntityHeaderController.newInstance(mActivity, mFragment, view);
|
mController = EntityHeaderController.newInstance(mActivity, mFragment, view);
|
||||||
String description = "Fake Description";
|
String description = "Fake Description";
|
||||||
@@ -243,7 +243,7 @@ public class EntityHeaderControllerTest {
|
|||||||
@Test
|
@Test
|
||||||
public void iconContentDescription_shouldWorkWithoutSetIcon() {
|
public void iconContentDescription_shouldWorkWithoutSetIcon() {
|
||||||
final View view = mLayoutInflater.inflate(
|
final View view = mLayoutInflater.inflate(
|
||||||
com.android.settingslib.widget.R.layout.settings_entity_header, null /* root */);
|
com.android.settingslib.widget.preference.layout.R.layout.settings_entity_header, null /* root */);
|
||||||
when(mFragment.getActivity()).thenReturn(mock(FragmentActivity.class));
|
when(mFragment.getActivity()).thenReturn(mock(FragmentActivity.class));
|
||||||
mController = EntityHeaderController.newInstance(mActivity, mFragment, view);
|
mController = EntityHeaderController.newInstance(mActivity, mFragment, view);
|
||||||
String description = "Fake Description";
|
String description = "Fake Description";
|
||||||
@@ -256,7 +256,7 @@ public class EntityHeaderControllerTest {
|
|||||||
@Test
|
@Test
|
||||||
public void bindButton_hasAppNotifIntent_shouldShowButton() {
|
public void bindButton_hasAppNotifIntent_shouldShowButton() {
|
||||||
final View appLinks = mLayoutInflater.inflate(
|
final View appLinks = mLayoutInflater.inflate(
|
||||||
com.android.settingslib.widget.R.layout.settings_entity_header, null /* root */);
|
com.android.settingslib.widget.preference.layout.R.layout.settings_entity_header, null /* root */);
|
||||||
|
|
||||||
mController = EntityHeaderController.newInstance(mActivity, mFragment, appLinks);
|
mController = EntityHeaderController.newInstance(mActivity, mFragment, appLinks);
|
||||||
mController.setAppNotifPrefIntent(new Intent())
|
mController.setAppNotifPrefIntent(new Intent())
|
||||||
@@ -276,11 +276,11 @@ public class EntityHeaderControllerTest {
|
|||||||
@Test
|
@Test
|
||||||
public void instantApps_normalAppsDontGetLabel() {
|
public void instantApps_normalAppsDontGetLabel() {
|
||||||
final View header = mLayoutInflater.inflate(
|
final View header = mLayoutInflater.inflate(
|
||||||
com.android.settingslib.widget.R.layout.settings_entity_header, null /* root */);
|
com.android.settingslib.widget.preference.layout.R.layout.settings_entity_header, null /* root */);
|
||||||
mController = EntityHeaderController.newInstance(mActivity, mFragment, header);
|
mController = EntityHeaderController.newInstance(mActivity, mFragment, header);
|
||||||
mController.done();
|
mController.done();
|
||||||
|
|
||||||
View installType = header.findViewById(com.android.settingslib.widget.R.id.install_type);
|
View installType = header.findViewById(com.android.settingslib.widget.preference.layout.R.id.install_type);
|
||||||
assertThat(installType.getVisibility()).isEqualTo(View.GONE);
|
assertThat(installType.getVisibility()).isEqualTo(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,11 +288,11 @@ public class EntityHeaderControllerTest {
|
|||||||
@Test
|
@Test
|
||||||
public void instantApps_expectedHeaderItem() {
|
public void instantApps_expectedHeaderItem() {
|
||||||
final View header = mLayoutInflater.inflate(
|
final View header = mLayoutInflater.inflate(
|
||||||
com.android.settingslib.widget.R.layout.settings_entity_header, null /* root */);
|
com.android.settingslib.widget.preference.layout.R.layout.settings_entity_header, null /* root */);
|
||||||
mController = EntityHeaderController.newInstance(mActivity, mFragment, header);
|
mController = EntityHeaderController.newInstance(mActivity, mFragment, header);
|
||||||
mController.setIsInstantApp(true);
|
mController.setIsInstantApp(true);
|
||||||
mController.done();
|
mController.done();
|
||||||
TextView label = header.findViewById(com.android.settingslib.widget.R.id.install_type);
|
TextView label = header.findViewById(com.android.settingslib.widget.preference.layout.R.id.install_type);
|
||||||
|
|
||||||
assertThat(label.getVisibility()).isEqualTo(View.VISIBLE);
|
assertThat(label.getVisibility()).isEqualTo(View.VISIBLE);
|
||||||
assertThat(label.getText()).isEqualTo(
|
assertThat(label.getText()).isEqualTo(
|
||||||
|
@@ -126,7 +126,7 @@ public class PrimaryCheckBoxPreferenceTest {
|
|||||||
final LayoutInflater inflater = LayoutInflater.from(mContext);
|
final LayoutInflater inflater = LayoutInflater.from(mContext);
|
||||||
final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
|
final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
|
||||||
inflater.inflate(
|
inflater.inflate(
|
||||||
com.android.settingslib.widget.R.layout.preference_two_target, null));
|
com.android.settingslib.widget.preference.twotarget.R.layout.preference_two_target, null));
|
||||||
final LinearLayout widgetView = holder.itemView.findViewById(android.R.id.widget_frame);
|
final LinearLayout widgetView = holder.itemView.findViewById(android.R.id.widget_frame);
|
||||||
assertThat(widgetView).isNotNull();
|
assertThat(widgetView).isNotNull();
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@ public class PrimaryCheckBoxPreferenceTest {
|
|||||||
final LayoutInflater inflater = LayoutInflater.from(mContext);
|
final LayoutInflater inflater = LayoutInflater.from(mContext);
|
||||||
final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
|
final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
|
||||||
inflater.inflate(
|
inflater.inflate(
|
||||||
com.android.settingslib.widget.R.layout.preference_two_target, null));
|
com.android.settingslib.widget.preference.twotarget.R.layout.preference_two_target, null));
|
||||||
final LinearLayout widgetView = holder.itemView.findViewById(android.R.id.widget_frame);
|
final LinearLayout widgetView = holder.itemView.findViewById(android.R.id.widget_frame);
|
||||||
assertThat(widgetView).isNotNull();
|
assertThat(widgetView).isNotNull();
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ public class PrimaryCheckBoxPreferenceTest {
|
|||||||
public void clickWidgetView_shouldNotifyPreferenceChanged() {
|
public void clickWidgetView_shouldNotifyPreferenceChanged() {
|
||||||
final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
|
final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
|
||||||
LayoutInflater.from(mContext).inflate(
|
LayoutInflater.from(mContext).inflate(
|
||||||
com.android.settingslib.widget.R.layout.preference_two_target, null));
|
com.android.settingslib.widget.preference.twotarget.R.layout.preference_two_target, null));
|
||||||
final View widgetView = holder.findViewById(android.R.id.widget_frame);
|
final View widgetView = holder.findViewById(android.R.id.widget_frame);
|
||||||
final OnPreferenceChangeListener listener = mock(OnPreferenceChangeListener.class);
|
final OnPreferenceChangeListener listener = mock(OnPreferenceChangeListener.class);
|
||||||
mPreference.setOnPreferenceChangeListener(listener);
|
mPreference.setOnPreferenceChangeListener(listener);
|
||||||
|
@@ -53,7 +53,7 @@ public class SettingsMainSwitchPreferenceTest {
|
|||||||
mPreference = new SettingsMainSwitchPreference(context);
|
mPreference = new SettingsMainSwitchPreference(context);
|
||||||
ReflectionHelpers.setField(mPreference, "mEnforcedAdmin", mEnforcedAdmin);
|
ReflectionHelpers.setField(mPreference, "mEnforcedAdmin", mEnforcedAdmin);
|
||||||
ReflectionHelpers.setField(mPreference, "mMainSwitchBar", switchBar);
|
ReflectionHelpers.setField(mPreference, "mMainSwitchBar", switchBar);
|
||||||
final View rootView = View.inflate(context, R.layout.preference_widget_main_switch,
|
final View rootView = View.inflate(context, com.android.settings.R.layout.preference_widget_main_switch,
|
||||||
null /* parent */);
|
null /* parent */);
|
||||||
mHolder = PreferenceViewHolder.createInstanceForTests(rootView);
|
mHolder = PreferenceViewHolder.createInstanceForTests(rootView);
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,7 @@ public class SettingsMainSwitchPreferenceTest {
|
|||||||
|
|
||||||
final SettingsMainSwitchBar switchBar = mPreference.getSwitchBar();
|
final SettingsMainSwitchBar switchBar = mPreference.getSwitchBar();
|
||||||
final ImageView restrictedIcon = switchBar.findViewById(
|
final ImageView restrictedIcon = switchBar.findViewById(
|
||||||
com.android.settingslib.widget.R.id.restricted_icon);
|
com.android.settingslib.widget.restricted.R.id.restricted_icon);
|
||||||
|
|
||||||
assertThat(restrictedIcon.getVisibility() == View.VISIBLE).isTrue();
|
assertThat(restrictedIcon.getVisibility() == View.VISIBLE).isTrue();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user