mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 708772 - (2/3) Add tablet flag to jar manifest parser and nsSystemInfo [r=bsmedberg]
This commit is contained in:
parent
24aec25c9a
commit
43fd2dc37f
@ -197,11 +197,11 @@ nsSystemInfo::Init()
|
||||
str.Append(NS_LITERAL_STRING(" ("));
|
||||
str.AppendInt(version);
|
||||
str.Append(NS_LITERAL_STRING(")"));
|
||||
}
|
||||
}
|
||||
SetPropertyAsAString(NS_LITERAL_STRING("shellVersion"), str);
|
||||
}
|
||||
|
||||
|
||||
bool isTablet = mozilla::AndroidBridge::Bridge()->IsTablet();
|
||||
SetPropertyAsBool(NS_LITERAL_STRING("isTablet"), isTablet);
|
||||
}
|
||||
#endif
|
||||
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(kOsVersion, "osversion");
|
||||
NS_NAMED_LITERAL_STRING(kABI, "abi");
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
NS_NAMED_LITERAL_STRING(kTablet, "tablet");
|
||||
#endif
|
||||
|
||||
// Obsolete
|
||||
NS_NAMED_LITERAL_STRING(kXPCNativeWrappers, "xpcnativewrappers");
|
||||
@ -498,8 +501,10 @@ ParseManifest(NSLocationType type, FileLocation &file, char* buf, bool aChromeOn
|
||||
gtk_major_version,
|
||||
gtk_minor_version);
|
||||
#elif defined(MOZ_WIDGET_ANDROID)
|
||||
bool isTablet = false;
|
||||
if (mozilla::AndroidBridge::Bridge()) {
|
||||
mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION", "RELEASE", osVersion);
|
||||
isTablet = mozilla::AndroidBridge::Bridge()->IsTablet();
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -587,6 +592,9 @@ ParseManifest(NSLocationType type, FileLocation &file, char* buf, bool aChromeOn
|
||||
TriState stOsVersion = eUnspecified;
|
||||
TriState stOs = eUnspecified;
|
||||
TriState stABI = eUnspecified;
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
TriState stTablet = eUnspecified;
|
||||
#endif
|
||||
bool platform = false;
|
||||
bool contentAccessible = false;
|
||||
|
||||
@ -602,6 +610,14 @@ ParseManifest(NSLocationType type, FileLocation &file, char* buf, bool aChromeOn
|
||||
CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion, stGeckoVersion))
|
||||
continue;
|
||||
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
bool tablet = false;
|
||||
if (CheckFlag(kTablet, wtoken, tablet)) {
|
||||
stTablet = (tablet == isTablet) ? eOK : eBad;
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (directive->contentflags &&
|
||||
(CheckFlag(kPlatform, wtoken, platform) ||
|
||||
CheckFlag(kContentAccessible, wtoken, contentAccessible)))
|
||||
@ -627,6 +643,9 @@ ParseManifest(NSLocationType type, FileLocation &file, char* buf, bool aChromeOn
|
||||
stGeckoVersion == eBad ||
|
||||
stOs == eBad ||
|
||||
stOsVersion == eBad ||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
stTablet == eBad ||
|
||||
#endif
|
||||
stABI == eBad)
|
||||
continue;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user