Merge "Add falsing protection for all notification settings guts" into rvc-dev am: 8c9e2496a6 am: 0d51d48a84
Change-Id: I33a371ab21d36f8675f9bb2734b70b989e8df167
This commit is contained in:
@@ -188,6 +188,11 @@ public class AppOpsInfo extends LinearLayout implements NotificationGuts.GutsCon
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean needsFalsingProtection() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View getContentView() {
|
public View getContentView() {
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -403,6 +403,11 @@ public class NotificationConversationInfo extends LinearLayout implements
|
|||||||
// TODO: do we need to do anything here?
|
// TODO: do we need to do anything here?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean needsFalsingProtection() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
|
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
|
||||||
super.onInitializeAccessibilityEvent(event);
|
super.onInitializeAccessibilityEvent(event);
|
||||||
|
|||||||
@@ -104,6 +104,12 @@ public class NotificationGuts extends FrameLayout {
|
|||||||
* Called when the guts view has finished its close animation.
|
* Called when the guts view has finished its close animation.
|
||||||
*/
|
*/
|
||||||
default void onFinishedClosing() {}
|
default void onFinishedClosing() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether falsing protection is needed before showing the contents of this
|
||||||
|
* view on the lockscreen
|
||||||
|
*/
|
||||||
|
boolean needsFalsingProtection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface OnGutsClosedListener {
|
public interface OnGutsClosedListener {
|
||||||
|
|||||||
@@ -523,23 +523,27 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx
|
|||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
NotificationMenuRowPlugin.MenuItem menuItem) {
|
NotificationMenuRowPlugin.MenuItem menuItem) {
|
||||||
if (menuItem.getGutsView() instanceof NotificationInfo) {
|
if (menuItem.getGutsView() instanceof NotificationGuts.GutsContent) {
|
||||||
if (mStatusBarStateController instanceof StatusBarStateControllerImpl) {
|
NotificationGuts.GutsContent gutsView =
|
||||||
((StatusBarStateControllerImpl) mStatusBarStateController)
|
(NotificationGuts.GutsContent) menuItem.getGutsView();
|
||||||
.setLeaveOpenOnKeyguardHide(true);
|
if (gutsView.needsFalsingProtection()) {
|
||||||
|
if (mStatusBarStateController instanceof StatusBarStateControllerImpl) {
|
||||||
|
((StatusBarStateControllerImpl) mStatusBarStateController)
|
||||||
|
.setLeaveOpenOnKeyguardHide(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
Runnable r = () -> mMainHandler.post(
|
||||||
|
() -> openGutsInternal(view, x, y, menuItem));
|
||||||
|
|
||||||
|
mStatusBarLazy.get().executeRunnableDismissingKeyguard(
|
||||||
|
r,
|
||||||
|
null /* cancelAction */,
|
||||||
|
false /* dismissShade */,
|
||||||
|
true /* afterKeyguardGone */,
|
||||||
|
true /* deferred */);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Runnable r = () -> mMainHandler.post(
|
|
||||||
() -> openGutsInternal(view, x, y, menuItem));
|
|
||||||
|
|
||||||
mStatusBarLazy.get().executeRunnableDismissingKeyguard(
|
|
||||||
r,
|
|
||||||
null /* cancelAction */,
|
|
||||||
false /* dismissShade */,
|
|
||||||
true /* afterKeyguardGone */,
|
|
||||||
true /* deferred */);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return openGutsInternal(view, x, y, menuItem);
|
return openGutsInternal(view, x, y, menuItem);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -489,6 +489,11 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
|
|||||||
mMetricsLogger.write(notificationControlsLogMaker().setType(MetricsEvent.TYPE_CLOSE));
|
mMetricsLogger.write(notificationControlsLogMaker().setType(MetricsEvent.TYPE_CLOSE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean needsFalsingProtection() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
|
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
|
||||||
super.onInitializeAccessibilityEvent(event);
|
super.onInitializeAccessibilityEvent(event);
|
||||||
|
|||||||
@@ -442,6 +442,11 @@ public class NotificationSnooze extends LinearLayout
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean needsFalsingProtection() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public class NotificationSnoozeOption implements SnoozeOption {
|
public class NotificationSnoozeOption implements SnoozeOption {
|
||||||
private SnoozeCriterion mCriterion;
|
private SnoozeCriterion mCriterion;
|
||||||
private int mMinutesToSnoozeFor;
|
private int mMinutesToSnoozeFor;
|
||||||
|
|||||||
@@ -300,6 +300,11 @@ public class PartialConversationInfo extends LinearLayout implements
|
|||||||
// TODO: do we need to do anything here?
|
// TODO: do we need to do anything here?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean needsFalsingProtection() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
|
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
|
||||||
super.onInitializeAccessibilityEvent(event);
|
super.onInitializeAccessibilityEvent(event);
|
||||||
|
|||||||
Reference in New Issue
Block a user