refactor source tree organization, switch to meson

This commit is contained in:
Mis012
2022-10-02 23:06:56 +02:00
parent 2f785e2a59
commit 449090143e
296 changed files with 171615 additions and 69 deletions

File diff suppressed because it is too large Load Diff

45677
src/api-impl/android/R.java Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,31 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Indicates an API is exposed for use by bundled applications.
* <p>
* These APIs are not guaranteed to remain consistent release-to-release,
* and are not for use by apps linking against the SDK.
* @hide
*/
@Retention(RetentionPolicy.SOURCE)
public @interface PrivateApi {
}

View File

@@ -0,0 +1,36 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.annotation;
import java.lang.annotation.Target;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Indicates a constant field value should be exported to be used in the SDK tools.
* @hide
*/
@Target({ ElementType.FIELD })
@Retention(RetentionPolicy.SOURCE)
public @interface SdkConstant {
public static enum SdkConstantType {
ACTIVITY_INTENT_ACTION, BROADCAST_INTENT_ACTION, SERVICE_ACTION, INTENT_CATEGORY, FEATURE;
}
SdkConstantType value();
}

View File

@@ -0,0 +1,38 @@
/*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.annotation;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** Indicates that Lint should ignore the specified warnings for the annotated element. */
@Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE})
@Retention(RetentionPolicy.CLASS)
public @interface SuppressLint {
/**
* The set of warnings (identified by the lint issue id) that should be
* ignored by lint. It is not an error to specify an unrecognized name.
*/
String[] value();
}

View File

@@ -0,0 +1,35 @@
/*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.annotation;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** Indicates that Lint should treat this type as targeting a given API level, no matter what the
project target is. */
@Target({TYPE, METHOD, CONSTRUCTOR})
@Retention(RetentionPolicy.CLASS)
public @interface TargetApi {
/**
* This sets the target api level for the type..
*/
int value();
}

View File

@@ -0,0 +1,37 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.annotation;
import java.lang.annotation.Target;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Indicates a class is a widget usable by application developers to create UI.
* <p>
* This must be used in cases where:
* <ul>
* <li>The widget is not in the package <code>android.widget</code></li>
* <li>The widget extends <code>android.view.ViewGroup</code></li>
* </ul>
* @hide
*/
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.SOURCE)
public @interface Widget {
}

View File

@@ -0,0 +1,172 @@
package android.app;
import android.content.Context;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;
import android.view.View;
import android.view.LayoutInflater;
import android.view.Window;
import android.view.WindowManager;
import android.view.WindowManagerImpl;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserFactory;
import java.io.FileReader;
import java.io.StringReader;
public class Activity extends Context {
LayoutInflater layout_inflater;
Window window = new Window();
protected void set_window(long native_window) {
window.native_window = native_window;
}
public Activity() {
layout_inflater = new LayoutInflater();
}
public View root_view;
public final Application getApplication () {
return (Application)getApplicationContext();
}
public WindowManager getWindowManager() {
return new WindowManagerImpl();
}
public ComponentName getComponentName() {
return null;
}
public Intent getIntent() {
return null; // this is the main activity, and it wasn't opened as a result of someone calling "open with"
// return new Intent();
}
public boolean isFinishing() {
return false; // FIXME
}
public final boolean requestWindowFeature(int featureId) {
return false; // whatever feature it is, it's probably not supported
}
public final void setVolumeControlStream(int streamType) {}
protected void onCreate(Bundle savedInstanceState) {
System.out.println("- onCreate - yay!");
return;
}
protected void onStart() {
System.out.println("- onStart - yay!");
return;
}
protected void onRestart() {
System.out.println("- onRestart - yay!");
return;
}
protected void onResume() {
System.out.println("- onResume - yay!");
return;
}
protected void onPause() {
System.out.println("- onPause - yay!");
return;
}
protected void onStop() {
System.out.println("- onStop - yay!");
return;
}
protected void onDestroy() {
System.out.println("- onDestroy - yay!");
return;
}
public void onWindowFocusChanged(boolean hasFocus) {
System.out.println("- onWindowFocusChanged - yay! (hasFocus: "+hasFocus+")");
return;
}
/* --- */
public void setContentView(int layoutResID) throws Exception {
System.out.println("- setContentView - yay!");
String layout_xml_file = "data/" + getString(layoutResID);
System.out.println("loading layout from: " + layout_xml_file);
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
factory.setNamespaceAware(true);
XmlPullParser xpp = factory.newPullParser();
xpp.setInput( new FileReader(layout_xml_file) );
root_view = layout_inflater.inflate(xpp, null, false);
System.out.println("~~~~~~~~~~~");
System.out.println(root_view);
System.out.println(root_view.widget);
System.out.println("~~~~~~~~~~~");
setContentView(root_view);
/* Window w = new Window();
w.setTitle(this.toString());
w.setDefaultSize(540, 960);
w.add(root_view.widget);
w.showAll();
w.connect(new Window.DeleteEvent() {
public boolean onDeleteEvent(Widget source, Event event) {
Gtk.mainQuit();
return false;
}
});*/
}
public void setContentView(View view) {
window.setContentView(view);
}
public <T extends android.view.View> T findViewById(int id) {
System.out.println("- findViewById - asked for view with id: " + id);
View view = View.view_by_id.get(id);
System.out.println("- findViewById - found this: " + view);
return (T) view;
}
public void invalidateOptionsMenu() {
System.out.println("invalidateOptionsMenu() called, should we do something?");
}
public Window getWindow() {
return this.window;
}
public final void runOnUiThread(Runnable action) {
action.run(); // FIXME: running synchronously for now
}
}

