add bunch of new java APIs: mostly stubs or copied from AOSP

Many of these classes are only needed to be subclassed by androidx
support library, which is used in many android apps
This commit is contained in:
Julian Winkler
2023-08-17 10:46:24 +02:00
parent a8e39cd613
commit 82744e9e5e
87 changed files with 2746 additions and 46 deletions

View File

@@ -1,5 +1,6 @@
package android.app;
import android.R;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -102,6 +103,7 @@ public class Activity extends Context {
protected void onCreate(Bundle savedInstanceState) {
System.out.println("- onCreate - yay!");
new ViewGroup(this).setId(R.id.content);
return;
}
@@ -263,6 +265,22 @@ public class Activity extends Context {
nativeFinish(getWindow().native_window);
}
public Object getLastNonConfigurationInstance() {
return null;
}
public FragmentManager getFragmentManager() {
return new FragmentManager();
}
public LayoutInflater getLayoutInflater() {
return layout_inflater;
}
public CharSequence getTitle() {
return "Title";
}
private native void nativeFinish(long native_window);
private static native void nativeStartActivity(Activity activity);
}

View File

@@ -0,0 +1,5 @@
package android.app;
public class DownloadManager {
}

View File

@@ -0,0 +1,5 @@
package android.app;
public class Fragment {
}

View File

@@ -0,0 +1,16 @@
package android.app;
public class FragmentManager {
public Fragment findFragmentByTag(String tag) {
return null;
}
public FragmentTransaction beginTransaction() {
return new FragmentTransaction();
}
public boolean executePendingTransactions() {
return false;
}
}

View File

@@ -0,0 +1,12 @@
package android.app;
public class FragmentTransaction {
public FragmentTransaction add(Fragment fragment, String string) {
return this;
}
public int commit() {
return 0;
}
}

View File

@@ -0,0 +1,5 @@
package android.app;
public class SearchManager {
}

View File

@@ -0,0 +1,10 @@
package android.app;
import android.content.res.Configuration;
public class UiModeManager {
public int getCurrentModeType() {
return Configuration.UI_MODE_TYPE_NORMAL;
}
}

View File

@@ -0,0 +1,5 @@
package android.app;
public class WallpaperManager {
}

View File

@@ -0,0 +1,5 @@
package android.app.admin;
public class DevicePolicyManager {
}