diff options
-rw-r--r-- | api/current.txt | 3 | ||||
-rw-r--r-- | cmds/screencap/screencap.cpp | 21 | ||||
-rw-r--r-- | core/java/android/text/TextUtils.java | 9 | ||||
-rw-r--r-- | core/jni/Android.mk | 4 | ||||
-rw-r--r-- | core/res/res/values/public.xml | 3 | ||||
-rw-r--r-- | core/res/res/values/strings.xml | 8 | ||||
-rw-r--r-- | services/jni/Android.mk | 4 |
7 files changed, 29 insertions, 23 deletions
diff --git a/api/current.txt b/api/current.txt index a98fcfb82613..0a80cac3b542 100644 --- a/api/current.txt +++ b/api/current.txt @@ -253,10 +253,13 @@ package android { field public static final int actionModeCloseDrawable = 16843484; // 0x10102dc field public static final int actionModeCopyDrawable = 16843538; // 0x1010312 field public static final int actionModeCutDrawable = 16843537; // 0x1010311 + field public static final int actionModeFindDrawable = 16843898; // 0x101047a field public static final int actionModePasteDrawable = 16843539; // 0x1010313 field public static final int actionModeSelectAllDrawable = 16843646; // 0x101037e + field public static final int actionModeShareDrawable = 16843897; // 0x1010479 field public static final int actionModeSplitBackground = 16843677; // 0x101039d field public static final int actionModeStyle = 16843668; // 0x1010394 + field public static final int actionModeWebSearchDrawable = 16843899; // 0x101047b field public static final int actionOverflowButtonStyle = 16843510; // 0x10102f6 field public static final int actionProviderClass = 16843657; // 0x1010389 field public static final int actionViewClass = 16843516; // 0x10102fc diff --git a/cmds/screencap/screencap.cpp b/cmds/screencap/screencap.cpp index a57de0179d51..2b365d837805 100644 --- a/cmds/screencap/screencap.cpp +++ b/cmds/screencap/screencap.cpp @@ -18,6 +18,8 @@ #include <unistd.h> #include <stdio.h> #include <fcntl.h> +#include <stdlib.h> +#include <string.h> #include <linux/fb.h> #include <sys/ioctl.h> @@ -86,6 +88,21 @@ static status_t vinfoToPixelFormat(const fb_var_screeninfo& vinfo, return NO_ERROR; } +static status_t notifyMediaScanner(const char* fileName) { + String8 cmd("am broadcast -a android.intent.action.MEDIA_SCANNER_SCAN_FILE -d file://"); + String8 fileUrl("\""); + fileUrl.append(fileName); + fileUrl.append("\""); + cmd.append(fileName); + cmd.append(" > /dev/null"); + int result = system(cmd.string()); + if (result < 0) { + fprintf(stderr, "Unable to broadcast intent for media scanner.\n"); + return UNKNOWN_ERROR; + } + return NO_ERROR; +} + int main(int argc, char** argv) { ProcessState::self()->startThreadPool(); @@ -112,10 +129,11 @@ int main(int argc, char** argv) argv += optind; int fd = -1; + const char* fn; if (argc == 0) { fd = dup(STDOUT_FILENO); } else if (argc == 1) { - const char* fn = argv[0]; + fn = argv[0]; fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0664); if (fd == -1) { fprintf(stderr, "Error opening file: %s (%s)\n", fn, strerror(errno)); @@ -183,6 +201,7 @@ int main(int argc, char** argv) SkData* streamData = stream.copyToData(); write(fd, streamData->data(), streamData->size()); streamData->unref(); + notifyMediaScanner(fn); } else { write(fd, &w, 4); write(fd, &h, 4); diff --git a/core/java/android/text/TextUtils.java b/core/java/android/text/TextUtils.java index a5e62e159d1b..dcf3a40f54dc 100644 --- a/core/java/android/text/TextUtils.java +++ b/core/java/android/text/TextUtils.java @@ -61,6 +61,8 @@ import java.util.regex.Pattern; public class TextUtils { private static final String TAG = "TextUtils"; + private static final String ELLIPSIS = new String(Layout.ELLIPSIS_NORMAL); + private static final String ELLIPSIS_TWO_DOTS = new String(Layout.ELLIPSIS_TWO_DOTS); private TextUtils() { /* cannot be instantiated */ } @@ -1068,14 +1070,9 @@ public class TextUtils { float avail, TruncateAt where, boolean preserveLength, EllipsizeCallback callback) { - - final String ellipsis = (where == TruncateAt.END_SMALL) ? - Resources.getSystem().getString(R.string.ellipsis_two_dots) : - Resources.getSystem().getString(R.string.ellipsis); - return ellipsize(text, paint, avail, where, preserveLength, callback, TextDirectionHeuristics.FIRSTSTRONG_LTR, - ellipsis); + (where == TruncateAt.END_SMALL) ? ELLIPSIS_TWO_DOTS : ELLIPSIS); } /** diff --git a/core/jni/Android.mk b/core/jni/Android.mk index d19bcae22391..5d10f3c6404c 100644 --- a/core/jni/Android.mk +++ b/core/jni/Android.mk @@ -224,10 +224,6 @@ LOCAL_SHARED_LIBRARIES += \ # <bionic_tls.h> in com_google_android_gles_jni_GLImpl.cpp LOCAL_C_INCLUDES += bionic/libc/private -ifeq ($(WITH_MALLOC_LEAK_CHECK),true) - LOCAL_CFLAGS += -DMALLOC_LEAK_CHECK -endif - LOCAL_MODULE:= libandroid_runtime include external/stlport/libstlport.mk diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 81879392c222..34f6afbfb6e3 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -568,6 +568,9 @@ <public type="attr" name="listChoiceIndicatorMultiple" id="0x0101021a" /> <public type="attr" name="versionCode" id="0x0101021b" /> <public type="attr" name="versionName" id="0x0101021c" /> + <public type="attr" name="actionModeShareDrawable" id="0x01010479" /> + <public type="attr" name="actionModeFindDrawable" id="0x0101047a" /> + <public type="attr" name="actionModeWebSearchDrawable" id="0x0101047b" /> <public type="id" name="background" id="0x01020000" /> <public type="id" name="checkbox" id="0x01020001" /> diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index cc2a298bc6f0..f5c3b966241b 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -40,14 +40,6 @@ for a note with no name. --> <string name="untitled"><Untitled></string> - <!-- Used to replace a range of characters in text that is too wide - for the space allocated to it (three dots). --> - <string name="ellipsis">\u2026</string> - - <!-- Used to replace a range of characters in text that is too wide - for the space allocated to it (two dots). --> - <string name="ellipsis_two_dots">\u2025</string> - <!-- How to display the lack of a phone number --> <string name="emptyPhoneNumber">(No phone number)</string> diff --git a/services/jni/Android.mk b/services/jni/Android.mk index 98e9b3085736..83fe910321d5 100644 --- a/services/jni/Android.mk +++ b/services/jni/Android.mk @@ -54,10 +54,6 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_CFLAGS += -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES -ifeq ($(WITH_MALLOC_LEAK_CHECK),true) - LOCAL_CFLAGS += -DMALLOC_LEAK_CHECK -endif - LOCAL_MODULE:= libandroid_servers include $(BUILD_SHARED_LIBRARY) |