Backed out changeset 991a5607ee54 (bug 1155801)

--HG--
extra : commitid : 8y589AQze8f
This commit is contained in:
Nigel Babu 2015-12-31 13:57:30 +05:30
parent 859b2bfb24
commit 21c7d01487
2 changed files with 5 additions and 2 deletions

View File

@ -55,11 +55,12 @@ def android_version_code_v1(buildid, cpu_arch=None, min_sdk=0, max_sdk=0):
The bit labelled 'p' is a placeholder that is always 0 (for now).
The bit labelled 'g' is 1 if the build is targeting Android API 14+ and 0
The bit labelled 'g' is 1 if the build is targeting Android API 11/14+ and 0
otherwise, which means the build targets Android API 9-10 (Gingerbread).
Fennec no longer supports Android API 8 or earlier. After Bug 1155801 it
no longer supports API 11-13. API 9 is still supported due to significant usage.
We temporarily treat both 11 and 14 the same: Bug 1219512.
We throw an explanatory exception when we are within one calendar year of
running out of build events. This gives lots of time to update the version
@ -111,7 +112,7 @@ def android_version_code_v1(buildid, cpu_arch=None, min_sdk=0, max_sdk=0):
pass
# This used to compare to 11. The 14+ APK directly supersedes 11+, so
# we reuse this check.
elif min_sdk == 14:
elif min_sdk == 14 or min_sdk == 11:
version |= 1 << 0
else:
raise ValueError("Don't know how to compute android:versionCode "

View File

@ -24,9 +24,11 @@ class TestAndroidVersionCode(unittest.TestCase):
def test_android_version_code_v1(self):
buildid = '20150825141628'
arm_api9 = 0b01111000001000000001001001110000
arm_api11 = 0b01111000001000000001001001110001
arm_api14 = 0b01111000001000000001001001110001
x86_api9 = 0b01111000001000000001001001110100
self.assertEqual(android_version_code_v1(buildid, cpu_arch='armeabi', min_sdk=9, max_sdk=None), arm_api9)
self.assertEqual(android_version_code_v1(buildid, cpu_arch='armeabi-v7a', min_sdk=11, max_sdk=None), arm_api11)
self.assertEqual(android_version_code_v1(buildid, cpu_arch='armeabi-v7a', min_sdk=14, max_sdk=None), arm_api14)
self.assertEqual(android_version_code_v1(buildid, cpu_arch='x86', min_sdk=9, max_sdk=None), x86_api9)