Hello. There is a class, X in the constructor must pass an interface. As I understand it, you can transfer any class that implements it. But the only such class is abstract, and its successor is also one and its copy cannot be created. And maybe I can but I can not.
I created my own class and inherit it from the abstract. In the constructor, I call the superclass constructor. But for some reason, all the fields of class X not initialized after the creation of its instance. Why?
The class X is com.android.internal.telephony.uicc.IccCardProxy .
My code is:
public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); BaseCommands ci = new FakeCommandsInterface(this); IccCardProxy icp = new IccCardProxy(this, ci, 2); } public class FakeCommandsInterface extends BaseCommands { public FakeCommandsInterface(Context c){ super(c); UiccController.make(MainActivity.this, new CommandsInterface[]{this}); } //overrided methods } }
IccCardProxyinitialization,IccCardProxynecessary that in some@Overridemethods something meaningful happens and returns. And I also have big doubts that you need to contactcom.android.internalwithout good reason. Do you really need to work with these classes (and someBaseCommands)? - RegentIccCardProxy. By the way,BaseCommandsis created correctly, methods are called, for example,getRilVersionreturns-1. The application will be a huge project, probably, I will do it first. I need methods fromIccCardProxy. Opened the system applications, they call everything through this class, namely,supplyDeperdonalizationis of interest, for some models the application is already running, but there the implementation is different (writing to the system settings, sending AT commands). Now I’m starting to support other models, I’m writing everything in them like this ... I’m writing something like SuperSU - FlippygetRilVersionreturns a variable that is initialized as-1for no reason. So I still don't createBaseCommands- Flippy