Commit 14d735fe authored by Dan Ballard's avatar Dan Ballard
Browse files

fixup! TB 42247: Android helpers for the TorProvider

Rename TorIntegrationAndroid.java to TorAndroidIntegration.java
parent 22ad3eca
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -8,9 +8,9 @@ import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import mozilla.components.browser.engine.gecko.GeckoEngine
import org.mozilla.fenix.ext.components
import org.mozilla.geckoview.TorIntegrationAndroid
import org.mozilla.geckoview.TorIntegrationAndroid.BootstrapStateChangeListener
import org.mozilla.geckoview.TorIntegrationAndroid.TorLogListener
import org.mozilla.geckoview.TorAndroidIntegration
import org.mozilla.geckoview.TorAndroidIntegration.BootstrapStateChangeListener
import org.mozilla.geckoview.TorAndroidIntegration.TorLogListener
import org.mozilla.geckoview.TorSettings
import org.mozilla.geckoview.TorSettings.BridgeBuiltinType
import org.mozilla.geckoview.TorSettings.BridgeSource
@@ -73,7 +73,7 @@ class TorControllerGV(
    override val isBootstrapped get() = isTorBootstrapped
    override val isConnected get() = (_lastKnownStatus.value.isStarted() && !isTorRestarting)

    private fun getTorIntegration(): TorIntegrationAndroid {
    private fun getTorIntegration(): TorAndroidIntegration {
        return (context.components.core.engine as GeckoEngine).getTorIntegrationController()
    }

+3 −3
Original line number Diff line number Diff line
@@ -244,7 +244,7 @@ public final class GeckoRuntime implements Parcelable {
  private final ProfilerController mProfilerController;
  private final GeckoScreenChangeListener mScreenChangeListener;

  private TorIntegrationAndroid mTorIntegration;
  private TorAndroidIntegration mTorIntegration;

  private GeckoRuntime() {
    mWebExtensionController = new WebExtensionController(this);
@@ -495,7 +495,7 @@ public final class GeckoRuntime implements Parcelable {
      mScreenChangeListener.enable();
    }

    mTorIntegration = new TorIntegrationAndroid(context);
    mTorIntegration = new TorAndroidIntegration(context);

    mProfilerController.addMarker(
        "GeckoView Initialization START", mProfilerController.getProfilerTime());
@@ -1015,7 +1015,7 @@ public final class GeckoRuntime implements Parcelable {
   * Get the Tor integration controller for this runtime.
   */
  @UiThread
  public @NonNull TorIntegrationAndroid getTorIntegrationController() {
  public @NonNull TorAndroidIntegration getTorIntegrationController() {
    return mTorIntegration;
  }

+5 −5
Original line number Diff line number Diff line
@@ -29,8 +29,8 @@ import org.mozilla.gecko.util.EventCallback;
import org.mozilla.gecko.util.GeckoBundle;
import org.mozilla.geckoview.androidlegacysettings.TorLegacyAndroidSettings;

public class TorIntegrationAndroid implements BundleEventListener {
  private static final String TAG = "TorIntegrationAndroid";
public class TorAndroidIntegration implements BundleEventListener {
  private static final String TAG = "TorAndroidIntegration";

  // Events we listen to
  private static final String EVENT_TOR_START = "GeckoView:Tor:StartTor";
@@ -88,7 +88,7 @@ public class TorIntegrationAndroid implements BundleEventListener {
   */
  private TorSettings mSettings = null;

  /* package */ TorIntegrationAndroid(Context context) {
  /* package */ TorAndroidIntegration(Context context) {
    mLibraryDir = context.getApplicationInfo().nativeLibraryDir;
    mCacheDir = context.getCacheDir().getAbsolutePath();
    mIpcDirectory = mCacheDir + "/tor-private";
@@ -269,7 +269,7 @@ public class TorIntegrationAndroid implements BundleEventListener {
    public void run() {
      cleanIpcDirectory();

      final String ipcDir = TorIntegrationAndroid.this.mIpcDirectory;
      final String ipcDir = TorAndroidIntegration.this.mIpcDirectory;
      final ArrayList<String> args = new ArrayList<>();
      args.add(mLibraryDir + "/libTor.so");
      args.add("DisableNetwork");
@@ -354,7 +354,7 @@ public class TorIntegrationAndroid implements BundleEventListener {
    }

    private void cleanIpcDirectory() {
      File directory = new File(TorIntegrationAndroid.this.mIpcDirectory);
      File directory = new File(TorAndroidIntegration.this.mIpcDirectory);
      if (!directory.isDirectory()) {
        if (!directory.mkdirs()) {
          Log.e(TAG, "Failed to create the IPC directory.");