1 /* 2 * Copyright (C) 2019 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 android.app.settings.SettingsEnums; 20 import android.content.Context; 21 import android.content.Intent; 22 import android.net.Uri; 23 24 import com.android.settings.R; 25 import com.android.settings.SubSettings; 26 import com.android.settings.network.NetworkProviderSettings; 27 import com.android.settings.slices.CustomSliceRegistry; 28 import com.android.settings.slices.SliceBuilderUtils; 29 30 import java.util.ArrayList; 31 import java.util.List; 32 33 /** 34 * Panel data class for Wifi settings. 35 * 36 * @deprecated this is not used after V and will be removed. 37 */ 38 @Deprecated(forRemoval = true) 39 public class WifiPanel implements PanelContent { 40 41 private final Context mContext; 42 create(Context context)43 public static WifiPanel create(Context context) { 44 return new WifiPanel(context); 45 } 46 WifiPanel(Context context)47 private WifiPanel(Context context) { 48 mContext = context.getApplicationContext(); 49 } 50 51 @Override getTitle()52 public CharSequence getTitle() { 53 return mContext.getText(R.string.wifi_settings); 54 } 55 56 @Override getSlices()57 public List<Uri> getSlices() { 58 final List<Uri> uris = new ArrayList<>(); 59 uris.add(CustomSliceRegistry.WIFI_SLICE_URI); 60 return uris; 61 } 62 63 @Override getSeeMoreIntent()64 public Intent getSeeMoreIntent() { 65 final String screenTitle = mContext.getText(R.string.wifi_settings).toString(); 66 final Intent intent = SliceBuilderUtils.buildSearchResultPageIntent(mContext, 67 NetworkProviderSettings.class.getName(), 68 null /* key */, 69 screenTitle, 70 SettingsEnums.WIFI, 71 R.string.menu_key_network); 72 intent.setClassName(mContext.getPackageName(), SubSettings.class.getName()); 73 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 74 return intent; 75 } 76 77 @Override getMetricsCategory()78 public int getMetricsCategory() { 79 return SettingsEnums.PANEL_WIFI; 80 } 81 } 82