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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17693579

Change-Id: Ie279a9aed00666561b6d09307941fe278a710994
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-04-13 10:40:15 +00:00
committed by Automerger Merge Worker
3 changed files with 37 additions and 25 deletions

View File

@@ -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);
}
/**

View File

@@ -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

18
tools/apilint/deprecated_at_birth.py Normal file → Executable file
View File

@@ -1,4 +1,4 @@
#!/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()