Fixed a bug where notifications could stay dark
am: b88b98477a
* commit 'b88b98477ae725092c27dfe52f7fca3d4f29913e':
Fixed a bug where notifications could stay dark
This commit is contained in:
@@ -584,11 +584,7 @@ public class NotificationContentView extends FrameLayout {
|
||||
}
|
||||
|
||||
public void setDark(boolean dark, boolean fade, long delay) {
|
||||
setDark(dark, fade, delay, false /* force */);
|
||||
}
|
||||
|
||||
public void setDark(boolean dark, boolean fade, long delay, boolean force) {
|
||||
if ((!force && mDark == dark) || mContractedChild == null) {
|
||||
if (mContractedChild == null) {
|
||||
return;
|
||||
}
|
||||
mDark = dark;
|
||||
@@ -645,7 +641,7 @@ public class NotificationContentView extends FrameLayout {
|
||||
if (mHeadsUpChild != null) {
|
||||
mHeadsUpWrapper.notifyContentUpdated(entry.notification);
|
||||
}
|
||||
setDark(mDark, false /* animate */, 0 /* delay */, true /* force */);
|
||||
setDark(mDark, false /* animate */, 0 /* delay */);
|
||||
}
|
||||
|
||||
private void updateSingleLineView() {
|
||||
|
||||
@@ -35,7 +35,7 @@ public class NotificationCustomViewWrapper extends NotificationViewWrapper {
|
||||
|
||||
@Override
|
||||
public void setDark(boolean dark, boolean fade, long delay) {
|
||||
if (dark == mDark) {
|
||||
if (dark == mDark && mDarkInitialized) {
|
||||
return;
|
||||
}
|
||||
super.setDark(dark, fade, delay);
|
||||
|
||||
@@ -148,7 +148,7 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper {
|
||||
|
||||
@Override
|
||||
public void setDark(boolean dark, boolean fade, long delay) {
|
||||
if (dark == mDark) {
|
||||
if (dark == mDark && mDarkInitialized) {
|
||||
return;
|
||||
}
|
||||
super.setDark(dark, fade, delay);
|
||||
|
||||
@@ -163,7 +163,7 @@ public class NotificationTemplateViewWrapper extends NotificationHeaderViewWrapp
|
||||
|
||||
@Override
|
||||
public void setDark(boolean dark, boolean fade, long delay) {
|
||||
if (dark == mDark) {
|
||||
if (dark == mDark && mDarkInitialized) {
|
||||
return;
|
||||
}
|
||||
super.setDark(dark, fade, delay);
|
||||
|
||||
@@ -32,6 +32,7 @@ public abstract class NotificationViewWrapper implements TransformableView {
|
||||
|
||||
protected final View mView;
|
||||
protected boolean mDark;
|
||||
protected boolean mDarkInitialized = false;
|
||||
|
||||
public static NotificationViewWrapper wrap(Context ctx, View v) {
|
||||
if (v.getId() == com.android.internal.R.id.status_bar_latest_event_content) {
|
||||
@@ -61,6 +62,7 @@ public abstract class NotificationViewWrapper implements TransformableView {
|
||||
*/
|
||||
public void setDark(boolean dark, boolean fade, long delay) {
|
||||
mDark = dark;
|
||||
mDarkInitialized = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,7 +70,7 @@ public abstract class NotificationViewWrapper implements TransformableView {
|
||||
* @param notification
|
||||
*/
|
||||
public void notifyContentUpdated(StatusBarNotification notification) {
|
||||
mDark = false;
|
||||
mDarkInitialized = false;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user