Example #1
0
        static DeviceIdiom GetIdiom()
        {
            var profile = Plat.GetFeatureInfo("profile")?.ToUpperInvariant();

            if (profile == null)
            {
                return(DeviceIdiom.Unknown);
            }

            if (profile.StartsWith("M"))
            {
                return(DeviceIdiom.Phone);
            }
            else if (profile.StartsWith("W"))
            {
                return(DeviceIdiom.Watch);
            }
            else if (profile.StartsWith("T"))
            {
                return(DeviceIdiom.TV);
            }
            else
            {
                return(DeviceIdiom.Unknown);
            }
        }
Example #2
0
        static DeviceType GetDeviceType()
        {
            var arch  = Plat.GetFeatureInfo("platform.core.cpu.arch");
            var armv7 = Plat.GetFeatureInfo <bool>("platform.core.cpu.arch.armv7");
            var x86   = Plat.GetFeatureInfo <bool>("platform.core.cpu.arch.x86");

            if (arch != null && arch.Equals("armv7") && armv7 && !x86)
            {
                return(DeviceType.Physical);
            }
            else if (arch != null && arch.Equals("x86") && !armv7 && x86)
            {
                return(DeviceType.Virtual);
            }
            else
            {
                return(DeviceType.Unknown);
            }
        }
Example #3
0
 static string GetManufacturer()
 => Plat.GetSystemInfo("manufacturer");
Example #4
0
 static string GetModel()
 => Plat.GetSystemInfo("model_name");
Example #5
0
 static string GetVersionString()
 => Plat.GetFeatureInfo("platform.version");
Example #6
0
 static string GetDeviceName()
 => Plat.GetSystemInfo("device_name");