Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f9b6d38d authored by Xavier Ducrohet's avatar Xavier Ducrohet
Browse files

Add feature list support to DroidDoc.

Similarly to intent actions/categories, DroidDoc look
for the FEATURE-type SdkConstant annotation and builds
a list of optional features for the platform.

This is then packaged with the SDK to be used by the
custom editors (manifest editor in this case)

Change-Id: Icb5cf14ebd8251017cd850eacfdbb889219b3697
parent 502c498f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ public class DroidDoc
    private static final String SDK_CONSTANT_TYPE_BROADCAST_ACTION = "android.annotation.SdkConstant.SdkConstantType.BROADCAST_INTENT_ACTION";
    private static final String SDK_CONSTANT_TYPE_SERVICE_ACTION = "android.annotation.SdkConstant.SdkConstantType.SERVICE_INTENT_ACTION";
    private static final String SDK_CONSTANT_TYPE_CATEGORY = "android.annotation.SdkConstant.SdkConstantType.INTENT_CATEGORY";
    private static final String SDK_CONSTANT_TYPE_FEATURE = "android.annotation.SdkConstant.SdkConstantType.FEATURE";
    private static final String SDK_WIDGET_ANNOTATION = "android.annotation.Widget";
    private static final String SDK_LAYOUT_ANNOTATION = "android.annotation.Layout";

@@ -1147,6 +1148,7 @@ public class DroidDoc
        ArrayList<String> broadcastActions = new ArrayList<String>();
        ArrayList<String> serviceActions = new ArrayList<String>();
        ArrayList<String> categories = new ArrayList<String>();
        ArrayList<String> features = new ArrayList<String>();

        ArrayList<ClassInfo> layouts = new ArrayList<ClassInfo>();
        ArrayList<ClassInfo> widgets = new ArrayList<ClassInfo>();
@@ -1177,6 +1179,8 @@ public class DroidDoc
                                        serviceActions.add(cValue.toString());
                                    } else if (SDK_CONSTANT_TYPE_CATEGORY.equals(type)) {
                                        categories.add(cValue.toString());
                                    } else if (SDK_CONSTANT_TYPE_FEATURE.equals(type)) {
                                        features.add(cValue.toString());
                                    }
                                }
                                break;
@@ -1245,6 +1249,9 @@ public class DroidDoc
        Collections.sort(categories);
        writeValues(output + "/categories.txt", categories);

        Collections.sort(features);
        writeValues(output + "/features.txt", features);

        // before writing the list of classes, we do some checks, to make sure the layout params
        // are enclosed by a layout class (and not one that has been declared as a widget)
        for (int i = 0 ; i < layoutParams.size();) {