diff options
| author | Ezio Lacandia Bijelkic <brabus84@gmail.com> | 2018-05-30 14:11:32 -0400 |
|---|---|---|
| committer | ezio84 <brabus84@gmail.com> | 2018-05-31 08:06:41 +0200 |
| commit | d0a4c87e456b950f324ef540c6257d4368d84b83 (patch) | |
| tree | c2dc68d16fa3035dac6cb67a3eb775f0ebc9f749 | |
| parent | d7617f97240e3edfa6e683be2e348f23655f7556 (diff) | |
DUI: fix button custom image icon not being loaded on encrypted device
if the device is fully encrypted, resources in the data partition
can't be loaded till the user fully unlocks the device after boot
inserting the pin, so Fling or SmartBar button icons can't be set
correctly if they are linked to a custom image in that partition.
Navbar code, instead, gets loaded before the unlock steps are done.
This has been noticed on Pixel2xl, shamu and other devices, where for
example the user gets the default DU logo instead of his custom one.
To fix this, we just trigger an icon refresh after the user completes
the unlock process and all files in the data partition are available.
PS: In the future it'd be better to take care of this boot completed event
for all features where we must access personal files on encrypted devices.
Change-Id: Iec5508dba5538ea6530721f40724be1a59db3f22
3 files changed, 15 insertions, 1 deletions
diff --git a/src/com/android/systemui/navigation/BaseNavigationBar.java b/src/com/android/systemui/navigation/BaseNavigationBar.java index bcf7e33..395716f 100644 --- a/src/com/android/systemui/navigation/BaseNavigationBar.java +++ b/src/com/android/systemui/navigation/BaseNavigationBar.java @@ -149,6 +149,8 @@ public abstract class BaseNavigationBar extends LinearLayout implements Navigato notifyScreenStateChange(true); } else if (Intent.ACTION_SCREEN_OFF.equals(intent.getAction())) { notifyScreenStateChange(false); + } else if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) { + notifyBootCompleted(); } else { onReceive(intent); if (mPulse != null) { @@ -178,11 +180,13 @@ public abstract class BaseNavigationBar extends LinearLayout implements Navigato filter.addAction(PowerManager.ACTION_POWER_SAVE_MODE_CHANGING); filter.addAction(Intent.ACTION_SCREEN_ON); filter.addAction(Intent.ACTION_SCREEN_OFF); + filter.addAction(Intent.ACTION_BOOT_COMPLETED); context.registerReceiver(mReceiver, filter); } - // require implementation. Surely they have something to clean up + // require implementation protected abstract void onDispose(); + protected abstract void notifyBootCompleted(); // any implementation specific handling can be handled here protected void onInflateFromUser() {} diff --git a/src/com/android/systemui/navigation/fling/FlingView.java b/src/com/android/systemui/navigation/fling/FlingView.java index 1bdfb6c..70e4773 100644 --- a/src/com/android/systemui/navigation/fling/FlingView.java +++ b/src/com/android/systemui/navigation/fling/FlingView.java @@ -390,6 +390,11 @@ public class FlingView extends BaseNavigationBar { }*/ @Override + protected void notifyBootCompleted() { + mLogoController.updateLogo(FlingView.this, getFlingLogo()); + } + + @Override public void setMediaPlaying(boolean playing) { PulseController mPulse = getPulseController(); if (mPulse != null) { diff --git a/src/com/android/systemui/navigation/smartbar/SmartBarView.java b/src/com/android/systemui/navigation/smartbar/SmartBarView.java index f3cc95c..dbea7e0 100644 --- a/src/com/android/systemui/navigation/smartbar/SmartBarView.java +++ b/src/com/android/systemui/navigation/smartbar/SmartBarView.java @@ -590,6 +590,11 @@ public class SmartBarView extends BaseNavigationBar { } @Override + protected void notifyBootCompleted() { + updateCurrentIcons(); + } + + @Override public void reorient() { mEditor.prepareToReorient(); super.reorient(); |
