[Wallet] Remove wallet p3a mojo (#36658)
This commit is contained in:
@@ -9,7 +9,6 @@ import org.jni_zero.JNINamespace;
|
||||
import org.jni_zero.NativeMethods;
|
||||
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioService;
|
||||
import org.chromium.brave_wallet.mojom.BraveWalletP3a;
|
||||
import org.chromium.brave_wallet.mojom.BraveWalletService;
|
||||
import org.chromium.brave_wallet.mojom.EthTxManagerProxy;
|
||||
import org.chromium.brave_wallet.mojom.JsonRpcService;
|
||||
@@ -52,18 +51,6 @@ public class BraveWalletServiceFactory {
|
||||
return braveWalletService;
|
||||
}
|
||||
|
||||
public BraveWalletP3a getBraveWalletP3A(ConnectionErrorHandler connectionErrorHandler) {
|
||||
Profile profile = Utils.getProfile(false); // always use regular profile
|
||||
long nativeHandle =
|
||||
BraveWalletServiceFactoryJni.get().getInterfaceToBraveWalletP3A(profile);
|
||||
MessagePipeHandle handle = wrapNativeHandle(nativeHandle);
|
||||
BraveWalletP3a braveWalletP3A = BraveWalletP3a.MANAGER.attachProxy(handle, 0);
|
||||
Handler handler = ((Interface.Proxy) braveWalletP3A).getProxyHandler();
|
||||
handler.setErrorHandler(connectionErrorHandler);
|
||||
|
||||
return braveWalletP3A;
|
||||
}
|
||||
|
||||
public JsonRpcService getJsonRpcService(ConnectionErrorHandler connectionErrorHandler) {
|
||||
Profile profile = Utils.getProfile(false); // always use regular profile
|
||||
long nativeHandle =
|
||||
@@ -145,8 +132,6 @@ public class BraveWalletServiceFactory {
|
||||
interface Natives {
|
||||
long getInterfaceToBraveWalletService(Profile profile);
|
||||
|
||||
long getInterfaceToBraveWalletP3A(Profile profile);
|
||||
|
||||
long getInterfaceToJsonRpcService(Profile profile);
|
||||
|
||||
long getInterfaceToKeyringService(Profile profile);
|
||||
|
||||
-19
@@ -10,7 +10,6 @@ import android.view.MenuItem;
|
||||
import org.chromium.base.supplier.OneshotSupplier;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioService;
|
||||
import org.chromium.brave_wallet.mojom.BlockchainRegistry;
|
||||
import org.chromium.brave_wallet.mojom.BraveWalletP3a;
|
||||
import org.chromium.brave_wallet.mojom.BraveWalletService;
|
||||
import org.chromium.brave_wallet.mojom.EthTxManagerProxy;
|
||||
import org.chromium.brave_wallet.mojom.JsonRpcService;
|
||||
@@ -41,7 +40,6 @@ public abstract class BraveWalletBaseActivity extends AsyncInitializationActivit
|
||||
protected EthTxManagerProxy mEthTxManagerProxy;
|
||||
protected SolanaTxManagerProxy mSolanaTxManagerProxy;
|
||||
protected AssetRatioService mAssetRatioService;
|
||||
protected BraveWalletP3a mBraveWalletP3A;
|
||||
protected BraveWalletService mBraveWalletService;
|
||||
private KeyringServiceObserverImpl mKeyringServiceObserver;
|
||||
private TxServiceObserverImpl mTxServiceObserver;
|
||||
@@ -72,7 +70,6 @@ public abstract class BraveWalletBaseActivity extends AsyncInitializationActivit
|
||||
if (mTxService != null) mTxService.close();
|
||||
if (mEthTxManagerProxy != null) mEthTxManagerProxy.close();
|
||||
if (mSolanaTxManagerProxy != null) mSolanaTxManagerProxy.close();
|
||||
if (mBraveWalletP3A != null) mBraveWalletP3A.close();
|
||||
if (mBraveWalletService != null) mBraveWalletService.close();
|
||||
|
||||
mKeyringService = null;
|
||||
@@ -82,7 +79,6 @@ public abstract class BraveWalletBaseActivity extends AsyncInitializationActivit
|
||||
mEthTxManagerProxy = null;
|
||||
mSolanaTxManagerProxy = null;
|
||||
mAssetRatioService = null;
|
||||
mBraveWalletP3A = null;
|
||||
mBraveWalletService = null;
|
||||
initKeyringService();
|
||||
initBlockchainRegistry();
|
||||
@@ -91,7 +87,6 @@ public abstract class BraveWalletBaseActivity extends AsyncInitializationActivit
|
||||
initEthTxManagerProxy();
|
||||
initSolanaTxManagerProxy();
|
||||
initAssetRatioService();
|
||||
initBraveWalletP3A();
|
||||
initBraveWalletService();
|
||||
}
|
||||
|
||||
@@ -156,14 +151,6 @@ public abstract class BraveWalletBaseActivity extends AsyncInitializationActivit
|
||||
mAssetRatioService = BraveWalletServiceFactory.getInstance().getAssetRatioService(this);
|
||||
}
|
||||
|
||||
protected void initBraveWalletP3A() {
|
||||
if (mBraveWalletP3A != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
mBraveWalletP3A = BraveWalletServiceFactory.getInstance().getBraveWalletP3A(this);
|
||||
}
|
||||
|
||||
protected void initBraveWalletService() {
|
||||
if (mBraveWalletService != null) {
|
||||
return;
|
||||
@@ -204,10 +191,6 @@ public abstract class BraveWalletBaseActivity extends AsyncInitializationActivit
|
||||
return mBraveWalletService;
|
||||
}
|
||||
|
||||
public BraveWalletP3a getBraveWalletP3A() {
|
||||
return mBraveWalletP3A;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
@@ -228,7 +211,6 @@ public abstract class BraveWalletBaseActivity extends AsyncInitializationActivit
|
||||
initEthTxManagerProxy();
|
||||
initSolanaTxManagerProxy();
|
||||
initAssetRatioService();
|
||||
initBraveWalletP3A();
|
||||
initBraveWalletService();
|
||||
}
|
||||
|
||||
@@ -248,7 +230,6 @@ public abstract class BraveWalletBaseActivity extends AsyncInitializationActivit
|
||||
if (mTxService != null) mTxService.close();
|
||||
if (mEthTxManagerProxy != null) mEthTxManagerProxy.close();
|
||||
if (mSolanaTxManagerProxy != null) mSolanaTxManagerProxy.close();
|
||||
if (mBraveWalletP3A != null) mBraveWalletP3A.close();
|
||||
if (mBraveWalletService != null) mBraveWalletService.close();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
-11
@@ -23,7 +23,6 @@ import androidx.annotation.RequiresApi;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import org.chromium.brave_wallet.mojom.BraveWalletP3a;
|
||||
import org.chromium.brave_wallet.mojom.JsonRpcService;
|
||||
import org.chromium.brave_wallet.mojom.KeyringService;
|
||||
import org.chromium.chrome.R;
|
||||
@@ -136,16 +135,6 @@ public abstract class BaseWalletNextPageFragment extends Fragment {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected BraveWalletP3a getBraveWalletP3A() {
|
||||
Activity activity = getActivity();
|
||||
if (activity instanceof BraveWalletActivity) {
|
||||
return ((BraveWalletActivity) activity).getBraveWalletP3A();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void setAnimatedBackground(@NonNull final View rootView) {
|
||||
mAnimationDrawable =
|
||||
(AnimationDrawable)
|
||||
|
||||
Reference in New Issue
Block a user