Merge "Implement receiver flow of WiFi sharing feature"
This commit is contained in:
@@ -16,7 +16,10 @@
|
||||
|
||||
package com.android.settings.wifi.dpp;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.util.FeatureFlagUtils;
|
||||
|
||||
/**
|
||||
* Here are the items shared by both WifiDppConfiguratorActivity & WifiDppEnrolleeActivity
|
||||
@@ -75,4 +78,46 @@ public class WifiDppUtils {
|
||||
* H true Optional. True if the network SSID is hidden.
|
||||
*/
|
||||
public static final String EXTRA_QR_CODE = "qrCode";
|
||||
|
||||
/**
|
||||
* Returns whether the user can share the network represented by this preference with QR code.
|
||||
*/
|
||||
public static boolean isSharingNetworkEnabled(Context context) {
|
||||
return FeatureFlagUtils.isEnabled(context,
|
||||
com.android.settings.core.FeatureFlags.WIFI_SHARING);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an intent to launch QR code scanner.
|
||||
*
|
||||
* @param ssid The data corresponding to {@code WifiConfiguration} SSID
|
||||
* @return Intent for launching QR code scanner
|
||||
*/
|
||||
public static Intent getConfiguratorQRCodeScannerIntent(String ssid) {
|
||||
final Intent intent = new Intent(
|
||||
WifiDppConfiguratorActivity.ACTION_CONFIGURATOR_QR_CODE_SCANNER);
|
||||
if (!TextUtils.isEmpty(ssid)) {
|
||||
intent.putExtra(EXTRA_WIFI_SSID, ssid);
|
||||
}
|
||||
return intent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an intent to launch QR code generator.
|
||||
*
|
||||
* @param ssid The data corresponding to {@code WifiConfiguration} SSID
|
||||
* @param Security The data is from {@code AccessPoint.securityToString}
|
||||
* @return Intent for launching QR code generator
|
||||
*/
|
||||
public static Intent getConfiguratorQRCodeGeneratorIntent(String ssid, String Security) {
|
||||
final Intent intent = new Intent(
|
||||
WifiDppConfiguratorActivity.ACTION_CONFIGURATOR_QR_CODE_GENERATOR);
|
||||
if (!TextUtils.isEmpty(ssid)) {
|
||||
intent.putExtra(EXTRA_WIFI_SSID, ssid);
|
||||
}
|
||||
if (!TextUtils.isEmpty(Security)) {
|
||||
intent.putExtra(EXTRA_WIFI_SECURITY, Security);
|
||||
}
|
||||
return intent;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user