emulator: setup preferred network mode to 5g(NR)

BUG: 158040335

This will ensure the phone is using the 5g(NR)
as the preferred network mode.

User can change it in setting later, if desired.

Change-Id: I69583d1769739124a51355ff8b887e727ba61df8
Merged-In: I69583d1769739124a51355ff8b887e727ba61df8
This commit is contained in:
bohu
2020-06-04 17:34:59 -07:00
committed by Bo Hu
parent 67db3fb7a9
commit 2e90b7b031
3 changed files with 6 additions and 1 deletions

View File

@@ -23,12 +23,13 @@ import android.content.pm.PackageManager;
import android.hardware.input.InputManager;
import android.hardware.input.KeyboardLayout;
import android.location.LocationManager;
import android.provider.Settings;
import android.os.Bundle;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemProperties;
import android.os.Build;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.view.InputDevice;
/**
@@ -71,6 +72,8 @@ public class DefaultActivity extends Activity {
// Disable offload wifi tethering
Settings.Global.putInt(getContentResolver(), Settings.Global.TETHER_OFFLOAD_DISABLED, 1);
TelephonyManager mTelephony = getApplicationContext().getSystemService(TelephonyManager.class);
mTelephony.setPreferredNetworkTypeBitmask(TelephonyManager.NETWORK_TYPE_BITMASK_NR);
}
// remove this activity from the package manager.