Merge branch 'eclair' into eclair-release

This commit is contained in:
The Android Automerger
2009-10-29 08:26:39 -07:00
6 changed files with 56 additions and 23 deletions

View File

@@ -865,7 +865,11 @@ status_t CameraService::Client::takePicture()
}
// snapshot taken
void CameraService::Client::handleShutter()
void CameraService::Client::handleShutter(
image_rect_type *size // The width and height of yuv picture for
// registerBuffer. If this is NULL, use the picture
// size from parameters.
)
{
// Play shutter sound.
if (mMediaPlayerClick.get() != NULL) {
@@ -889,12 +893,21 @@ void CameraService::Client::handleShutter()
if (mSurface != 0 && !mUseOverlay) {
int w, h;
CameraParameters params(mHardware->getParameters());
params.getPictureSize(&w, &h);
uint32_t transform = 0;
if (params.getOrientation() == CameraParameters::CAMERA_ORIENTATION_PORTRAIT) {
LOGV("portrait mode");
transform = ISurface::BufferHeap::ROT_90;
}
if (size == NULL) {
params.getPictureSize(&w, &h);
} else {
w = size->width;
h = size->height;
w &= ~1;
h &= ~1;
LOGD("Snapshot image width=%d, height=%d", w, h);
}
ISurface::BufferHeap buffers(w, h, w, h,
PIXEL_FORMAT_YCbCr_420_SP, transform, 0, mHardware->getRawHeap());
@@ -1048,7 +1061,8 @@ void CameraService::Client::notifyCallback(int32_t msgType, int32_t ext1, int32_
switch (msgType) {
case CAMERA_MSG_SHUTTER:
client->handleShutter();
// ext1 is the dimension of the yuv picture.
client->handleShutter((image_rect_type *)ext1);
break;
default:
sp<ICameraClient> c = client->mCameraClient;

View File

@@ -145,7 +145,7 @@ private:
static sp<Client> getClientFromCookie(void* user);
void handlePreviewData(const sp<IMemory>&);
void handleShutter();
void handleShutter(image_rect_type *image);
void handlePostview(const sp<IMemory>&);
void handleRawPicture(const sp<IMemory>&);
void handleCompressedPicture(const sp<IMemory>&);

View File

@@ -201,11 +201,11 @@ public class PackageParser {
}
pi.activities = new ActivityInfo[num];
}
for (int i=0; i<N; i++) {
for (int i=0, j=0; i<N; i++) {
final Activity activity = p.activities.get(i);
if (activity.info.enabled
|| (flags&PackageManager.GET_DISABLED_COMPONENTS) != 0) {
pi.activities[i] = generateActivityInfo(p.activities.get(i), flags);
pi.activities[j++] = generateActivityInfo(p.activities.get(i), flags);
}
}
}
@@ -222,11 +222,11 @@ public class PackageParser {
}
pi.receivers = new ActivityInfo[num];
}
for (int i=0; i<N; i++) {
for (int i=0, j=0; i<N; i++) {
final Activity activity = p.receivers.get(i);
if (activity.info.enabled
|| (flags&PackageManager.GET_DISABLED_COMPONENTS) != 0) {
pi.receivers[i] = generateActivityInfo(p.receivers.get(i), flags);
pi.receivers[j++] = generateActivityInfo(p.receivers.get(i), flags);
}
}
}
@@ -243,11 +243,11 @@ public class PackageParser {
}
pi.services = new ServiceInfo[num];
}
for (int i=0; i<N; i++) {
for (int i=0, j=0; i<N; i++) {
final Service service = p.services.get(i);
if (service.info.enabled
|| (flags&PackageManager.GET_DISABLED_COMPONENTS) != 0) {
pi.services[i] = generateServiceInfo(p.services.get(i), flags);
pi.services[j++] = generateServiceInfo(p.services.get(i), flags);
}
}
}
@@ -264,11 +264,11 @@ public class PackageParser {
}
pi.providers = new ProviderInfo[num];
}
for (int i=0; i<N; i++) {
for (int i=0, j=0; i<N; i++) {
final Provider provider = p.providers.get(i);
if (provider.info.enabled
|| (flags&PackageManager.GET_DISABLED_COMPONENTS) != 0) {
pi.providers[i] = generateProviderInfo(p.providers.get(i), flags);
pi.providers[j++] = generateProviderInfo(p.providers.get(i), flags);
}
}
}
@@ -300,12 +300,10 @@ public class PackageParser {
}
}
if ((flags&PackageManager.GET_SIGNATURES) != 0) {
if (p.mSignatures != null) {
int N = p.mSignatures.length;
if (N > 0) {
pi.signatures = new Signature[N];
System.arraycopy(p.mSignatures, 0, pi.signatures, 0, N);
}
int N = (p.mSignatures != null) ? p.mSignatures.length : 0;
if (N > 0) {
pi.signatures = new Signature[N];
System.arraycopy(p.mSignatures, 0, pi.signatures, 0, N);
}
}
return pi;

View File

@@ -70,8 +70,8 @@ page.title=Search Results
searchControl.setSearchStartingCallback(this, function(control, searcher, query) {
// save the tab index from the hash
tabIndex = location.hash.split("&t=")[1];
$("#searchTitle").html("search results for <em>" + query + "</em>");
$("#searchTitle").html("search results for <em>" + escapeHTML(query) + "</em>");
$.history.add('q=' + query + '&t=' + tabIndex);
openTab();
});
@@ -96,7 +96,8 @@ page.title=Search Results
$(window).history(function(e, hash) {
var query = decodeURI(getQuery(hash));
searchControl.execute(query);
$("#searchTitle").html("search results for <em>" + query + "</em>");
$("#searchTitle").html("search results for <em>" + escapeHTML(query) + "</em>");
});
// forcefully regain key-up event control (previously jacked by search api)
@@ -131,6 +132,13 @@ page.title=Search Results
return queryParts[1];
}
/* returns the given string with all HTML brackets converted to entities
TODO: move this to the site's JS library */
function escapeHTML(string) {
return string.replace(/</g,"&lt;")
.replace(/>/g,"&gt;");
}
</script>
<div id="mainBodyFixed" style="width:auto; margin:20px">

View File

@@ -25,6 +25,15 @@
#include <ui/Overlay.h>
namespace android {
/**
* The size of image for display.
*/
typedef struct image_rect_struct
{
uint32_t width; /* Image width */
uint32_t height; /* Image height */
} image_rect_type;
typedef void (*notify_callback)(int32_t msgType,
int32_t ext1,

View File

@@ -6344,7 +6344,9 @@ class PackageManagerService extends IPackageManager.Stub {
continue;
}
for (PackageSetting pkg:sus.packages) {
if (pkg.pkg.requestedPermissions.contains(eachPerm)) {
if (pkg.pkg != null &&
!pkg.pkg.packageName.equalsIgnoreCase(deletedPs.pkg.packageName) &&
pkg.pkg.requestedPermissions.contains(eachPerm)) {
used = true;
break;
}
@@ -6359,7 +6361,9 @@ class PackageManagerService extends IPackageManager.Stub {
int newGids[] = globalGids;
for (String eachPerm : sus.grantedPermissions) {
BasePermission bp = mPermissions.get(eachPerm);
newGids = appendInts(newGids, bp.gids);
if (bp != null) {
newGids = appendInts(newGids, bp.gids);
}
}
sus.gids = newGids;
}