Merge "Don't allow upstream if entitlement don't know any downstream" am: 161814ffb1
am: 538bc0fe4f
Change-Id: Ibfa3dfd6a187f6926831910cbef920cf122721a1
This commit is contained in:
@@ -161,6 +161,12 @@ public class EntitlementManager {
|
||||
* Check if cellular upstream is permitted.
|
||||
*/
|
||||
public boolean isCellularUpstreamPermitted() {
|
||||
// If provisioning is required and EntitlementManager don't know any downstream,
|
||||
// cellular upstream should not be allowed.
|
||||
final TetheringConfiguration config = mFetcher.fetchTetheringConfiguration();
|
||||
if (mCurrentTethers.size() == 0 && isTetherProvisioningRequired(config)) {
|
||||
return false;
|
||||
}
|
||||
return mCellularUpstreamPermitted;
|
||||
}
|
||||
|
||||
|
||||
@@ -405,6 +405,13 @@ public final class EntitlementManagerTest {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void verifyPermissionWhenProvisioningNotStarted() {
|
||||
assertTrue(mEnMgr.isCellularUpstreamPermitted());
|
||||
setupForRequiredProvisioning();
|
||||
assertFalse(mEnMgr.isCellularUpstreamPermitted());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRunTetherProvisioning() {
|
||||
setupForRequiredProvisioning();
|
||||
|
||||
Reference in New Issue
Block a user