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

Commit 048ccece authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Remove keyguard unlock listener to fix leak." into tm-dev am: c49da480 am: 7b7fcd3d

parents 5475e102 7b7fcd3d
Loading
Loading
Loading
Loading
+24 −16
Original line number Diff line number Diff line
@@ -130,6 +130,24 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
        }
    };

    private final KeyguardUnlockAnimationController.KeyguardUnlockAnimationListener
            mKeyguardUnlockAnimationListener =
            new KeyguardUnlockAnimationController.KeyguardUnlockAnimationListener() {
                @Override
                public void onSmartspaceSharedElementTransitionStarted() {
                    // The smartspace needs to be able to translate out of bounds in order to
                    // end up where the launcher's smartspace is, while its container is being
                    // swiped off the top of the screen.
                    setClipChildrenForUnlock(false);
                }

                @Override
                public void onUnlockAnimationFinished() {
                    // For performance reasons, reset this once the unlock animation ends.
                    setClipChildrenForUnlock(true);
                }
            };

    @Inject
    public KeyguardClockSwitchController(
            KeyguardClockSwitch keyguardClockSwitch,
@@ -162,22 +180,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
        mUiExecutor = uiExecutor;
        mKeyguardUnlockAnimationController = keyguardUnlockAnimationController;
        mDumpManager = dumpManager;
        mKeyguardUnlockAnimationController.addKeyguardUnlockAnimationListener(
                new KeyguardUnlockAnimationController.KeyguardUnlockAnimationListener() {
                    @Override
                    public void onSmartspaceSharedElementTransitionStarted() {
                        // The smartspace needs to be able to translate out of bounds in order to
                        // end up where the launcher's smartspace is, while its container is being
                        // swiped off the top of the screen.
                        setClipChildrenForUnlock(false);
                    }

                    @Override
                    public void onUnlockAnimationFinished() {
                        // For performance reasons, reset this once the unlock animation ends.
                        setClipChildrenForUnlock(true);
                    }
                });
    }

    /**
@@ -272,6 +274,9 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
        );

        updateDoubleLineClock();

        mKeyguardUnlockAnimationController.addKeyguardUnlockAnimationListener(
                mKeyguardUnlockAnimationListener);
    }

    int getNotificationIconAreaHeight() {
@@ -287,6 +292,9 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
        mView.setClockPlugin(null, mStatusBarStateController.getState());

        mSecureSettings.unregisterContentObserver(mDoubleLineClockObserver);

        mKeyguardUnlockAnimationController.removeKeyguardUnlockAnimationListener(
                mKeyguardUnlockAnimationListener);
    }

    /**
+4 −0
Original line number Diff line number Diff line
@@ -389,6 +389,10 @@ class KeyguardUnlockAnimationController @Inject constructor(
        listeners.add(listener)
    }

    fun removeKeyguardUnlockAnimationListener(listener: KeyguardUnlockAnimationListener) {
        listeners.remove(listener)
    }

    /**
     * Called from [KeyguardViewMediator] to tell us that the RemoteAnimation on the surface behind
     * the keyguard has started successfully. We can use these parameters to directly manipulate the
+9 −9
Original line number Diff line number Diff line
#!/usr/bin/env python
#!/usr/bin/env python3

# Copyright (C) 2021 The Android Open Source Project
#
@@ -208,17 +208,17 @@ def _parse_stream(f, api={}):

def _parse_stream_path(path):
    api = {}
    print "Parsing", path
    print("Parsing %s" % path)
    for f in os.listdir(path):
        f = os.path.join(path, f)
        if not os.path.isfile(f): continue
        if not f.endswith(".txt"): continue
        if f.endswith("removed.txt"): continue
        print "\t", f
        print("\t%s" % f)
        with open(f) as s:
            api = _parse_stream(s, api)
    print "Parsed", len(api), "APIs"
    print
    print("Parsed %d APIs" % len(api))
    print()
    return api


@@ -306,8 +306,8 @@ if __name__ == "__main__":
            if "@Deprecated " in i.raw:
                error(clazz, i, None, "Found API deprecation at birth " + i.ident)

    print "%s Deprecated at birth %s\n" % ((format(fg=WHITE, bg=BLUE, bold=True),
                                            format(reset=True)))
    print("%s Deprecated at birth %s\n" % ((format(fg=WHITE, bg=BLUE, bold=True),
                                            format(reset=True))))
    for f in sorted(failures):
        print failures[f]
        print
        print(failures[f])
        print()