File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -690,6 +690,17 @@ static void load_override_properties() {
690
690
* has mounted /data.
691
691
*/
692
692
void load_persist_props (void ) {
693
+ // Devices with FDE have load_persist_props called twice; the first time when the temporary
694
+ // /data partition is mounted and then again once /data is truly mounted. We do not want to
695
+ // read persistent properties from the temporary /data partition or mark persistent properties
696
+ // as having been loaded during the first call, so we return in that case.
697
+ std::string crypto_state = android::base::GetProperty (" ro.crypto.state" , " " );
698
+ std::string crypto_type = android::base::GetProperty (" ro.crypto.type" , " " );
699
+ if (crypto_state == " encrypted" && crypto_type == " block" ) {
700
+ static size_t num_calls = 0 ;
701
+ if (++num_calls == 1 ) return ;
702
+ }
703
+
693
704
load_override_properties ();
694
705
/* Read persistent properties after all default values have been loaded. */
695
706
load_persistent_properties ();
You can’t perform that action at this time.
0 commit comments