Replace type with TetheringRequest in startTethering usage

startTethering with type is deprecated way and may not be exposed in
TetheringManager. The usage should be replaced by startTethering with
TetheringRequest.

Bug: 151918384
Test: m, atest
Change-Id: I9c26db3639857a8909be1888046fc942b8a51182
This commit is contained in:
markchien
2020-03-19 13:47:30 +08:00
committed by Mark Chien
parent 62a625df98
commit ff3b10030f

View File

@@ -16,10 +16,13 @@
package com.android.systemui.statusbar.policy;
import static android.net.TetheringManager.TETHERING_WIFI;
import android.app.ActivityManager;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.TetheringManager;
import android.net.TetheringManager.TetheringRequest;
import android.net.wifi.WifiClient;
import android.net.wifi.WifiManager;
import android.os.Handler;
@@ -190,7 +193,7 @@ public class HotspotControllerImpl implements HotspotController, WifiManager.Sof
if (enabled) {
mWaitingForTerminalState = true;
if (DEBUG) Log.d(TAG, "Starting tethering");
mTetheringManager.startTethering(ConnectivityManager.TETHERING_WIFI,
mTetheringManager.startTethering(new TetheringRequest.Builder(TETHERING_WIFI).build(),
ConcurrentUtils.DIRECT_EXECUTOR,
new TetheringManager.StartTetheringCallback() {
@Override