mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-26 06:11:19 +00:00
Add Constants#isRunningOnEmulator
This commit is contained in:
parent
e54cb80262
commit
90f9eccb64
1 changed files with 11 additions and 0 deletions
|
@ -3,6 +3,7 @@ package com.nutomic.syncthingandroid.service;
|
|||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
@ -190,6 +191,16 @@ public class Constants {
|
|||
return new File(context.getExternalFilesDir(null), "syncthing.log");
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the app is running on an Android emulator (AVD).
|
||||
*/
|
||||
public static Boolean isRunningOnEmulator() {
|
||||
return !TextUtils.isEmpty(Build.MANUFACTURER) &&
|
||||
!TextUtils.isEmpty(Build.MODEL) &&
|
||||
Build.MANUFACTURER.equals("Google") &&
|
||||
Build.MODEL.equals("Android SDK built for x86");
|
||||
}
|
||||
|
||||
/**
|
||||
* Decide if we should enforce HTTPS when accessing the Web UI and REST API.
|
||||
* Android 4.4 and earlier don't have support for TLS 1.2 requiring us to
|
||||
|
|
Loading…
Reference in a new issue