Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7c86980b authored by timhypeng's avatar timhypeng Committed by tim peng
Browse files

Remove unused variable

-remove VIEW_TYPE_SLIDER_LARGE_ICON
-remove MEDIA_OUTPUT_GROUP_SLICE_URI
-remove MEDIA_OUTPUT_SLICE_URI

Bug: 175850711
Test: build pass
Change-Id: Iecf987cc91934a7598762523814f5f575302dde2
parent deb93069
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ import java.util.List;
public interface PanelContent extends Instrumentable {

    int VIEW_TYPE_SLIDER = 1;
    int VIEW_TYPE_SLIDER_LARGE_ICON = 2;

    /**
     * @return a icon for the title of the Panel.
+2 −6
Original line number Diff line number Diff line
@@ -240,7 +240,7 @@ public class PanelFragment extends Fragment {
        final IconCompat icon = mPanel.getIcon();
        final CharSequence title = mPanel.getTitle();

        if (icon != null || mPanel.getViewType() == PanelContent.VIEW_TYPE_SLIDER_LARGE_ICON) {
        if (icon != null) {
            enablePanelHeader(icon, title);
        } else {
            mTitleView.setVisibility(View.VISIBLE);
@@ -248,11 +248,7 @@ public class PanelFragment extends Fragment {
            mTitleView.setText(title);
        }

        if (mPanel.getViewType() == PanelContent.VIEW_TYPE_SLIDER_LARGE_ICON) {
            mFooterDivider.setVisibility(View.VISIBLE);
        } else {
        mFooterDivider.setVisibility(View.GONE);
        }

        mSeeMoreButton.setOnClickListener(getSeeMoreListener());
        mDoneButton.setOnClickListener(getCloseListener());
+1 −14
Original line number Diff line number Diff line
@@ -16,9 +16,7 @@

package com.android.settings.panel;

import static com.android.settings.slices.CustomSliceRegistry.MEDIA_OUTPUT_GROUP_SLICE_URI;
import static com.android.settings.slices.CustomSliceRegistry.MEDIA_OUTPUT_INDICATOR_SLICE_URI;
import static com.android.settings.slices.CustomSliceRegistry.MEDIA_OUTPUT_SLICE_URI;

import android.app.settings.SettingsEnums;
import android.content.Context;
@@ -75,8 +73,6 @@ public class PanelSlicesAdapter
        View view;
        if (viewType == PanelContent.VIEW_TYPE_SLIDER) {
            view = inflater.inflate(R.layout.panel_slice_slider_row, viewGroup, false);
        } else if (viewType == PanelContent.VIEW_TYPE_SLIDER_LARGE_ICON) {
            view = inflater.inflate(R.layout.panel_slice_slider_row_large_icon, viewGroup, false);
        } else {
            view = inflater.inflate(R.layout.panel_slice_row, viewGroup, false);
        }
@@ -142,15 +138,6 @@ public class PanelSlicesAdapter
            final Slice slice = sliceLiveData.getValue();
            if (slice == null || slice.getUri().equals(MEDIA_OUTPUT_INDICATOR_SLICE_URI)) {
                mDividerAllowedAbove = false;
            } else if (position == 0 && (slice.getUri().equals(MEDIA_OUTPUT_SLICE_URI)
                    || slice.getUri().equals(MEDIA_OUTPUT_GROUP_SLICE_URI))) {
                sliceView.setClickable(false);
                // Customize output switcher slice padding
                final int padding = mPanelFragment.getResources().getDimensionPixelSize(
                        R.dimen.output_switcher_slice_padding_top);
                mSliceSliderLayout.setPadding(mSliceSliderLayout.getPaddingLeft(), padding,
                        mSliceSliderLayout.getPaddingRight(),
                        padding);
            }

            // Log Panel interaction
@@ -175,7 +162,7 @@ public class PanelSlicesAdapter

        @Override
        public boolean isDividerAllowedBelow() {
            return mPanelFragment.getPanelViewType() != PanelContent.VIEW_TYPE_SLIDER_LARGE_ICON;
            return true;
        }
    }
}
+0 −20
Original line number Diff line number Diff line
@@ -253,26 +253,6 @@ public class CustomSliceRegistry {
            .appendPath(ZenModeButtonPreferenceController.KEY)
            .build();

    /**
     * Backing Uri for the Media output Slice.
     */
    public static Uri MEDIA_OUTPUT_SLICE_URI = new Uri.Builder()
            .scheme(ContentResolver.SCHEME_CONTENT)
            .authority(SettingsSliceProvider.SLICE_AUTHORITY)
            .appendPath(SettingsSlicesContract.PATH_SETTING_ACTION)
            .appendPath(MediaOutputSliceConstants.KEY_MEDIA_OUTPUT)
            .build();

    /**
     * Backing Uri for the Media output group Slice.
     */
    public static Uri MEDIA_OUTPUT_GROUP_SLICE_URI = new Uri.Builder()
            .scheme(ContentResolver.SCHEME_CONTENT)
            .authority(SettingsSliceProvider.SLICE_AUTHORITY)
            .appendPath(SettingsSlicesContract.PATH_SETTING_ACTION)
            .appendPath(MediaOutputSliceConstants.KEY_MEDIA_OUTPUT_GROUP)
            .build();

    /**
     * Backing Uri for the Media output indicator Slice.
     */
+0 −17
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@
package com.android.settings.panel;

import static com.android.settings.panel.PanelContent.VIEW_TYPE_SLIDER;
import static com.android.settings.panel.PanelContent.VIEW_TYPE_SLIDER_LARGE_ICON;

import static com.google.common.truth.Truth.assertThat;

@@ -212,22 +211,6 @@ public class PanelFragmentTest {
        assertThat(titleView.getVisibility()).isEqualTo(View.VISIBLE);
    }

    @Test
    public void sliderLargeIconPanelType_displayFooterDivider() {
        mFakePanelContent.setViewType(VIEW_TYPE_SLIDER_LARGE_ICON);
        final ActivityController<FakeSettingsPanelActivity> activityController =
                Robolectric.buildActivity(FakeSettingsPanelActivity.class);
        activityController.setup();
        final PanelFragment panelFragment = (PanelFragment)
                Objects.requireNonNull(activityController
                        .get()
                        .getSupportFragmentManager()
                        .findFragmentById(R.id.main_content));
        final View footerDivider = panelFragment.mLayoutView.findViewById(R.id.footer_divider);
        // Check visibility
        assertThat(footerDivider.getVisibility()).isEqualTo(View.VISIBLE);
    }

    @Test
    public void sliderPanelType_notDisplayFooterDivider() {
        mFakePanelContent.setViewType(VIEW_TYPE_SLIDER);
Loading