diff --git a/Tethering/Android.bp b/Tethering/Android.bp index b1ffbb1622..c551f7a2b6 100644 --- a/Tethering/Android.bp +++ b/Tethering/Android.bp @@ -41,6 +41,7 @@ java_defaults { "net-utils-framework-common", "net-utils-device-common", "netd-client", + "NetworkStackApiCurrentShims", ], libs: [ "framework-connectivity", diff --git a/Tethering/src/com/android/networkstack/tethering/TetheringService.java b/Tethering/src/com/android/networkstack/tethering/TetheringService.java index 92dd921db7..722ec8f90d 100644 --- a/Tethering/src/com/android/networkstack/tethering/TetheringService.java +++ b/Tethering/src/com/android/networkstack/tethering/TetheringService.java @@ -46,13 +46,14 @@ import android.os.IBinder; import android.os.Looper; import android.os.RemoteException; import android.os.ResultReceiver; -import android.provider.Settings; import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.internal.annotations.VisibleForTesting; +import com.android.networkstack.apishim.SettingsShimImpl; +import com.android.networkstack.apishim.common.SettingsShim; import java.io.FileDescriptor; import java.io.PrintWriter; @@ -66,6 +67,7 @@ public class TetheringService extends Service { private static final String TAG = TetheringService.class.getSimpleName(); private TetheringConnector mConnector; + private SettingsShim mSettingsShim; @Override public void onCreate() { @@ -73,6 +75,8 @@ public class TetheringService extends Service { // The Tethering object needs a fully functional context to start, so this can't be done // in the constructor. mConnector = new TetheringConnector(makeTethering(deps), TetheringService.this); + + mSettingsShim = SettingsShimImpl.newInstance(); } /** @@ -294,7 +298,7 @@ public class TetheringService extends Service { boolean checkAndNoteWriteSettingsOperation(@NonNull Context context, int uid, @NonNull String callingPackage, @Nullable String callingAttributionTag, boolean throwException) { - return Settings.checkAndNoteWriteSettingsOperation(context, uid, callingPackage, + return mSettingsShim.checkAndNoteWriteSettingsOperation(context, uid, callingPackage, callingAttributionTag, throwException); }