Remove isProvisioningNeededButUnavailable usage

config_mobile_hotspot_provision_app would be move out of framework and
only private for tethering only. TetherUtil#isProvisioningNeeded and
isProvisioningNeededButUnavailable are no longer needed because
tethering would ensure entitlement app is valid if entitlement check is
needed. Otherwise, tethering would return not supported that tethering
settings would be hidden.

Bug: 146918263
Test: m
Change-Id: If0b0a3e6cadab3c4a4d2c003e2aa9e9f3dd7449c
This commit is contained in:
markchien
2020-06-03 23:08:10 +08:00
parent e92cbd19d8
commit 92b09e825f
3 changed files with 0 additions and 36 deletions

View File

@@ -29,7 +29,6 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.hardware.usb.UsbManager;
import android.net.ConnectivityManager;
import android.net.EthernetManager;
@@ -449,25 +448,6 @@ public class TetherSettings extends RestrictedSettingsFragment
}
}
public static boolean isProvisioningNeededButUnavailable(Context context) {
return (TetherUtil.isProvisioningNeeded(context)
&& !isIntentAvailable(context));
}
private static boolean isIntentAvailable(Context context) {
String[] provisionApp = context.getResources().getStringArray(
com.android.internal.R.array.config_mobile_hotspot_provision_app);
if (provisionApp.length < 2) {
return false;
}
final PackageManager packageManager = context.getPackageManager();
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setClassName(provisionApp[0], provisionApp[1]);
return (packageManager.queryIntentActivities(intent,
PackageManager.MATCH_DEFAULT_ONLY).size() > 0);
}
private void startTethering(int choice) {
if (choice == TETHERING_BLUETOOTH) {
// Turn on Bluetooth first.