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)
diff --git a/service/java/com/android/server/wifi/ConnectToNetworkNotificationBuilder.java b/service/java/com/android/server/wifi/ConnectToNetworkNotificationBuilder.java
index 4f7b4e8..053314d 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 @@
                 .setContentIntent(getPrivateBroadcast(ACTION_PICK_WIFI_NETWORK, notifierTag))
                 .addAction(connectAction)
                 .addAction(allNetworksAction)
+                .setVisibility(VISIBILITY_SECRET)
                 .build();
     }