summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java
diff options
context:
space:
mode:
authorDave Mankoff <mankoff@google.com>2020-10-22 10:49:13 -0400
committerDave Mankoff <mankoff@google.com>2020-10-22 10:49:13 -0400
commitdd1341ec62c6c4e595e0e8168c2401d99a741ab0 (patch)
treeb7000308e9988ef79c2d5834dd6ea049f9d362cb /packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java
parent311a1510b790bfbacfdb3c88d7f759be3d2889c9 (diff)
Add initInternal to ViewController.
ViewController's init method was not ideal to override. On the one hand, if you put a call super.init() first your onViewAttach method is called before you're subclass's init. Further, if you put your own code befer super.init(), you are still left with the problem that your init is not automatically idempotent, and multiple calls to #init() could result in multiple executions of your code unless you handle it yourself. With this change, #initInternal() is introduced, giving ViewControllers a place to put their run-once code such that it runs before any view-attachment callbacks are fired. Fixes: 171472009 Test: manual Change-Id: I2e284024c82e3f7c7b6f29f22a1ffa3c8aae9fcb
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java')
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java
index 351369c51364..1d12c1a7abdf 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java
@@ -178,8 +178,7 @@ public class KeyguardHostViewController extends ViewController<KeyguardHostView>
}
/** Initialize the Controller. */
- public void init() {
- super.init();
+ public void initInternal() {
mKeyguardSecurityContainerController.init();
}