Merge change 8109
* changes:
Add a flag to set whether the overlay has been initialized. Commit needs to be called at least once on each overlay, and it appears that sometimes this doesn't happen because the visibility never changes. With this change the overlay parameter and position will be committed when either the visibility of the window changes, or on the first call to visibility resolved, if it hasn't already been done.
diff --git a/include/binder/MemoryDealer.h b/include/binder/MemoryDealer.h
index 6628f75..03ac70a 100644
--- a/include/binder/MemoryDealer.h
+++ b/include/binder/MemoryDealer.h
@@ -218,8 +218,6 @@
const sp<HeapInterface>& heap,
const sp<AllocatorInterface>& allocator);
- virtual ~MemoryDealer();
-
virtual sp<IMemory> allocate(size_t size, uint32_t flags = 0);
virtual void deallocate(size_t offset);
virtual void dump(const char* what, uint32_t flags = 0) const;
@@ -228,6 +226,9 @@
sp<IMemoryHeap> getMemoryHeap() const { return heap(); }
sp<AllocatorInterface> getAllocator() const { return allocator(); }
+protected:
+ virtual ~MemoryDealer();
+
private:
const sp<HeapInterface>& heap() const;
const sp<AllocatorInterface>& allocator() const;
diff --git a/include/utils/ResourceTypes.h b/include/utils/ResourceTypes.h
index 3819335..edd0cae 100644
--- a/include/utils/ResourceTypes.h
+++ b/include/utils/ResourceTypes.h
@@ -826,6 +826,9 @@
enum {
DENSITY_DEFAULT = 0,
+ DENSITY_LOW = 120,
+ DENSITY_MEDIUM = 160,
+ DENSITY_HIGH = 240,
DENSITY_NONE = 0xffff
};
@@ -855,7 +858,6 @@
enum {
MASK_KEYSHIDDEN = 0x0003,
- SHIFT_KEYSHIDDEN = 0,
KEYSHIDDEN_ANY = 0x0000,
KEYSHIDDEN_NO = 0x0001,
KEYSHIDDEN_YES = 0x0002,
@@ -907,10 +909,18 @@
};
enum {
- SCREENLAYOUT_ANY = 0x0000,
- SCREENLAYOUT_SMALL = 0x0001,
- SCREENLAYOUT_NORMAL = 0x0002,
- SCREENLAYOUT_LARGE = 0x0003,
+ // screenLayout bits for screen size class.
+ MASK_SCREENSIZE = 0x0f,
+ SCREENSIZE_ANY = 0x00,
+ SCREENSIZE_SMALL = 0x01,
+ SCREENSIZE_NORMAL = 0x02,
+ SCREENSIZE_LARGE = 0x03,
+
+ // screenLayout bits for wide/long screen variation.
+ MASK_SCREENLONG = 0x30,
+ SCREENLONG_ANY = 0x00,
+ SCREENLONG_NO = 0x10,
+ SCREENLONG_YES = 0x20,
};
union {
@@ -1040,6 +1050,17 @@
}
}
+ if (screenConfig || o.screenConfig) {
+ if (((screenLayout^o.screenLayout) & MASK_SCREENSIZE) != 0) {
+ if (!(screenLayout & MASK_SCREENSIZE)) return false;
+ if (!(o.screenLayout & MASK_SCREENSIZE)) return true;
+ }
+ if (((screenLayout^o.screenLayout) & MASK_SCREENLONG) != 0) {
+ if (!(screenLayout & MASK_SCREENLONG)) return false;
+ if (!(o.screenLayout & MASK_SCREENLONG)) return true;
+ }
+ }
+
if (screenType || o.screenType) {
if (orientation != o.orientation) {
if (!orientation) return false;
@@ -1056,7 +1077,7 @@
}
if (input || o.input) {
- if (inputFlags != o.inputFlags) {
+ if (((inputFlags^o.inputFlags) & MASK_KEYSHIDDEN) != 0) {
if (!(inputFlags & MASK_KEYSHIDDEN)) return false;
if (!(o.inputFlags & MASK_KEYSHIDDEN)) return true;
}
@@ -1084,13 +1105,6 @@
}
}
- if (screenConfig || o.screenConfig) {
- if (screenLayout != o.screenLayout) {
- if (!screenLayout) return false;
- if (!o.screenLayout) return true;
- }
- }
-
if (version || o.version) {
if (sdkVersion != o.sdkVersion) {
if (!sdkVersion) return false;
@@ -1139,6 +1153,17 @@
}
}
+ if (screenConfig || o.screenConfig) {
+ if (((screenLayout^o.screenLayout) & MASK_SCREENSIZE) != 0
+ && (requested->screenLayout & MASK_SCREENSIZE)) {
+ return (screenLayout & MASK_SCREENSIZE);
+ }
+ if (((screenLayout^o.screenLayout) & MASK_SCREENLONG) != 0
+ && (requested->screenLayout & MASK_SCREENLONG)) {
+ return (screenLayout & MASK_SCREENLONG);
+ }
+ }
+
if (screenType || o.screenType) {
if ((orientation != o.orientation) && requested->orientation) {
return (orientation);
@@ -1220,12 +1245,6 @@
}
}
- if (screenConfig || o.screenConfig) {
- if ((screenLayout != o.screenLayout) && requested->screenLayout) {
- return (screenLayout);
- }
- }
-
if (version || o.version) {
if ((sdkVersion != o.sdkVersion) && requested->sdkVersion) {
return (sdkVersion);
@@ -1273,6 +1292,21 @@
return false;
}
}
+ if (screenConfig != 0) {
+ const int screenSize = screenLayout&MASK_SCREENSIZE;
+ const int setScreenSize = settings.screenLayout&MASK_SCREENSIZE;
+ if (setScreenSize != 0 && screenSize != 0
+ && screenSize != setScreenSize) {
+ return false;
+ }
+
+ const int screenLong = screenLayout&MASK_SCREENLONG;
+ const int setScreenLong = settings.screenLayout&MASK_SCREENLONG;
+ if (setScreenLong != 0 && screenLong != 0
+ && screenLong != setScreenLong) {
+ return false;
+ }
+ }
if (screenType != 0) {
if (settings.orientation != 0 && orientation != 0
&& orientation != settings.orientation) {
@@ -1317,12 +1351,6 @@
return false;
}
}
- if (screenConfig != 0) {
- if (settings.screenLayout != 0 && screenLayout != 0
- && screenLayout != settings.screenLayout) {
- return false;
- }
- }
if (version != 0) {
if (settings.sdkVersion != 0 && sdkVersion != 0
&& sdkVersion != settings.sdkVersion) {
@@ -1352,12 +1380,14 @@
String8 toString() const {
char buf[200];
sprintf(buf, "imsi=%d/%d lang=%c%c reg=%c%c orient=%d touch=%d dens=%d "
- "kbd=%d nav=%d input=%d scrnW=%d scrnH=%d layout=%d vers=%d.%d",
+ "kbd=%d nav=%d input=%d scrnW=%d scrnH=%d sz=%d long=%d vers=%d.%d",
mcc, mnc,
language[0] ? language[0] : '-', language[1] ? language[1] : '-',
country[0] ? country[0] : '-', country[1] ? country[1] : '-',
orientation, touchscreen, density, keyboard, navigation, inputFlags,
- screenWidth, screenHeight, screenLayout, sdkVersion, minorVersion);
+ screenWidth, screenHeight,
+ screenLayout&MASK_SCREENSIZE, screenLayout&MASK_SCREENLONG,
+ sdkVersion, minorVersion);
return String8(buf);
}
};
diff --git a/libs/utils/ResourceTypes.cpp b/libs/utils/ResourceTypes.cpp
index 98d450b..4dca8bd 100644
--- a/libs/utils/ResourceTypes.cpp
+++ b/libs/utils/ResourceTypes.cpp
@@ -4012,11 +4012,11 @@
if (dval == ResTable_config::DENSITY_DEFAULT) {
strcpy(density, "def");
} else if (dval == ResTable_config::DENSITY_NONE) {
- strcpy(density, "non");
+ strcpy(density, "no");
} else {
sprintf(density, "%d", (int)dval);
}
- printf(" config %d lang=%c%c cnt=%c%c orien=%d touch=%d density=%s key=%d infl=%d nav=%d w=%d h=%d lyt=%d\n",
+ printf(" config %d lang=%c%c cnt=%c%c orien=%d touch=%d density=%s key=%d infl=%d nav=%d w=%d h=%d sz=%d lng=%d\n",
(int)configIndex,
type->config.language[0] ? type->config.language[0] : '-',
type->config.language[1] ? type->config.language[1] : '-',
@@ -4030,7 +4030,8 @@
type->config.navigation,
dtohs(type->config.screenWidth),
dtohs(type->config.screenHeight),
- type->config.screenLayout);
+ type->config.screenLayout&ResTable_config::MASK_SCREENSIZE,
+ type->config.screenLayout&ResTable_config::MASK_SCREENLONG);
size_t entryCount = dtohl(type->entryCount);
uint32_t entriesStart = dtohl(type->entriesStart);
if ((entriesStart&0x3) != 0) {