Bug 708772 - (2/3) Add tablet flag to jar manifest parser and nsSystemInfo [r=bsmedberg]

This commit is contained in:
Matt Brubeck 2011-12-14 13:53:38 -08:00
Родитель cf11cb916c
Коммит 7da5868ed3
2 изменённых файлов: 22 добавлений и 3 удалений

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

@ -200,8 +200,8 @@ nsSystemInfo::Init()
} }
SetPropertyAsAString(NS_LITERAL_STRING("shellVersion"), str); SetPropertyAsAString(NS_LITERAL_STRING("shellVersion"), str);
} }
bool isTablet = mozilla::AndroidBridge::Bridge()->IsTablet();
SetPropertyAsBool(NS_LITERAL_STRING("isTablet"), isTablet);
} }
#endif #endif
return NS_OK; return NS_OK;

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

@ -434,6 +434,9 @@ ParseManifest(NSLocationType type, FileLocation &file, char* buf, bool aChromeOn
NS_NAMED_LITERAL_STRING(kOs, "os"); NS_NAMED_LITERAL_STRING(kOs, "os");
NS_NAMED_LITERAL_STRING(kOsVersion, "osversion"); NS_NAMED_LITERAL_STRING(kOsVersion, "osversion");
NS_NAMED_LITERAL_STRING(kABI, "abi"); NS_NAMED_LITERAL_STRING(kABI, "abi");
#if defined(MOZ_WIDGET_ANDROID)
NS_NAMED_LITERAL_STRING(kTablet, "tablet");
#endif
// Obsolete // Obsolete
NS_NAMED_LITERAL_STRING(kXPCNativeWrappers, "xpcnativewrappers"); NS_NAMED_LITERAL_STRING(kXPCNativeWrappers, "xpcnativewrappers");
@ -498,8 +501,10 @@ ParseManifest(NSLocationType type, FileLocation &file, char* buf, bool aChromeOn
gtk_major_version, gtk_major_version,
gtk_minor_version); gtk_minor_version);
#elif defined(MOZ_WIDGET_ANDROID) #elif defined(MOZ_WIDGET_ANDROID)
bool isTablet = false;
if (mozilla::AndroidBridge::Bridge()) { if (mozilla::AndroidBridge::Bridge()) {
mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION", "RELEASE", osVersion); mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION", "RELEASE", osVersion);
isTablet = mozilla::AndroidBridge::Bridge()->IsTablet();
} }
#endif #endif
@ -587,6 +592,9 @@ ParseManifest(NSLocationType type, FileLocation &file, char* buf, bool aChromeOn
TriState stOsVersion = eUnspecified; TriState stOsVersion = eUnspecified;
TriState stOs = eUnspecified; TriState stOs = eUnspecified;
TriState stABI = eUnspecified; TriState stABI = eUnspecified;
#if defined(MOZ_WIDGET_ANDROID)
TriState stTablet = eUnspecified;
#endif
bool platform = false; bool platform = false;
bool contentAccessible = false; bool contentAccessible = false;
@ -602,6 +610,14 @@ ParseManifest(NSLocationType type, FileLocation &file, char* buf, bool aChromeOn
CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion, stGeckoVersion)) CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion, stGeckoVersion))
continue; continue;
#if defined(MOZ_WIDGET_ANDROID)
bool tablet = false;
if (CheckFlag(kTablet, wtoken, tablet)) {
stTablet = (tablet == isTablet) ? eOK : eBad;
continue;
}
#endif
if (directive->contentflags && if (directive->contentflags &&
(CheckFlag(kPlatform, wtoken, platform) || (CheckFlag(kPlatform, wtoken, platform) ||
CheckFlag(kContentAccessible, wtoken, contentAccessible))) CheckFlag(kContentAccessible, wtoken, contentAccessible)))
@ -627,6 +643,9 @@ ParseManifest(NSLocationType type, FileLocation &file, char* buf, bool aChromeOn
stGeckoVersion == eBad || stGeckoVersion == eBad ||
stOs == eBad || stOs == eBad ||
stOsVersion == eBad || stOsVersion == eBad ||
#ifdef MOZ_WIDGET_ANDROID
stTablet == eBad ||
#endif
stABI == eBad) stABI == eBad)
continue; continue;