Attempt to clear memory after keyguard PIN entry

Force object finalization and garbage collection to remove shards
of user PIN from memory.

Bug: 189315376
Test: Unlock keyguard; take ramdump; search for PIN in the dump
Change-Id: I6d951babc225998d959669117c26f823f28fa706
This commit is contained in:
Rubin Xu
2021-08-09 17:03:34 +01:00
parent 9028f4992c
commit 906773a97f

View File

@@ -146,7 +146,9 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
try {
Thread.sleep(5000);
} catch (InterruptedException ignored) { }
Runtime.getRuntime().gc();
System.gc();
System.runFinalization();
System.gc();
});
} else {
SysUiStatsLog.write(SysUiStatsLog.KEYGUARD_BOUNCER_PASSWORD_ENTERED,