Merge "Ignore the outdated entitlement check" am: d7885ca73a

am: 7b30503dc4

Change-Id: I294f9f2e9ca239cb8f1c689580ce266ddead8f5b
This commit is contained in:
Mark Chien
2019-04-19 21:07:49 -07:00
committed by android-build-merger
3 changed files with 40 additions and 3 deletions

View File

@@ -55,6 +55,8 @@ public class TetherService extends Service {
@VisibleForTesting
public static final String EXTRA_RESULT = "EntitlementResult";
@VisibleForTesting
public static final String EXTRA_SUBID = "subId";
// Activity results to match the activity provision protocol.
// Default to something not ok.
@@ -100,6 +102,18 @@ public class TetherService extends Service {
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
if (intent.hasExtra(EXTRA_SUBID)) {
final int tetherSubId = intent.getIntExtra(EXTRA_SUBID,
SubscriptionManager.INVALID_SUBSCRIPTION_ID);
final int subId = getTetherServiceWrapper().getDefaultDataSubscriptionId();
if (tetherSubId != subId) {
Log.e(TAG, "This Provisioning request is outdated, current subId: " + subId);
if (!mInProvisionCheck) {
stopSelf();
}
return START_NOT_STICKY;
}
}
if (intent.hasExtra(ConnectivityManager.EXTRA_ADD_TETHER_TYPE)) {
int type = intent.getIntExtra(ConnectivityManager.EXTRA_ADD_TETHER_TYPE,
ConnectivityManager.TETHERING_INVALID);