public async Task <Device> Detect() { var disk = await Detection.GetDisk(fileSystem); if (disk != null) { var model = reader.GetPhoneModel(disk.Number); switch (model.Model) { case PhoneModel.Cityman: switch (model.Variant) { case Variant.SingleSim: return(Device.CitymanSs); case Variant.DualSim: return(Device.CitymanDs); default: throw new ArgumentOutOfRangeException(); } case PhoneModel.Talkman: switch (model.Variant) { case Variant.SingleSim: return(Device.TalkmanSs); case Variant.DualSim: return(Device.TalkmanDs); default: throw new ArgumentOutOfRangeException(); } case PhoneModel.Hapanero: break; default: throw new ArgumentOutOfRangeException(); } } return(null); }
public async Task <PhoneModelInfo> GetModel() { return(phoneModelInfoReader.GetPhoneModel((await GetDeviceDisk()).Number)); }