- Show each band option individually in single-band devices - Show "2.4 and 5GHz" combined option in dual-band devices - Disable 5 GHz option if the device is in the restricted country - Disable 6 GHz option if the device is in the restricted country - Hide 6 GHz option if the old device does not support 6 GHz band. Bug: 245258763 Test: manual test atest -c WifiHotspotSpeedSettingsTest atest -c WifiHotspotSpeedViewModelTest \ WifiHotspotRepositoryTest Change-Id: I358d4ff8d62df72fd5080e55f40d588c238d01fb
56 lines
1.8 KiB
Java
56 lines
1.8 KiB
Java
/*
|
|
* Copyright (C) 2023 The Android Open Source Project
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
package com.android.settings.wifi.factory;
|
|
|
|
import android.annotation.Nullable;
|
|
import android.content.Context;
|
|
import android.net.wifi.WifiManager;
|
|
import android.util.Log;
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
/**
|
|
* Wi-Fi Verbose Logging
|
|
*/
|
|
public class WifiVerboseLogging {
|
|
private static final String TAG = "WifiVerboseLogging";
|
|
|
|
protected final Context mAppContext;
|
|
protected final WifiManager mWifiManager;
|
|
protected final boolean mIsVerboseLoggingEnabled;
|
|
|
|
public WifiVerboseLogging(@NonNull Context appContext, @NonNull WifiManager wifiManager) {
|
|
mAppContext = appContext;
|
|
mWifiManager = wifiManager;
|
|
mIsVerboseLoggingEnabled = wifiManager.isVerboseLoggingEnabled();
|
|
Log.v(TAG, "isVerboseLoggingEnabled:" + mIsVerboseLoggingEnabled);
|
|
}
|
|
|
|
/**
|
|
* Send a {@link Log#VERBOSE} log message.
|
|
*
|
|
* @param tag Used to identify the source of a log message. It usually identifies
|
|
* the class or activity where the log call occurs.
|
|
* @param msg The message you would like logged.
|
|
*/
|
|
public void log(@Nullable String tag, @NonNull String msg) {
|
|
if (mIsVerboseLoggingEnabled) {
|
|
Log.v(tag, msg);
|
|
}
|
|
}
|
|
}
|