From f66c83ebd45a367c609ed7c7443113faa667504e Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Tue, 17 Nov 2020 13:22:19 -0800 Subject: ConnectToNetworkNotification: Disallow connect from lock screen Avoids malicious usage of the notification to add a saved wifi network without unlocking the device. Bug: 172584372 Test: Manual: ONA notification not shown in the lockscreen. Visible when the device is unlocked. Change-Id: I760cd4303b846a214737edc49254f6327e05d357 Merged-In: I760cd4303b846a214737edc49254f6327e05d357 (cherry picked from commit ec2ba25598cec3403460ee6d5f6b74399fbca598) --- .../com/android/server/wifi/ConnectToNetworkNotificationBuilder.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/service/java/com/android/server/wifi/ConnectToNetworkNotificationBuilder.java b/service/java/com/android/server/wifi/ConnectToNetworkNotificationBuilder.java index 4f7b4e820..053314dc7 100644 --- a/service/java/com/android/server/wifi/ConnectToNetworkNotificationBuilder.java +++ b/service/java/com/android/server/wifi/ConnectToNetworkNotificationBuilder.java @@ -16,6 +16,8 @@ package com.android.server.wifi; +import static android.app.Notification.VISIBILITY_SECRET; + import android.app.Notification; import android.app.PendingIntent; import android.content.Intent; @@ -95,6 +97,7 @@ public class ConnectToNetworkNotificationBuilder { .setContentIntent(getPrivateBroadcast(ACTION_PICK_WIFI_NETWORK, notifierTag)) .addAction(connectAction) .addAction(allNetworksAction) + .setVisibility(VISIBILITY_SECRET) .build(); } -- cgit v1.2.3