View File

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

View File

@@ -0,0 +1,45 @@
package android.app;
import android.content.Context;
import android.content.DialogInterface;
import android.view.View;
public class AlertDialog extends Dialog {
public static class Builder {
public Builder(Context context){
System.out.println("making an AlertDialog$Builder as we speak, my word!");
}
public AlertDialog.Builder setPositiveButton (int textId, DialogInterface.OnClickListener listener) {
return this;
}
public AlertDialog.Builder setPositiveButton (CharSequence text, DialogInterface.OnClickListener listener) {
return this;
}
public AlertDialog.Builder setCancelable (boolean cancelable) {
return this;
}
public AlertDialog.Builder setIcon (int iconId) {
return this;
}
public AlertDialog.Builder setTitle (CharSequence title) {
return this;
}
public AlertDialog.Builder setMessage (CharSequence message) {
return this;
}
public AlertDialog.Builder setView (View view) {
return this;
}
public AlertDialog create() {
return new AlertDialog();
}
}
}

View File

@@ -0,0 +1,7 @@
package android.app;
import android.content.Context;
public class Application extends Context {
}

View File

@@ -0,0 +1,19 @@
package android.app;
import android.content.Context;
public class Dialog {
public void show() {
System.out.println("totally showing the Dialog "+this+" right now, most definitely doing that");
}
public void dismiss() {
System.out.println("totally dismissing the Dialog "+this+" right now, which was most definitely being shown just a moment ago");
}
public class Builder {
public Builder(Context context){
System.out.println("making a Dialog$Builder as we speak, my word!");
}
}
}

View File

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

View File

@@ -0,0 +1,7 @@
package android.app;
public class KeyguardManager {
public boolean inKeyguardRestrictedInputMode() {
return false;
}
}

View File

@@ -0,0 +1,21 @@
package android.app;
import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
public class PendingIntent {
public static PendingIntent getBroadcast(Context context, int requestCode, Intent intent, int flags) {
return new PendingIntent();
}
public IntentSender getIntentSender() {
return null;
}
public void send (Context context, int code, Intent intent) {}
public class CanceledException extends Exception {
}
}

View File

@@ -0,0 +1,4 @@
package android.app;
public class ProgressDialog extends Dialog {
}

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,5 @@
package android.content;
public class ActivityNotFoundException extends Exception {
}

View File

@@ -0,0 +1,5 @@
package android.content;
public class BroadcastReceiver {
}

Some files were not shown because too many files have changed in this diff Show More