Skip to content

Commit

Permalink
Set the passpoint boolean for Wi-Fi messages, and annotate Passpoint …
Browse files Browse the repository at this point in the history
…APs in the Wi-Fi UI
  • Loading branch information
christianrowlands committed Nov 13, 2023
1 parent d5e1a8d commit 4d26c89
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion networksurvey/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apply plugin: 'kotlin-android'

ext.androidVersion = '28.0.0'
ext.grpcVersion = '1.58.0'
ext.networkSurveyMessagingVersion = '0.12.0'
ext.networkSurveyMessagingVersion = '0.13.0'
ext.navigationVersion = '2.7.4'

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.craxiom.networksurvey.R;
import com.craxiom.networksurvey.constants.WifiBeaconMessageConstants;
import com.craxiom.networksurvey.model.WifiRecordWrapper;
import com.google.protobuf.BoolValue;

/**
* The recycler view for the list of Wi-Fi networks displayed in the UI.
Expand Down Expand Up @@ -76,6 +77,8 @@ public void onBindViewHolder(final ViewHolder holder, int position)
holder.encryptionType.setText(WifiBeaconMessageConstants.getEncryptionTypeString(data.getEncryptionType()));
holder.frequency.setText(data.hasFrequencyMhz() ? context.getString(R.string.wifi_frequency_value, data.getFrequencyMhz().getValue()) : "");
holder.channel.setText(data.hasChannel() ? context.getString(R.string.wifi_channel_value, data.getChannel().getValue()) : "");
boolean passpoint = data.getPasspoint().getValue();
holder.passpoint.setText((data.hasPasspoint() && passpoint) ? "Passpoint" : "");
holder.capabilities.setText(wifiRecordWrapper.getCapabilitiesString());
}

Expand Down Expand Up @@ -125,6 +128,7 @@ static class ViewHolder extends RecyclerView.ViewHolder
final TextView encryptionType;
final TextView frequency;
final TextView channel;
final TextView passpoint;
final TextView capabilities;
WifiBeaconRecord wifiRecord;

Expand All @@ -138,6 +142,7 @@ static class ViewHolder extends RecyclerView.ViewHolder
encryptionType = view.findViewById(R.id.encryption_type);
frequency = view.findViewById(R.id.wifi_frequency);
channel = view.findViewById(R.id.wifi_channel);
passpoint = view.findViewById(R.id.wifi_passpoint);
capabilities = view.findViewById(R.id.wifi_capabilities);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1417,6 +1417,11 @@ private WifiRecordWrapper generateWiFiBeaconSurveyRecord(ScanResult apScanResult
dataBuilder.setWps(BoolValue.newBuilder().setValue(WifiCapabilitiesUtils.supportsWps(capabilities)).build());
}

if (apScanResult.isPasspointNetwork())
{
dataBuilder.setPasspoint(BoolValue.newBuilder().setValue(true).build());
}

final WifiBeaconRecord.Builder recordBuilder = WifiBeaconRecord.newBuilder();
recordBuilder.setMessageType(WifiBeaconMessageConstants.WIFI_BEACON_RECORD_MESSAGE_TYPE);
recordBuilder.setVersion(BuildConfig.MESSAGING_API_VERSION);
Expand Down
11 changes: 11 additions & 0 deletions networksurvey/src/main/res/layout/fragment_wifi_network_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@
android:text=""
tools:ignore="RtlSymmetry" />

<TextView
android:id="@+id/wifi_passpoint"
style="@style/ListContentText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/xx_small_margin"
android:paddingStart="@dimen/large_margin"
android:text=""
android:textColor="@color/colorAccent"
tools:ignore="RtlSymmetry" />

</LinearLayout>

<LinearLayout
Expand Down

0 comments on commit 4d26c89

Please sign in to comment.