Loading core/api/system-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -10158,6 +10158,8 @@ package android.net.wifi.sharedconnectivity.service { public abstract class SharedConnectivityService extends android.app.Service { ctor public SharedConnectivityService(); method public static boolean areHotspotNetworksEnabledForService(@NonNull android.content.Context); method public static boolean areKnownNetworksEnabledForService(@NonNull android.content.Context); method @Nullable public final android.os.IBinder onBind(@NonNull android.content.Intent); method public abstract void onConnectHotspotNetwork(@NonNull android.net.wifi.sharedconnectivity.app.HotspotNetwork); method public abstract void onConnectKnownNetwork(@NonNull android.net.wifi.sharedconnectivity.app.KnownNetwork); core/res/res/values/config.xml +10 −2 Original line number Diff line number Diff line Loading @@ -3020,10 +3020,18 @@ >com.android.systemui/com.android.systemui.wifi.WifiDebuggingSecondaryUserActivity</string> <!-- Package name of the system service that implements the shared connectivity service --> <string translatable="false" name="shared_connectivity_service_package"></string> <string translatable="false" name="config_sharedConnectivityServicePackage"></string> <!-- Intent action used when binding to the shared connectivity service --> <string translatable="false" name="shared_connectivity_service_intent_action"></string> <string translatable="false" name="config_sharedConnectivityServiceIntentAction"></string> <!-- The system and settings UI can support all the features of instant tether. If set to false, instant tether will run in notifications mode --> <bool name="config_hotspotNetworksEnabledForService">false</bool> <!-- The system and settings UI can support all the features of known networks. If set to false, known networks will run in notifications mode --> <bool name="config_knownNetworksEnabledForService">false</bool> <!-- Component name of the activity that shows the usb containment status. --> <string name="config_usbContaminantActivity" translatable="false" Loading core/res/res/values/symbols.xml +4 −2 Original line number Diff line number Diff line Loading @@ -4960,8 +4960,10 @@ <java-symbol type="bool" name="config_stopSystemPackagesByDefault"/> <java-symbol type="string" name="config_wearServiceComponent" /> <java-symbol type="string" name="shared_connectivity_service_package" /> <java-symbol type="string" name="shared_connectivity_service_intent_action" /> <java-symbol type="string" name="config_sharedConnectivityServicePackage" /> <java-symbol type="string" name="config_sharedConnectivityServiceIntentAction" /> <java-symbol type="bool" name="config_hotspotNetworksEnabledForService"/> <java-symbol type="bool" name="config_knownNetworksEnabledForService"/> <!-- Whether to show weather on the lockscreen by default. --> <java-symbol type="bool" name="config_lockscreenWeatherEnabledByDefault" /> Loading wifi/java/src/android/net/wifi/sharedconnectivity/app/SharedConnectivityManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -161,9 +161,9 @@ public class SharedConnectivityManager { Resources resources = context.getResources(); try { String servicePackageName = resources.getString( R.string.shared_connectivity_service_package); R.string.config_sharedConnectivityServicePackage); String serviceIntentAction = resources.getString( R.string.shared_connectivity_service_intent_action); R.string.config_sharedConnectivityServiceIntentAction); return new SharedConnectivityManager(context, servicePackageName, serviceIntentAction); } catch (Resources.NotFoundException e) { Log.e(TAG, "To support shared connectivity service on this device, the service's" Loading wifi/java/src/android/net/wifi/sharedconnectivity/service/SharedConnectivityService.java +28 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.annotation.RequiresPermission; import android.annotation.SystemApi; import android.annotation.TestApi; import android.app.Service; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.net.wifi.sharedconnectivity.app.HotspotNetwork; Loading @@ -40,8 +41,11 @@ import android.os.RemoteCallbackList; import android.os.RemoteException; import android.util.Log; import com.android.internal.R; import java.util.Collections; import java.util.List; import java.util.Objects; /** Loading Loading @@ -381,6 +385,30 @@ public abstract class SharedConnectivityService extends Service { mRemoteCallbackList.finishBroadcast(); } /** * System and settings UI support on the device for instant tether. * @return True if the UI can display Instant Tether network data. False otherwise. */ public static boolean areHotspotNetworksEnabledForService(@NonNull Context context) { String servicePackage = context.getResources() .getString(R.string.config_sharedConnectivityServicePackage); return Objects.equals(context.getPackageName(), servicePackage) && context.getResources() .getBoolean(R.bool.config_hotspotNetworksEnabledForService); } /** * System and settings UI support on the device for known networks. * @return True if the UI can display known networks data. False otherwise. */ public static boolean areKnownNetworksEnabledForService(@NonNull Context context) { String servicePackage = context.getResources() .getString(R.string.config_sharedConnectivityServicePackage); return Objects.equals(context.getPackageName(), servicePackage) && context.getResources() .getBoolean(R.bool.config_knownNetworksEnabledForService); } /** * Implementing application should implement this method. * Loading Loading
core/api/system-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -10158,6 +10158,8 @@ package android.net.wifi.sharedconnectivity.service { public abstract class SharedConnectivityService extends android.app.Service { ctor public SharedConnectivityService(); method public static boolean areHotspotNetworksEnabledForService(@NonNull android.content.Context); method public static boolean areKnownNetworksEnabledForService(@NonNull android.content.Context); method @Nullable public final android.os.IBinder onBind(@NonNull android.content.Intent); method public abstract void onConnectHotspotNetwork(@NonNull android.net.wifi.sharedconnectivity.app.HotspotNetwork); method public abstract void onConnectKnownNetwork(@NonNull android.net.wifi.sharedconnectivity.app.KnownNetwork);
core/res/res/values/config.xml +10 −2 Original line number Diff line number Diff line Loading @@ -3020,10 +3020,18 @@ >com.android.systemui/com.android.systemui.wifi.WifiDebuggingSecondaryUserActivity</string> <!-- Package name of the system service that implements the shared connectivity service --> <string translatable="false" name="shared_connectivity_service_package"></string> <string translatable="false" name="config_sharedConnectivityServicePackage"></string> <!-- Intent action used when binding to the shared connectivity service --> <string translatable="false" name="shared_connectivity_service_intent_action"></string> <string translatable="false" name="config_sharedConnectivityServiceIntentAction"></string> <!-- The system and settings UI can support all the features of instant tether. If set to false, instant tether will run in notifications mode --> <bool name="config_hotspotNetworksEnabledForService">false</bool> <!-- The system and settings UI can support all the features of known networks. If set to false, known networks will run in notifications mode --> <bool name="config_knownNetworksEnabledForService">false</bool> <!-- Component name of the activity that shows the usb containment status. --> <string name="config_usbContaminantActivity" translatable="false" Loading
core/res/res/values/symbols.xml +4 −2 Original line number Diff line number Diff line Loading @@ -4960,8 +4960,10 @@ <java-symbol type="bool" name="config_stopSystemPackagesByDefault"/> <java-symbol type="string" name="config_wearServiceComponent" /> <java-symbol type="string" name="shared_connectivity_service_package" /> <java-symbol type="string" name="shared_connectivity_service_intent_action" /> <java-symbol type="string" name="config_sharedConnectivityServicePackage" /> <java-symbol type="string" name="config_sharedConnectivityServiceIntentAction" /> <java-symbol type="bool" name="config_hotspotNetworksEnabledForService"/> <java-symbol type="bool" name="config_knownNetworksEnabledForService"/> <!-- Whether to show weather on the lockscreen by default. --> <java-symbol type="bool" name="config_lockscreenWeatherEnabledByDefault" /> Loading
wifi/java/src/android/net/wifi/sharedconnectivity/app/SharedConnectivityManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -161,9 +161,9 @@ public class SharedConnectivityManager { Resources resources = context.getResources(); try { String servicePackageName = resources.getString( R.string.shared_connectivity_service_package); R.string.config_sharedConnectivityServicePackage); String serviceIntentAction = resources.getString( R.string.shared_connectivity_service_intent_action); R.string.config_sharedConnectivityServiceIntentAction); return new SharedConnectivityManager(context, servicePackageName, serviceIntentAction); } catch (Resources.NotFoundException e) { Log.e(TAG, "To support shared connectivity service on this device, the service's" Loading
wifi/java/src/android/net/wifi/sharedconnectivity/service/SharedConnectivityService.java +28 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.annotation.RequiresPermission; import android.annotation.SystemApi; import android.annotation.TestApi; import android.app.Service; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.net.wifi.sharedconnectivity.app.HotspotNetwork; Loading @@ -40,8 +41,11 @@ import android.os.RemoteCallbackList; import android.os.RemoteException; import android.util.Log; import com.android.internal.R; import java.util.Collections; import java.util.List; import java.util.Objects; /** Loading Loading @@ -381,6 +385,30 @@ public abstract class SharedConnectivityService extends Service { mRemoteCallbackList.finishBroadcast(); } /** * System and settings UI support on the device for instant tether. * @return True if the UI can display Instant Tether network data. False otherwise. */ public static boolean areHotspotNetworksEnabledForService(@NonNull Context context) { String servicePackage = context.getResources() .getString(R.string.config_sharedConnectivityServicePackage); return Objects.equals(context.getPackageName(), servicePackage) && context.getResources() .getBoolean(R.bool.config_hotspotNetworksEnabledForService); } /** * System and settings UI support on the device for known networks. * @return True if the UI can display known networks data. False otherwise. */ public static boolean areKnownNetworksEnabledForService(@NonNull Context context) { String servicePackage = context.getResources() .getString(R.string.config_sharedConnectivityServicePackage); return Objects.equals(context.getPackageName(), servicePackage) && context.getResources() .getBoolean(R.bool.config_knownNetworksEnabledForService); } /** * Implementing application should implement this method. * Loading