The key code is as follows. PackageManager is used to check system characteristics, and other devices can also do the same.
The complete example has been run and passed on AndroidStudio3.5.2:
PhoneTest.zip:
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate