Bug 787532 - Update Android HAL backend to take into account new screen lock values. r=jlebar

This commit is contained in:
Mounir Lamouri 2012-09-11 11:57:20 +01:00
Родитель 37e88bfeb1
Коммит 41eb3be4c0
2 изменённых файлов: 17 добавлений и 4 удалений

Просмотреть файл

@ -185,8 +185,19 @@ LockScreenOrientation(const ScreenOrientation& aOrientation)
return false;
}
bridge->LockScreenOrientation(aOrientation);
return true;
switch (aOrientation) {
// The Android backend only supports these orientations.
case eScreenOrientation_PortraitPrimary:
case eScreenOrientation_PortraitSecondary:
case eScreenOrientation_Portrait:
case eScreenOrientation_LandscapePrimary:
case eScreenOrientation_LandscapeSecondary:
case eScreenOrientation_Landscape:
bridge->LockScreenOrientation(aOrientation);
return true;
default:
return false;
}
}
void

Просмотреть файл

@ -283,8 +283,10 @@ OrientationObserver::DisableAutoOrientation()
bool
OrientationObserver::LockScreenOrientation(ScreenOrientation aOrientation)
{
MOZ_ASSERT(eScreenOrientation_None < aOrientation &&
aOrientation < eScreenOrientation_EndGuard);
MOZ_ASSERT(aOrientation | (eScreenOrientation_PortraitPrimary |
eScreenOrientation_PortraitSecondary |
eScreenOrientation_LandscapePrimary |
eScreenOrientation_LandscapeSecondary));
// Enable/disable the observer depending on 1. multiple orientations
// allowed, and 2. observer enabled.