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 } } 
  • It is possible that for IccCardProxy initialization, IccCardProxy necessary that in some @Override methods something meaningful happens and returns. And I also have big doubts that you need to contact com.android.internal without good reason. Do you really need to work with these classes (and some BaseCommands )? - Regent
  • @Regent, with him. Need to get IccCardProxy . By the way, BaseCommands is created correctly, methods are called, for example, getRilVersion returns -1 . The application will be a huge project, probably, I will do it first. I need methods from IccCardProxy . Opened the system applications, they call everything through this class, namely, supplyDeperdonalization is 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 - Flippy
  • Damn it getRilVersion returns a variable that is initialized as -1 for no reason. So I still don't create BaseCommands - Flippy

0