summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Qiu <zqiu@google.com>2017-04-03 17:08:33 +0000
committerPeter Qiu <zqiu@google.com>2017-04-03 13:10:29 -0700
commit07816a4745b8030911869ceb58fa735e47834fe4 (patch)
tree0108a7e11280d8f8ef014c461acae2e5211d5483
parent31eb1e8997a0ee98df33f6d8b3b907e0fcb070ed (diff)
[Reland] hotspot2: track creator UID for installed providers
This is purely for debugging purpose. It is not used for restricting apps that can update/remove configs. Since for Passpoint configuration, the app that's responsible for adding a config might not be the app that's responsible for removing that config. Bug: 36566563 Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Test: verify Creator UID in the output of "adb shell dumpsys" and the config store file Change-Id: I5c651fb204b6e07c2b1d6324350d63d25a38c894
-rw-r--r--service/java/com/android/server/wifi/WifiServiceImpl.java3
-rw-r--r--service/java/com/android/server/wifi/WifiStateMachine.java9
-rw-r--r--service/java/com/android/server/wifi/hotspot2/PasspointConfigStoreData.java8
-rw-r--r--service/java/com/android/server/wifi/hotspot2/PasspointManager.java10
-rw-r--r--service/java/com/android/server/wifi/hotspot2/PasspointObjectFactory.java4
-rw-r--r--service/java/com/android/server/wifi/hotspot2/PasspointProvider.java13
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java10
-rw-r--r--tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigStoreDataTest.java6
-rw-r--r--tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java41
-rw-r--r--tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointProviderTest.java3
10 files changed, 65 insertions, 42 deletions
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java
index d715fae63..b68301010 100644
--- a/service/java/com/android/server/wifi/WifiServiceImpl.java
+++ b/service/java/com/android/server/wifi/WifiServiceImpl.java
@@ -1098,7 +1098,8 @@ public class WifiServiceImpl extends IWifiManager.Stub {
com.android.internal.R.bool.config_wifi_hotspot2_enabled)) {
throw new UnsupportedOperationException("Passpoint not enabled");
}
- return mWifiStateMachine.syncAddOrUpdatePasspointConfig(mWifiStateMachineChannel, config);
+ return mWifiStateMachine.syncAddOrUpdatePasspointConfig(mWifiStateMachineChannel, config,
+ Binder.getCallingUid());
}
/**
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java
index 6e5da1716..3d5c9aa5b 100644
--- a/service/java/com/android/server/wifi/WifiStateMachine.java
+++ b/service/java/com/android/server/wifi/WifiStateMachine.java
@@ -1846,9 +1846,9 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss
* @return true on success
*/
public boolean syncAddOrUpdatePasspointConfig(AsyncChannel channel,
- PasspointConfiguration config) {
+ PasspointConfiguration config, int uid) {
Message resultMsg = channel.sendMessageSynchronously(CMD_ADD_OR_UPDATE_PASSPOINT_CONFIG,
- config);
+ uid, 0, config);
boolean result = (resultMsg.arg1 == SUCCESS);
resultMsg.recycle();
return result;
@@ -3875,7 +3875,8 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss
break;
case CMD_ADD_OR_UPDATE_PASSPOINT_CONFIG:
int addResult = mPasspointManager.addOrUpdateProvider(
- (PasspointConfiguration) message.obj) ? SUCCESS : FAILURE;
+ (PasspointConfiguration) message.obj, message.arg1)
+ ? SUCCESS : FAILURE;
replyToMessage(message, message.what, addResult);
break;
case CMD_REMOVE_PASSPOINT_CONFIG:
@@ -5174,7 +5175,7 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss
break;
case CMD_ADD_OR_UPDATE_PASSPOINT_CONFIG:
PasspointConfiguration passpointConfig = (PasspointConfiguration) message.obj;
- if (mPasspointManager.addOrUpdateProvider(passpointConfig)) {
+ if (mPasspointManager.addOrUpdateProvider(passpointConfig, message.arg1)) {
String fqdn = passpointConfig.getHomeSp().getFqdn();
if (isProviderOwnedNetwork(mTargetNetworkId, fqdn)
|| isProviderOwnedNetwork(mLastNetworkId, fqdn)) {
diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointConfigStoreData.java b/service/java/com/android/server/wifi/hotspot2/PasspointConfigStoreData.java
index 16432bdd7..74a4760b4 100644
--- a/service/java/com/android/server/wifi/hotspot2/PasspointConfigStoreData.java
+++ b/service/java/com/android/server/wifi/hotspot2/PasspointConfigStoreData.java
@@ -60,6 +60,7 @@ public class PasspointConfigStoreData implements WifiConfigStore.StoreData {
"Configuration";
private static final String XML_TAG_PROVIDER_ID = "ProviderID";
+ private static final String XML_TAG_CREATOR_UID = "CreatorUID";
private static final String XML_TAG_CA_CERTIFICATE_ALIAS = "CaCertificateAlias";
private static final String XML_TAG_CLIENT_CERTIFICATE_ALIAS = "ClientCertificateAlias";
private static final String XML_TAG_CLIENT_PRIVATE_KEY_ALIAS = "ClientPrivateKeyAlias";
@@ -203,6 +204,7 @@ public class PasspointConfigStoreData implements WifiConfigStore.StoreData {
throws XmlPullParserException, IOException {
XmlUtil.writeNextSectionStart(out, XML_TAG_SECTION_HEADER_PASSPOINT_PROVIDER);
XmlUtil.writeNextValue(out, XML_TAG_PROVIDER_ID, provider.getProviderId());
+ XmlUtil.writeNextValue(out, XML_TAG_CREATOR_UID, provider.getCreatorUid());
XmlUtil.writeNextValue(out, XML_TAG_CA_CERTIFICATE_ALIAS,
provider.getCaCertificateAlias());
XmlUtil.writeNextValue(out, XML_TAG_CLIENT_CERTIFICATE_ALIAS,
@@ -298,6 +300,7 @@ public class PasspointConfigStoreData implements WifiConfigStore.StoreData {
private PasspointProvider deserializeProvider(XmlPullParser in, int outerTagDepth)
throws XmlPullParserException, IOException {
long providerId = Long.MIN_VALUE;
+ int creatorUid = Integer.MIN_VALUE;
String caCertificateAlias = null;
String clientCertificateAlias = null;
String clientPrivateKeyAlias = null;
@@ -311,6 +314,9 @@ public class PasspointConfigStoreData implements WifiConfigStore.StoreData {
case XML_TAG_PROVIDER_ID:
providerId = (long) value;
break;
+ case XML_TAG_CREATOR_UID:
+ creatorUid = (int) value;
+ break;
case XML_TAG_CA_CERTIFICATE_ALIAS:
caCertificateAlias = (String) value;
break;
@@ -337,7 +343,7 @@ public class PasspointConfigStoreData implements WifiConfigStore.StoreData {
if (config == null) {
throw new XmlPullParserException("Missing Passpoint configuration");
}
- return new PasspointProvider(config, mKeyStore, mSimAccessor, providerId,
+ return new PasspointProvider(config, mKeyStore, mSimAccessor, providerId, creatorUid,
caCertificateAlias, clientCertificateAlias, clientPrivateKeyAlias);
}
diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointManager.java b/service/java/com/android/server/wifi/hotspot2/PasspointManager.java
index deec28464..9000d4366 100644
--- a/service/java/com/android/server/wifi/hotspot2/PasspointManager.java
+++ b/service/java/com/android/server/wifi/hotspot2/PasspointManager.java
@@ -233,7 +233,7 @@ public class PasspointManager {
* @param config Configuration of the Passpoint provider to be added
* @return true if provider is added, false otherwise
*/
- public boolean addOrUpdateProvider(PasspointConfiguration config) {
+ public boolean addOrUpdateProvider(PasspointConfiguration config, int uid) {
if (config == null) {
Log.e(TAG, "Configuration not provided");
return false;
@@ -260,7 +260,7 @@ public class PasspointManager {
// Create a provider and install the necessary certificates and keys.
PasspointProvider newProvider = mObjectFactory.makePasspointProvider(
- config, mKeyStore, mSimAccessor, mProviderIndex++);
+ config, mKeyStore, mSimAccessor, mProviderIndex++, uid);
if (!newProvider.installCertsAndKeys()) {
Log.e(TAG, "Failed to install certificates and keys to keystore");
@@ -276,7 +276,8 @@ public class PasspointManager {
mProviders.put(config.getHomeSp().getFqdn(), newProvider);
mWifiConfigManager.saveToStore(true /* forceWrite */);
- Log.d(TAG, "Added/updated Passpoint configuration: " + config.getHomeSp().getFqdn());
+ Log.d(TAG, "Added/updated Passpoint configuration: " + config.getHomeSp().getFqdn()
+ + " by " + uid);
return true;
}
@@ -540,7 +541,8 @@ public class PasspointManager {
// Note that for legacy configuration, the alias for client private key is the same as the
// alias for the client certificate.
PasspointProvider provider = new PasspointProvider(passpointConfig, mKeyStore,
- mSimAccessor, mProviderIndex++, enterpriseConfig.getCaCertificateAlias(),
+ mSimAccessor, mProviderIndex++, wifiConfig.creatorUid,
+ enterpriseConfig.getCaCertificateAlias(),
enterpriseConfig.getClientCertificateAlias(),
enterpriseConfig.getClientCertificateAlias());
mProviders.put(passpointConfig.getHomeSp().getFqdn(), provider);
diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointObjectFactory.java b/service/java/com/android/server/wifi/hotspot2/PasspointObjectFactory.java
index 16982969b..c41c49acb 100644
--- a/service/java/com/android/server/wifi/hotspot2/PasspointObjectFactory.java
+++ b/service/java/com/android/server/wifi/hotspot2/PasspointObjectFactory.java
@@ -49,8 +49,8 @@ public class PasspointObjectFactory{
* @return {@link PasspointProvider}
*/
public PasspointProvider makePasspointProvider(PasspointConfiguration config,
- WifiKeyStore keyStore, SIMAccessor simAccessor, long providerId) {
- return new PasspointProvider(config, keyStore, simAccessor, providerId);
+ WifiKeyStore keyStore, SIMAccessor simAccessor, long providerId, int creatorUid) {
+ return new PasspointProvider(config, keyStore, simAccessor, providerId, creatorUid);
}
/**
diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointProvider.java b/service/java/com/android/server/wifi/hotspot2/PasspointProvider.java
index df4303c29..33867bbdd 100644
--- a/service/java/com/android/server/wifi/hotspot2/PasspointProvider.java
+++ b/service/java/com/android/server/wifi/hotspot2/PasspointProvider.java
@@ -79,6 +79,7 @@ public class PasspointProvider {
private String mClientCertificateAlias;
private final long mProviderId;
+ private final int mCreatorUid;
private final IMSIParameter mImsiParameter;
private final List<String> mMatchingSIMImsiList;
@@ -87,17 +88,18 @@ public class PasspointProvider {
private final AuthParam mAuthParam;
public PasspointProvider(PasspointConfiguration config, WifiKeyStore keyStore,
- SIMAccessor simAccessor, long providerId) {
- this(config, keyStore, simAccessor, providerId, null, null, null);
+ SIMAccessor simAccessor, long providerId, int creatorUid) {
+ this(config, keyStore, simAccessor, providerId, creatorUid, null, null, null);
}
public PasspointProvider(PasspointConfiguration config, WifiKeyStore keyStore,
- SIMAccessor simAccessor, long providerId, String caCertificateAlias,
+ SIMAccessor simAccessor, long providerId, int creatorUid, String caCertificateAlias,
String clientCertificateAlias, String clientPrivateKeyAlias) {
// Maintain a copy of the configuration to avoid it being updated by others.
mConfig = new PasspointConfiguration(config);
mKeyStore = keyStore;
mProviderId = providerId;
+ mCreatorUid = creatorUid;
mCaCertificateAlias = caCertificateAlias;
mClientCertificateAlias = clientCertificateAlias;
mClientPrivateKeyAlias = clientPrivateKeyAlias;
@@ -144,6 +146,10 @@ public class PasspointProvider {
return mProviderId;
}
+ public int getCreatorUid() {
+ return mCreatorUid;
+ }
+
/**
* Install certificates and key based on current configuration.
* Note: the certificates and keys in the configuration will get cleared once
@@ -386,6 +392,7 @@ public class PasspointProvider {
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("ProviderId: ").append(mProviderId).append("\n");
+ builder.append("CreatorUID: ").append(mCreatorUid).append("\n");
builder.append("Configuration Begin ---\n");
builder.append(mConfig);
builder.append("Configuration End ---\n");
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
index 80e29c6b1..4772d4c61 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
@@ -1171,15 +1171,17 @@ public class WifiStateMachineTest {
homeSp.setFqdn("test.com");
config.setHomeSp(homeSp);
- when(mPasspointManager.addOrUpdateProvider(config)).thenReturn(true);
+ when(mPasspointManager.addOrUpdateProvider(config, MANAGED_PROFILE_UID)).thenReturn(true);
mLooper.startAutoDispatch();
- assertTrue(mWsm.syncAddOrUpdatePasspointConfig(mWsmAsyncChannel, config));
+ assertTrue(mWsm.syncAddOrUpdatePasspointConfig(
+ mWsmAsyncChannel, config, MANAGED_PROFILE_UID));
mLooper.stopAutoDispatch();
reset(mPasspointManager);
- when(mPasspointManager.addOrUpdateProvider(config)).thenReturn(false);
+ when(mPasspointManager.addOrUpdateProvider(config, MANAGED_PROFILE_UID)).thenReturn(false);
mLooper.startAutoDispatch();
- assertFalse(mWsm.syncAddOrUpdatePasspointConfig(mWsmAsyncChannel, config));
+ assertFalse(mWsm.syncAddOrUpdatePasspointConfig(
+ mWsmAsyncChannel, config, MANAGED_PROFILE_UID));
mLooper.stopAutoDispatch();
}
diff --git a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigStoreDataTest.java
index 5b2eabfd3..cd3120f9e 100644
--- a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigStoreDataTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigStoreDataTest.java
@@ -59,6 +59,7 @@ public class PasspointConfigStoreDataTest {
private static final String TEST_CLIENT_CERTIFICATE_ALIAS = "ClientCert";
private static final String TEST_CLIENT_PRIVATE_KEY_ALIAS = "ClientPrivateKey";
private static final long TEST_PROVIDER_ID = 1;
+ private static final int TEST_CREATOR_UID = 1234;
@Mock WifiKeyStore mKeyStore;
@Mock SIMAccessor mSimAccessor;
@@ -234,8 +235,9 @@ public class PasspointConfigStoreDataTest {
// Setup expected data.
List<PasspointProvider> providerList = new ArrayList<>();
providerList.add(new PasspointProvider(createFullPasspointConfiguration(),
- mKeyStore, mSimAccessor, TEST_PROVIDER_ID, TEST_CA_CERTIFICATE_ALIAS,
- TEST_CLIENT_CERTIFICATE_ALIAS, TEST_CLIENT_PRIVATE_KEY_ALIAS));
+ mKeyStore, mSimAccessor, TEST_PROVIDER_ID, TEST_CREATOR_UID,
+ TEST_CA_CERTIFICATE_ALIAS, TEST_CLIENT_CERTIFICATE_ALIAS,
+ TEST_CLIENT_PRIVATE_KEY_ALIAS));
// Serialize data for user store.
when(mDataSource.getProviders()).thenReturn(providerList);
diff --git a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java
index cea1c172d..70ae354b9 100644
--- a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java
@@ -109,6 +109,7 @@ public class PasspointManagerTest {
private static final int TEST_ANQP_DOMAIN_ID = 0;
private static final ANQPNetworkKey TEST_ANQP_KEY = ANQPNetworkKey.buildKey(
TEST_SSID, TEST_BSSID, TEST_HESSID, TEST_ANQP_DOMAIN_ID);
+ private static final int TEST_CREATOR_UID = 1234;
@Mock Context mContext;
@Mock WifiNative mWifiNative;
@@ -251,8 +252,8 @@ public class PasspointManagerTest {
PasspointConfiguration config = createTestConfigWithUserCredential();
PasspointProvider provider = createMockProvider(config);
when(mObjectFactory.makePasspointProvider(eq(config), eq(mWifiKeyStore),
- eq(mSimAccessor), anyLong())).thenReturn(provider);
- assertTrue(mManager.addOrUpdateProvider(config));
+ eq(mSimAccessor), anyLong(), eq(TEST_CREATOR_UID))).thenReturn(provider);
+ assertTrue(mManager.addOrUpdateProvider(config, TEST_CREATOR_UID));
return provider;
}
@@ -434,7 +435,7 @@ public class PasspointManagerTest {
*/
@Test
public void addProviderWithNullConfig() throws Exception {
- assertFalse(mManager.addOrUpdateProvider(null));
+ assertFalse(mManager.addOrUpdateProvider(null, TEST_CREATOR_UID));
}
/**
@@ -444,7 +445,7 @@ public class PasspointManagerTest {
*/
@Test
public void addProviderWithEmptyConfig() throws Exception {
- assertFalse(mManager.addOrUpdateProvider(new PasspointConfiguration()));
+ assertFalse(mManager.addOrUpdateProvider(new PasspointConfiguration(), TEST_CREATOR_UID));
}
/**
@@ -458,7 +459,7 @@ public class PasspointManagerTest {
PasspointConfiguration config = createTestConfigWithUserCredential();
// EAP-TLS not allowed for user credential.
config.getCredential().getUserCredential().setEapType(EAPConstants.EAP_TLS);
- assertFalse(mManager.addOrUpdateProvider(config));
+ assertFalse(mManager.addOrUpdateProvider(config, TEST_CREATOR_UID));
}
/**
@@ -471,8 +472,8 @@ public class PasspointManagerTest {
PasspointConfiguration config = createTestConfigWithUserCredential();
PasspointProvider provider = createMockProvider(config);
when(mObjectFactory.makePasspointProvider(eq(config), eq(mWifiKeyStore),
- eq(mSimAccessor), anyLong())).thenReturn(provider);
- assertTrue(mManager.addOrUpdateProvider(config));
+ eq(mSimAccessor), anyLong(), eq(TEST_CREATOR_UID))).thenReturn(provider);
+ assertTrue(mManager.addOrUpdateProvider(config, TEST_CREATOR_UID));
verifyInstalledConfig(config);
verify(mWifiConfigManager).saveToStore(true);
reset(mWifiConfigManager);
@@ -506,8 +507,8 @@ public class PasspointManagerTest {
PasspointConfiguration config = createTestConfigWithSimCredential();
PasspointProvider provider = createMockProvider(config);
when(mObjectFactory.makePasspointProvider(eq(config), eq(mWifiKeyStore),
- eq(mSimAccessor), anyLong())).thenReturn(provider);
- assertTrue(mManager.addOrUpdateProvider(config));
+ eq(mSimAccessor), anyLong(), eq(TEST_CREATOR_UID))).thenReturn(provider);
+ assertTrue(mManager.addOrUpdateProvider(config, TEST_CREATOR_UID));
verifyInstalledConfig(config);
verify(mWifiConfigManager).saveToStore(true);
reset(mWifiConfigManager);
@@ -544,8 +545,8 @@ public class PasspointManagerTest {
PasspointConfiguration origConfig = createTestConfigWithSimCredential();
PasspointProvider origProvider = createMockProvider(origConfig);
when(mObjectFactory.makePasspointProvider(eq(origConfig), eq(mWifiKeyStore),
- eq(mSimAccessor), anyLong())).thenReturn(origProvider);
- assertTrue(mManager.addOrUpdateProvider(origConfig));
+ eq(mSimAccessor), anyLong(), eq(TEST_CREATOR_UID))).thenReturn(origProvider);
+ assertTrue(mManager.addOrUpdateProvider(origConfig, TEST_CREATOR_UID));
verifyInstalledConfig(origConfig);
verify(mWifiConfigManager).saveToStore(true);
reset(mWifiConfigManager);
@@ -561,8 +562,8 @@ public class PasspointManagerTest {
PasspointConfiguration newConfig = createTestConfigWithUserCredential();
PasspointProvider newProvider = createMockProvider(newConfig);
when(mObjectFactory.makePasspointProvider(eq(newConfig), eq(mWifiKeyStore),
- eq(mSimAccessor), anyLong())).thenReturn(newProvider);
- assertTrue(mManager.addOrUpdateProvider(newConfig));
+ eq(mSimAccessor), anyLong(), eq(TEST_CREATOR_UID))).thenReturn(newProvider);
+ assertTrue(mManager.addOrUpdateProvider(newConfig, TEST_CREATOR_UID));
verifyInstalledConfig(newConfig);
verify(mWifiConfigManager).saveToStore(true);
@@ -585,8 +586,8 @@ public class PasspointManagerTest {
PasspointProvider provider = mock(PasspointProvider.class);
when(provider.installCertsAndKeys()).thenReturn(false);
when(mObjectFactory.makePasspointProvider(eq(config), eq(mWifiKeyStore),
- eq(mSimAccessor), anyLong())).thenReturn(provider);
- assertFalse(mManager.addOrUpdateProvider(config));
+ eq(mSimAccessor), anyLong(), eq(TEST_CREATOR_UID))).thenReturn(provider);
+ assertFalse(mManager.addOrUpdateProvider(config, TEST_CREATOR_UID));
}
/**
@@ -599,7 +600,7 @@ public class PasspointManagerTest {
PasspointConfiguration config = createTestConfigWithUserCredential();
doThrow(new GeneralSecurityException())
.when(mCertVerifier).verifyCaCert(any(X509Certificate.class));
- assertFalse(mManager.addOrUpdateProvider(config));
+ assertFalse(mManager.addOrUpdateProvider(config, TEST_CREATOR_UID));
}
/**
@@ -614,8 +615,8 @@ public class PasspointManagerTest {
config.setUpdateIdentifier(1);
PasspointProvider provider = createMockProvider(config);
when(mObjectFactory.makePasspointProvider(eq(config), eq(mWifiKeyStore),
- eq(mSimAccessor), anyLong())).thenReturn(provider);
- assertTrue(mManager.addOrUpdateProvider(config));
+ eq(mSimAccessor), anyLong(), eq(TEST_CREATOR_UID))).thenReturn(provider);
+ assertTrue(mManager.addOrUpdateProvider(config, TEST_CREATOR_UID));
verify(mCertVerifier, never()).verifyCaCert(any(X509Certificate.class));
verifyInstalledConfig(config);
}
@@ -849,8 +850,8 @@ public class PasspointManagerTest {
PasspointProvider provider = createMockProvider(config);
// Verify the provider ID used to create the new provider.
when(mObjectFactory.makePasspointProvider(eq(config), eq(mWifiKeyStore),
- eq(mSimAccessor), eq(providerIndex))).thenReturn(provider);
- assertTrue(mManager.addOrUpdateProvider(config));
+ eq(mSimAccessor), eq(providerIndex), eq(TEST_CREATOR_UID))).thenReturn(provider);
+ assertTrue(mManager.addOrUpdateProvider(config, TEST_CREATOR_UID));
verifyInstalledConfig(config);
verify(mWifiConfigManager).saveToStore(true);
reset(mWifiConfigManager);
diff --git a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointProviderTest.java b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointProviderTest.java
index afa04b549..c416a961a 100644
--- a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointProviderTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointProviderTest.java
@@ -67,6 +67,7 @@ import java.util.Set;
@SmallTest
public class PasspointProviderTest {
private static final long PROVIDER_ID = 12L;
+ private static final int CREATOR_UID = 1234;
private static final String CA_CERTIFICATE_NAME = "CACERT_HS2_12";
private static final String CLIENT_CERTIFICATE_NAME = "USRCERT_HS2_12";
private static final String CLIENT_PRIVATE_KEY_NAME = "USRPKEY_HS2_12";
@@ -91,7 +92,7 @@ public class PasspointProviderTest {
* @return {@link com.android.server.wifi.hotspot2.PasspointProvider}
*/
private PasspointProvider createProvider(PasspointConfiguration config) {
- return new PasspointProvider(config, mKeyStore, mSimAccessor, PROVIDER_ID);
+ return new PasspointProvider(config, mKeyStore, mSimAccessor, PROVIDER_ID, CREATOR_UID);
}
/**