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

Commit 26968d81 authored by Adrian Roos's avatar Adrian Roos Committed by Gerrit Code Review
Browse files

Merge "Apilint: No longer flag interface callbacks"

parents 6e16eb10 cdb81670
Loading
Loading
Loading
Loading
+0 −4
Original line number Original line Diff line number Diff line
@@ -826,7 +826,6 @@ def verify_method_names(clazz):
@verifier
@verifier
def verify_callbacks(clazz):
def verify_callbacks(clazz):
    """Verify Callback classes.
    """Verify Callback classes.
    All callback classes must be abstract.
    All methods must follow onFoo() naming style."""
    All methods must follow onFoo() naming style."""
    if clazz.fullname == "android.speech.tts.SynthesisCallback": return
    if clazz.fullname == "android.speech.tts.SynthesisCallback": return


@@ -836,9 +835,6 @@ def verify_callbacks(clazz):
        warn(clazz, None, "L1", "Class should be named FooCallback")
        warn(clazz, None, "L1", "Class should be named FooCallback")


    if clazz.name.endswith("Callback"):
    if clazz.name.endswith("Callback"):
        if "interface" in clazz.split:
            error(clazz, None, "CL3", "Callbacks must be abstract class to enable extension in future API levels")

        for m in clazz.methods:
        for m in clazz.methods:
            if not re.match("on[A-Z][a-z]*", m.name):
            if not re.match("on[A-Z][a-z]*", m.name):
                error(clazz, m, "L1", "Callback method names must be onFoo() style")
                error(clazz, m, "L1", "Callback method names must be onFoo() style")