Add more tests for restricted broadcasts.
Test that certain wifi broadcasts are properly protected by the system.
This detects the presence of a security bug which allows the modification
of wifi proxy settings.
This list was taken from frameworks/base commit
47918ae3b4e7ebb54711884e9ff9d0300591ab8b
Public Bug: http://code.google.com/p/android/issues/detail?id=40506
Bug: 7622253
(cherry picked from commit 7993485b87a11657654a50e45be81cbeccd2f009)
Change-Id: I69478b20975c09f87914ba04d0a7009aa6ef6c88
diff --git a/tests/tests/permission2/src/android/permission2/cts/ProtectedBroadcastsTest.java b/tests/tests/permission2/src/android/permission2/cts/ProtectedBroadcastsTest.java
index 1fd6bfe..877a89e 100755
--- a/tests/tests/permission2/src/android/permission2/cts/ProtectedBroadcastsTest.java
+++ b/tests/tests/permission2/src/android/permission2/cts/ProtectedBroadcastsTest.java
@@ -16,9 +16,7 @@
package android.permission2.cts;
-import android.content.Context;
import android.content.Intent;
-import android.os.Bundle;
import android.test.AndroidTestCase;
/**
@@ -62,13 +60,33 @@
"android.intent.action.NETWORK_SET_TIMEZONE",
"android.intent.action.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS",
"android.intent.action.ACTION_MDN_STATE_CHANGED",
- "android.provider.Telephony.SPN_STRINGS_UPDATED"
+ "android.provider.Telephony.SPN_STRINGS_UPDATED",
+ "android.intent.action.ANY_DATA_STATE",
+ "com.android.server.WifiManager.action.START_SCAN",
+ "com.android.server.WifiManager.action.DELAYED_DRIVER_STOP",
+ "android.net.wifi.WIFI_STATE_CHANGED",
+ "android.net.wifi.WIFI_AP_STATE_CHANGED",
+ "android.net.wifi.SCAN_RESULTS",
+ "android.net.wifi.RSSI_CHANGED",
+ "android.net.wifi.STATE_CHANGE",
+ "android.net.wifi.LINK_CONFIGURATION_CHANGED",
+ "android.net.wifi.CONFIGURED_NETWORKS_CHANGE",
+ "android.net.wifi.supplicant.CONNECTION_CHANGE",
+ "android.net.wifi.supplicant.STATE_CHANGE",
+ "android.net.wifi.p2p.STATE_CHANGED",
+ "android.net.wifi.p2p.DISCOVERY_STATE_CHANGE",
+ "android.net.wifi.p2p.THIS_DEVICE_CHANGED",
+ "android.net.wifi.p2p.PEERS_CHANGED",
+ "android.net.wifi.p2p.CONNECTION_STATE_CHANGE",
+ "android.net.wifi.p2p.PERSISTENT_GROUPS_CHANGED",
+ "android.net.conn.TETHER_STATE_CHANGED",
+ "android.net.conn.INET_CONDITION_ACTION"
};
/**
* Verify that protected broadcast actions can't be sent.
*/
- public void testProcessOutgoingCall() {
+ public void testSendProtectedBroadcasts() {
for (String action : BROADCASTS) {
try {
Intent intent = new Intent(action);