Skip to content

internal: pass engine handles throughout API#2149

Merged
jpsim merged 4 commits intomainfrom
jp-pass-engine-handles
Apr 13, 2022
Merged

internal: pass engine handles throughout API#2149
jpsim merged 4 commits intomainfrom
jp-pass-engine-handles

Conversation

@jpsim
Copy link
Copy Markdown
Contributor

@jpsim jpsim commented Apr 5, 2022

In preparation for removing the singleton. This is split off into its own independent change to minimize the scope of the main singleton removal work.

We were already doing this in many places, this just adds more instances of passing the engine handle so we do so comprehensively.

Description: Pass engine handles throughout API
Risk Level: Medium, changing some JNI interfaces, removing some static state
Testing: Unit tests and sample apps
Docs Changes: N/A internal only
Release Notes: N/A internal only
[Optional Fixes #Issue]
[Optional Deprecated:]

Signed-off-by: JP Simard jp@jpsim.com

In preparation for removing the singleton. This is split off into its
own independent change to minimize the scope of the main singleton
removal work.

We were already doing this in many places, this just adds more instances
of passing the engine handle so we do so comprehensively.

Signed-off-by: JP Simard <jp@jpsim.com>
@jpsim jpsim force-pushed the jp-pass-engine-handles branch from 79fbb8e to b562382 Compare April 5, 2022 21:12
@jpsim jpsim marked this pull request as ready for review April 5, 2022 22:09
@jpsim jpsim requested review from Augustyniak and goaway April 5, 2022 22:09
Signed-off-by: JP Simard <jp@jpsim.com>
private static volatile AndroidNetworkMonitor instance = null;

private int previousNetworkType = ConnectivityManager.TYPE_DUMMY;
private long engineHandle;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we store a reference to the engine, and let the engine make the JNI call, so we don't have to expose the handle?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Giving that a shot in 22148bc

Signed-off-by: JP Simard <jp@jpsim.com>
@jpsim jpsim requested a review from goaway April 12, 2022 02:06
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim added a commit that referenced this pull request Apr 12, 2022
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim added a commit that referenced this pull request Apr 12, 2022
Signed-off-by: JP Simard <jp@jpsim.com>
Copy link
Copy Markdown
Contributor

@goaway goaway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work on this @jpsim. Finally had a chance to look through it all. Looks good.

@jpsim jpsim merged commit 9c90ac0 into main Apr 13, 2022
@jpsim jpsim deleted the jp-pass-engine-handles branch April 13, 2022 14:33
jpsim added a commit that referenced this pull request Apr 13, 2022
* main:
  internal: pass engine handles throughout API (#2149)

Signed-off-by: JP Simard <jp@jpsim.com>
jpsim added a commit that referenced this pull request Apr 14, 2022
…rash

* origin/main:
  bazel: Allow multiple definitions for armeabi android links
  internal: pass engine handles throughout API (#2149)

Signed-off-by: JP Simard <jp@jpsim.com>
jpsim added a commit to jpsim/envoy-mobile that referenced this pull request Apr 20, 2022
…unroutable-families

* origin/main: (25 commits)
  Update Envoy to c96f711 (envoyproxy#2168)
  Bump Lyft Support Rotation (envoyproxy#2162)
  Update Envoy to 0e8899c (envoyproxy#2166)
  Update rules_apple & rules_swift (envoyproxy#2167)
  bazel: set inmemory remote exec flags globally
  http client: add cancel log and limit callback to open streams (envoyproxy#2165)
  bump envoy to 5181d2355f208061688922572727fe06ba8b3a07 (envoyproxy#2157)
  pin maven dependencies (envoyproxy#2161)
  Fix iOS termination crash in `ProvisionalDispatcher` (envoyproxy#2059)
  bazel: Allow multiple definitions for armeabi android links
  internal: pass engine handles throughout API (envoyproxy#2149)
  Bump Lyft Support Rotation (envoyproxy#2156)
  add specifying more maven deps (envoyproxy#2151)
  update envoy@e4eaf1b97 (envoyproxy#2146)
  bazel: create symbol mapping file (envoyproxy#2126)
  Bump Lyft Support Rotation (envoyproxy#2148)
  bazel: remove sandbox disable
  build: export flatbuffer jvm dep (envoyproxy#2147)
  Bump Lyft Support Rotation (envoyproxy#2143)
  bazel: Add flatbuffers Swift hack
  ...

Signed-off-by: JP Simard <jp@jpsim.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants