Wifi: Rename removeDoubleQuotes to sanitizeSsid
Keep removeDoubleQuotes as it is marked @UnsupportedAppUsage. Bug: 145745815 Test: compiles Change-Id: I68a16b64eba3d84265b5cf2c83b434dc4fc7fa3c Merged-In: I68a16b64eba3d84265b5cf2c83b434dc4fc7fa3c (dirty cherry-pick from internal branch)
This commit is contained in:
@@ -5628,6 +5628,7 @@ package android.net.wifi {
|
|||||||
public class WifiInfo implements android.os.Parcelable {
|
public class WifiInfo implements android.os.Parcelable {
|
||||||
method public boolean isOsuAp();
|
method public boolean isOsuAp();
|
||||||
method public boolean isPasspointAp();
|
method public boolean isPasspointAp();
|
||||||
|
method @Nullable public static String sanitizeSsid(@Nullable String);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WifiManager {
|
public class WifiManager {
|
||||||
|
|||||||
@@ -658,9 +658,21 @@ public class WifiInfo implements Parcelable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@hide} */
|
/**
|
||||||
|
* Remove double quotes (") surrounding a SSID string, if present. Otherwise, return the
|
||||||
|
* string unmodified. Return null if the input string was null.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
@SystemApi
|
||||||
|
public static String sanitizeSsid(@Nullable String string) {
|
||||||
|
return removeDoubleQuotes(string);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
public static String removeDoubleQuotes(String string) {
|
@Nullable
|
||||||
|
public static String removeDoubleQuotes(@Nullable String string) {
|
||||||
if (string == null) return null;
|
if (string == null) return null;
|
||||||
final int length = string.length();
|
final int length = string.length();
|
||||||
if ((length > 1) && (string.charAt(0) == '"') && (string.charAt(length - 1) == '"')) {
|
if ((length > 1) && (string.charAt(0) == '"') && (string.charAt(length - 1) == '"')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user