Skip to content

Commit

Permalink
fix(ios): include new iphone models into os extension (#11212)
Browse files Browse the repository at this point in the history
Fixes TIMOB-27395
  • Loading branch information
garymathews authored and sgtcoolguy committed Sep 12, 2019
1 parent 4e2bfe7 commit 0e15630
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion common/Resources/ti.internal/extensions/node/os.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ if (isIOS) {
// Now a giant hack for looking up CPU info for OS.cpus() on iOS
// https://www.theiphonewiki.com/wiki/List_of_iPhones
const AppleMap = {
// iPhone 11 Pro Max
'iPhone12,5': [ 'Apple A13 Bionic @ 2.66 GHz', 2660 ],
// iPhone 11 Pro
'iPhone12,3': [ 'Apple A13 Bionic @ 2.66 GHz', 2660 ],
// iPhone 11
'iPhone12,1': [ 'Apple A13 Bionic @ 2.66 GHz', 2660 ],
// iPhone XR
'iPhone11,8': [ 'Apple A12 Bionic @ 2.49 GHz', 2490 ],
// iPhone XS Max
Expand Down Expand Up @@ -337,7 +343,7 @@ if (isIOS) {
*/
const cpuModelAndSpeed = (model) => {
const trimmed = model.replace(' (Simulator)', '').trim();
return AppleMap[trimmed];
return AppleMap[trimmed] || [ 'Unknown', 0 ];
};
// override cpus impl
OS.cpus = () => {
Expand Down

0 comments on commit 0e15630

Please sign in to comment.