Merge "Don't allow upstream if entitlement don't know any downstream"
am: 161814ffb1
Change-Id: Ibac99a20b470b48597859fe737732f3c6f491805
This commit is contained in:
@@ -161,6 +161,12 @@ public class EntitlementManager {
|
|||||||
* Check if cellular upstream is permitted.
|
* Check if cellular upstream is permitted.
|
||||||
*/
|
*/
|
||||||
public boolean isCellularUpstreamPermitted() {
|
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;
|
return mCellularUpstreamPermitted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -405,6 +405,13 @@ public final class EntitlementManagerTest {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void verifyPermissionWhenProvisioningNotStarted() {
|
||||||
|
assertTrue(mEnMgr.isCellularUpstreamPermitted());
|
||||||
|
setupForRequiredProvisioning();
|
||||||
|
assertFalse(mEnMgr.isCellularUpstreamPermitted());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testRunTetherProvisioning() {
|
public void testRunTetherProvisioning() {
|
||||||
setupForRequiredProvisioning();
|
setupForRequiredProvisioning();
|
||||||
|
|||||||
Reference in New Issue
Block a user