Revert "Revert "Pass entitlement configuration to Settings for entitlement check""

Add commit message here for reference:
Tethering resource configuration is move from framework to tethering
module. The resource would not be accessible from outside of tethering
module.
List the replacements of framework resources usage and intent extra:
1. R.string.config_mobile_hotspot_provision_response
    --> android.net.extra.TETHER_PROVISIONING_RESPONSE.
2. R.string.config_mobile_hotspot_provision_app_no_ui
    --> android.net.extra.TETHER_UI_PROVISIONING_APP_NAME
3. R.array.config_mobile_hotspot_provision_app
    --> android.net.extra.TETHER_SILENT_PROVISIONING_ACTION
Besides, the current active subId would put in
android.net.extra.TETHER_SUBID

Note: They are not APIs because of API freeze. Now both tethering module
and Settings define these strings independently.

Bug: 146918263
Test: atest TetherServiceTest
      atest TetherProvisioningActivityTest

This reverts commit 9988903174.

Reason for revert: Resume the CL and put this CL with settings part in the same topic to avoid break.

Change-Id: I114b4c258743661df51e5a969e150047a292e035
This commit is contained in:
Mark Chien
2020-06-12 17:35:18 +00:00
parent 9988903174
commit c55e229dcb
5 changed files with 122 additions and 22 deletions

View File

@@ -37,8 +37,8 @@ public final class TetheringConstants {
private TetheringConstants() { }
/**
* Extra used for communicating with the TetherService. Includes the type of tethering to
* enable if any.
* Extra used for communicating with the TetherService and TetherProvisioningActivity.
* Includes the type of tethering to enable if any.
*/
public static final String EXTRA_ADD_TETHER_TYPE = "extraAddTetherType";
/**
@@ -56,8 +56,38 @@ public final class TetheringConstants {
*/
public static final String EXTRA_RUN_PROVISION = "extraRunProvision";
/**
* Extra used for communicating with the TetherService. Contains the {@link ResultReceiver}
* which will receive provisioning results. Can be left empty.
* Extra used for communicating with the TetherService and TetherProvisioningActivity.
* Contains the {@link ResultReceiver} which will receive provisioning results.
* Can not be empty.
*/
public static final String EXTRA_PROVISION_CALLBACK = "extraProvisionCallback";
/**
* Extra used for communicating with the TetherService and TetherProvisioningActivity.
* Contains the subId of current active cellular upstream.
* @hide
*/
public static final String EXTRA_TETHER_SUBID = "android.net.extra.TETHER_SUBID";
/**
* Extra used for telling TetherProvisioningActivity the entitlement package name and class
* name to start UI entitlement check.
* @hide
*/
public static final String EXTRA_TETHER_UI_PROVISIONING_APP_NAME =
"android.net.extra.TETHER_UI_PROVISIONING_APP_NAME";
/**
* Extra used for telling TetherService the intent action to start silent entitlement check.
* @hide
*/
public static final String EXTRA_TETHER_SILENT_PROVISIONING_ACTION =
"android.net.extra.TETHER_SILENT_PROVISIONING_ACTION";
/**
* Extra used for TetherService to receive the response of provisioning check.
* @hide
*/
public static final String EXTRA_TETHER_PROVISIONING_RESPONSE =
"android.net.extra.TETHER_PROVISIONING_RESPONSE";
}