Merge "Remove keyguard unlock listener to fix leak." into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c49da4808e
@@ -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
|
@Inject
|
||||||
public KeyguardClockSwitchController(
|
public KeyguardClockSwitchController(
|
||||||
KeyguardClockSwitch keyguardClockSwitch,
|
KeyguardClockSwitch keyguardClockSwitch,
|
||||||
@@ -162,22 +180,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
|
|||||||
mUiExecutor = uiExecutor;
|
mUiExecutor = uiExecutor;
|
||||||
mKeyguardUnlockAnimationController = keyguardUnlockAnimationController;
|
mKeyguardUnlockAnimationController = keyguardUnlockAnimationController;
|
||||||
mDumpManager = dumpManager;
|
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();
|
updateDoubleLineClock();
|
||||||
|
|
||||||
|
mKeyguardUnlockAnimationController.addKeyguardUnlockAnimationListener(
|
||||||
|
mKeyguardUnlockAnimationListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
int getNotificationIconAreaHeight() {
|
int getNotificationIconAreaHeight() {
|
||||||
@@ -287,6 +292,9 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
|
|||||||
mView.setClockPlugin(null, mStatusBarStateController.getState());
|
mView.setClockPlugin(null, mStatusBarStateController.getState());
|
||||||
|
|
||||||
mSecureSettings.unregisterContentObserver(mDoubleLineClockObserver);
|
mSecureSettings.unregisterContentObserver(mDoubleLineClockObserver);
|
||||||
|
|
||||||
|
mKeyguardUnlockAnimationController.removeKeyguardUnlockAnimationListener(
|
||||||
|
mKeyguardUnlockAnimationListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -389,6 +389,10 @@ class KeyguardUnlockAnimationController @Inject constructor(
|
|||||||
listeners.add(listener)
|
listeners.add(listener)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun removeKeyguardUnlockAnimationListener(listener: KeyguardUnlockAnimationListener) {
|
||||||
|
listeners.remove(listener)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called from [KeyguardViewMediator] to tell us that the RemoteAnimation on the surface behind
|
* 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
|
* the keyguard has started successfully. We can use these parameters to directly manipulate the
|
||||||
|
|||||||
Reference in New Issue
Block a user