1 /*
2  * Copyright (C) 2018 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.settings.panel;
18 
19 import static com.android.settings.slices.CustomSliceRegistry.WIFI_SLICE_URI;
20 
21 import android.app.settings.SettingsEnums;
22 import android.content.Intent;
23 import android.net.Uri;
24 
25 import androidx.core.graphics.drawable.IconCompat;
26 
27 import java.util.Arrays;
28 import java.util.List;
29 
30 /**
31  * Fake PanelContent for testing.
32  *
33  * @deprecated this is no longer used after V and will be removed.
34  */
35 @Deprecated(forRemoval = true)
36 public class FakePanelContent implements PanelContent {
37 
38     public static final String FAKE_ACTION = "fake_action";
39 
40     public static final CharSequence TITLE = "title";
41 
42     public static final List<Uri> SLICE_URIS = Arrays.asList(
43         WIFI_SLICE_URI
44     );
45 
46     public static final Intent INTENT = new Intent();
47 
48     private CharSequence mTitle = TITLE;
49     private CharSequence mSubTitle;
50     private IconCompat mIcon;
51     private int mViewType;
52     private boolean mIsCustomizedButtonUsed = false;
53     private CharSequence mCustomizedButtonTitle;
54     private boolean mIsProgressBarVisible;
55 
56     @Override
getIcon()57     public IconCompat getIcon() {
58         return mIcon;
59     }
60 
setIcon(IconCompat icon)61     public void setIcon(IconCompat icon) {
62         mIcon = icon;
63     }
64 
65     @Override
getSubTitle()66     public CharSequence getSubTitle() {
67         return mSubTitle;
68     }
69 
setSubTitle(CharSequence subTitle)70     public void setSubTitle(CharSequence subTitle) {
71         mSubTitle = subTitle;
72     }
73 
74     @Override
getTitle()75     public CharSequence getTitle() {
76         return mTitle;
77     }
78 
setTitle(CharSequence title)79     public void setTitle(CharSequence title) {
80         mTitle = title;
81     }
82 
83     @Override
getSlices()84     public List<Uri> getSlices() {
85         return SLICE_URIS;
86     }
87 
88     @Override
getSeeMoreIntent()89     public Intent getSeeMoreIntent() {
90         return INTENT;
91     }
92 
93     @Override
getMetricsCategory()94     public int getMetricsCategory() {
95         return SettingsEnums.TESTING;
96     }
97 
setViewType(int viewType)98     public void setViewType(int viewType) {
99         mViewType = viewType;
100     }
101 
102     @Override
getViewType()103     public int getViewType() {
104         return mViewType;
105     }
106 
107     @Override
isCustomizedButtonUsed()108     public boolean isCustomizedButtonUsed() {
109         return mIsCustomizedButtonUsed;
110     }
111 
setIsCustomizedButtonUsed(boolean isUsed)112     public void setIsCustomizedButtonUsed(boolean isUsed) {
113         mIsCustomizedButtonUsed = isUsed;
114     }
115 
116     @Override
getCustomizedButtonTitle()117     public CharSequence getCustomizedButtonTitle() {
118         return mCustomizedButtonTitle;
119     }
120 
setCustomizedButtonTitle(CharSequence title)121     public void setCustomizedButtonTitle(CharSequence title) {
122         mCustomizedButtonTitle = title;
123     }
124 
125     @Override
isProgressBarVisible()126     public boolean isProgressBarVisible() {
127         return mIsProgressBarVisible;
128     }
129 
setIsProgressBarVisible(boolean isProgressBarVisible)130     public void setIsProgressBarVisible(boolean isProgressBarVisible) {
131         mIsProgressBarVisible = isProgressBarVisible;
132     }
133 }
134