Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 8282d3c8 authored by Remi NGUYEN VAN's avatar Remi NGUYEN VAN
Browse files

Add shims for network info classes

Combine shims for LinkProperties and NetworkCapabilities to avoid too
many shim classes, and use static methods as the original types (and not
the shims) would generally be used to reference the classes.

CaptivePortalData is not available in API29 so CaptivePortalDataShim is
used as a wrapper that can hold a reference to it in common code.

Sample usage in NetworkMonitor:
final CaptivePortalDataShim data;
try {
  data = CaptivePortalDataShimImpl.fromJSON(obj);
} catch (UnsupportedApiLevelException | JSONException e) {
  // Do some fallback
  return;
}

// Just to give an idea
if (data.isCaptive()) {
  openCaptivePortalApp(data.getUserPortalUrl());
}
data.notifyChanged(mCallbacks);

Test: atest NetworkStackTests NetworkStackNextTests
Bug: 139269711
Change-Id: I262aaa41013ebe1ec4263a6516bd8cab76509304
parent 5365684a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment