summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Android.mk56
-rw-r--r--AndroidManifest.xml409
-rw-r--r--CleanSpec.mk56
-rw-r--r--gallerycommon/Android.mk27
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/ApiHelper.java234
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/AsyncTaskUtil.java66
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java260
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/BlobCache.java668
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/Entry.java58
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/EntrySchema.java542
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/FileCache.java312
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/Fingerprint.java187
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/HttpClientFactory.java133
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/LruCache.java90
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/OverScroller.java958
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/Scroller.java507
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/Utils.java340
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/ByteBufferInputStream.java48
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/CountedDataInputStream.java136
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/ExifData.java348
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java2407
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/ExifInvalidFormatException.java23
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/ExifModifier.java196
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/ExifOutputStream.java518
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/ExifParser.java916
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/ExifReader.java92
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/ExifTag.java1008
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/IfdData.java152
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/IfdId.java31
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/JpegHeader.java39
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/OrderedDataOutputStream.java56
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/Rational.java88
-rw-r--r--gallerycommon/src/com/android/gallery3d/jpegstream/JPEGInputStream.java193
-rw-r--r--gallerycommon/src/com/android/gallery3d/jpegstream/JPEGOutputStream.java144
-rw-r--r--gallerycommon/src/com/android/gallery3d/jpegstream/JpegConfig.java32
-rw-r--r--gallerycommon/src/com/android/gallery3d/jpegstream/StreamUtils.java80
-rw-r--r--gallerycommon/src/com/android/gallery3d/util/Future.java35
-rw-r--r--gallerycommon/src/com/android/gallery3d/util/FutureListener.java21
-rw-r--r--gallerycommon/src/com/android/gallery3d/util/PriorityThreadFactory.java49
-rw-r--r--gallerycommon/src/com/android/gallery3d/util/ThreadPool.java268
-rw-r--r--jni/Android.mk52
-rw-r--r--jni/Application.mk1
-rw-r--r--jni/filters/bwfilter.c55
-rw-r--r--jni/filters/contrast.c56
-rw-r--r--jni/filters/edge.c126
-rw-r--r--jni/filters/exposure.c37
-rw-r--r--jni/filters/filters.h53
-rw-r--r--jni/filters/fx.c88
-rw-r--r--jni/filters/geometry.c184
-rw-r--r--jni/filters/gradient.c65
-rw-r--r--jni/filters/highlight.c40
-rw-r--r--jni/filters/hsv.c156
-rw-r--r--jni/filters/hue.c46
-rw-r--r--jni/filters/kmeans.cc81
-rw-r--r--jni/filters/kmeans.h232
-rw-r--r--jni/filters/negative.c33
-rw-r--r--jni/filters/redEyeMath.c172
-rw-r--r--jni/filters/redeye.c31
-rw-r--r--jni/filters/saturated.c53
-rw-r--r--jni/filters/shadows.c57
-rw-r--r--jni/filters/tinyplanet.cc150
-rw-r--r--jni/filters/vibrance.c62
-rw-r--r--jni/filters/vignette.c49
-rw-r--r--jni/filters/wbalance.c169
-rw-r--r--jni/jni_egl_fence.cpp78
-rw-r--r--jni/jni_egl_fence.h33
-rw-r--r--jni_jpegstream/Android.mk41
-rw-r--r--jni_jpegstream/src/error_codes.h26
-rw-r--r--jni_jpegstream/src/inputstream_wrapper.cpp69
-rw-r--r--jni_jpegstream/src/inputstream_wrapper.h38
-rw-r--r--jni_jpegstream/src/jerr_hook.cpp52
-rw-r--r--jni_jpegstream/src/jerr_hook.h43
-rw-r--r--jni_jpegstream/src/jni_defines.h29
-rw-r--r--jni_jpegstream/src/jpeg_config.h31
-rw-r--r--jni_jpegstream/src/jpeg_hook.cpp198
-rw-r--r--jni_jpegstream/src/jpeg_hook.h76
-rw-r--r--jni_jpegstream/src/jpeg_reader.cpp254
-rw-r--r--jni_jpegstream/src/jpeg_reader.h88
-rw-r--r--jni_jpegstream/src/jpeg_writer.cpp218
-rw-r--r--jni_jpegstream/src/jpeg_writer.h83
-rw-r--r--jni_jpegstream/src/jpegstream.cpp377
-rw-r--r--jni_jpegstream/src/outputstream_wrapper.cpp49
-rw-r--r--jni_jpegstream/src/outputstream_wrapper.h35
-rw-r--r--jni_jpegstream/src/stream_wrapper.cpp97
-rw-r--r--jni_jpegstream/src/stream_wrapper.h44
-rw-r--r--proguard.flags86
-rw-r--r--res/anim/count_down_exit.xml29
-rw-r--r--res/anim/on_screen_hint_enter.xml18
-rw-r--r--res/anim/on_screen_hint_exit.xml18
-rw-r--r--res/anim/player_out.xml21
-rw-r--r--res/anim/slide_in_left.xml21
-rw-r--r--res/anim/slide_in_right.xml21
-rw-r--r--res/anim/slide_out_left.xml21
-rw-r--r--res/anim/slide_out_right.xml21
-rw-r--r--res/color/primary_text.xml26
-rw-r--r--res/drawable-hdpi/actionbar_translucent.9.pngbin0 -> 152 bytes
-rw-r--r--res/drawable-hdpi/appwidget_photo_border.9.pngbin0 -> 261 bytes
-rw-r--r--res/drawable-hdpi/background.jpgbin0 -> 1041 bytes
-rw-r--r--res/drawable-hdpi/background_portrait.jpgbin0 -> 1026 bytes
-rw-r--r--res/drawable-hdpi/bg_vidcontrol.pngbin0 -> 9346 bytes
-rw-r--r--res/drawable-hdpi/border_photo_frame_widget_focused_holo.9.pngbin0 -> 520 bytes
-rw-r--r--res/drawable-hdpi/border_photo_frame_widget_holo.9.pngbin0 -> 511 bytes
-rw-r--r--res/drawable-hdpi/border_photo_frame_widget_pressed_holo.9.pngbin0 -> 552 bytes
-rw-r--r--res/drawable-hdpi/btn_make_offline_disabled_on_holo_dark.pngbin0 -> 3950 bytes
-rw-r--r--res/drawable-hdpi/btn_make_offline_normal_off_holo_dark.pngbin0 -> 2640 bytes
-rw-r--r--res/drawable-hdpi/btn_make_offline_normal_on_holo_dark.pngbin0 -> 3957 bytes
-rw-r--r--res/drawable-hdpi/btn_shutter_default.pngbin0 -> 9511 bytes
-rw-r--r--res/drawable-hdpi/btn_shutter_pressed.pngbin0 -> 10378 bytes
-rw-r--r--res/drawable-hdpi/btn_shutter_recording.pngbin0 -> 9955 bytes
-rw-r--r--res/drawable-hdpi/btn_shutter_video_default.pngbin0 -> 9209 bytes
-rw-r--r--res/drawable-hdpi/btn_shutter_video_pressed.pngbin0 -> 9322 bytes
-rw-r--r--res/drawable-hdpi/btn_shutter_video_recording.pngbin0 -> 9666 bytes
-rw-r--r--res/drawable-hdpi/btn_video_shutter_recording_holo.pngbin0 -> 9713 bytes
-rw-r--r--res/drawable-hdpi/btn_video_shutter_recording_holo_large.pngbin0 -> 17243 bytes
-rw-r--r--res/drawable-hdpi/btn_video_shutter_recording_pressed_holo.pngbin0 -> 12918 bytes
-rw-r--r--res/drawable-hdpi/btn_video_shutter_recording_pressed_holo_large.pngbin0 -> 21258 bytes
-rw-r--r--res/drawable-hdpi/cab_divider_vertical_dark.pngbin0 -> 311 bytes
-rw-r--r--res/drawable-hdpi/camera_crop.pngbin0 -> 1662 bytes
-rw-r--r--res/drawable-hdpi/capture_thumbnail_shadow.9.pngbin0 -> 1066 bytes
-rw-r--r--res/drawable-hdpi/dialog_full_holo_dark.9.pngbin0 -> 1414 bytes
-rw-r--r--res/drawable-hdpi/dropdown_ic_arrow_normal_holo_dark.pngbin0 -> 508 bytes
-rw-r--r--res/drawable-hdpi/filtershow_button_colors_curve.pngbin0 -> 1568 bytes
-rw-r--r--res/drawable-hdpi/filtershow_button_colors_sharpen.pngbin0 -> 726 bytes
-rw-r--r--res/drawable-hdpi/filtershow_button_grad.pngbin0 -> 1408 bytes
-rw-r--r--res/drawable-hdpi/filtershow_button_redo.pngbin0 -> 611 bytes
-rw-r--r--res/drawable-hdpi/filtershow_button_undo.pngbin0 -> 436 bytes
-rw-r--r--res/drawable-hdpi/filtershow_scrubber_control_disabled.pngbin0 -> 3495 bytes
-rw-r--r--res/drawable-hdpi/filtershow_scrubber_control_focused.pngbin0 -> 3663 bytes
-rw-r--r--res/drawable-hdpi/filtershow_scrubber_control_normal.pngbin0 -> 3915 bytes
-rw-r--r--res/drawable-hdpi/filtershow_scrubber_control_pressed.pngbin0 -> 4269 bytes
-rw-r--r--res/drawable-hdpi/filtershow_scrubber_primary.9.pngbin0 -> 2867 bytes
-rw-r--r--res/drawable-hdpi/filtershow_scrubber_secondary.9.pngbin0 -> 2866 bytes
-rw-r--r--res/drawable-hdpi/filtershow_scrubber_track.9.pngbin0 -> 167 bytes
-rw-r--r--res/drawable-hdpi/frame_overlay_gallery_camera.pngbin0 -> 999 bytes
-rw-r--r--res/drawable-hdpi/frame_overlay_gallery_folder.pngbin0 -> 832 bytes
-rw-r--r--res/drawable-hdpi/frame_overlay_gallery_picasa.pngbin0 -> 1480 bytes
-rw-r--r--res/drawable-hdpi/grid_pressed.9.pngbin0 -> 238 bytes
-rw-r--r--res/drawable-hdpi/grid_selected.9.pngbin0 -> 238 bytes
-rw-r--r--res/drawable-hdpi/ic_360pano_holo_light.pngbin0 -> 1956 bytes
-rw-r--r--res/drawable-hdpi/ic_btn_shutter_retake.pngbin0 -> 1459 bytes
-rw-r--r--res/drawable-hdpi/ic_cameraalbum_overlay.pngbin0 -> 5618 bytes
-rw-r--r--res/drawable-hdpi/ic_control_play.pngbin0 -> 11314 bytes
-rw-r--r--res/drawable-hdpi/ic_effects_holo_light.pngbin0 -> 979 bytes
-rw-r--r--res/drawable-hdpi/ic_effects_holo_light_large.pngbin0 -> 1897 bytes
-rw-r--r--res/drawable-hdpi/ic_effects_holo_light_xlarge.pngbin0 -> 1897 bytes
-rw-r--r--res/drawable-hdpi/ic_exposure_0.pngbin0 -> 1570 bytes
-rw-r--r--res/drawable-hdpi/ic_exposure_holo_light.pngbin0 -> 4074 bytes
-rw-r--r--res/drawable-hdpi/ic_exposure_n1.pngbin0 -> 1425 bytes
-rw-r--r--res/drawable-hdpi/ic_exposure_n2.pngbin0 -> 2228 bytes
-rw-r--r--res/drawable-hdpi/ic_exposure_n3.pngbin0 -> 2367 bytes
-rw-r--r--res/drawable-hdpi/ic_exposure_p1.pngbin0 -> 1798 bytes
-rw-r--r--res/drawable-hdpi/ic_exposure_p2.pngbin0 -> 2497 bytes
-rw-r--r--res/drawable-hdpi/ic_exposure_p3.pngbin0 -> 2627 bytes
-rw-r--r--res/drawable-hdpi/ic_flash_auto_holo_light.pngbin0 -> 3523 bytes
-rw-r--r--res/drawable-hdpi/ic_flash_off_holo_light.pngbin0 -> 3444 bytes
-rw-r--r--res/drawable-hdpi/ic_flash_on_holo_light.pngbin0 -> 2584 bytes
-rw-r--r--res/drawable-hdpi/ic_gallery_play.pngbin0 -> 4071 bytes
-rw-r--r--res/drawable-hdpi/ic_gallery_play_big.pngbin0 -> 6425 bytes
-rw-r--r--res/drawable-hdpi/ic_grad_add.pngbin0 -> 3821 bytes
-rw-r--r--res/drawable-hdpi/ic_grad_del.pngbin0 -> 2508 bytes
-rw-r--r--res/drawable-hdpi/ic_hdr.pngbin0 -> 2889 bytes
-rw-r--r--res/drawable-hdpi/ic_hdr_off.pngbin0 -> 4078 bytes
-rw-r--r--res/drawable-hdpi/ic_imagesize.pngbin0 -> 2035 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_ev_0.pngbin0 -> 1461 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_ev_n1.pngbin0 -> 1664 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_ev_n2.pngbin0 -> 2216 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_ev_n3.pngbin0 -> 2421 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_ev_p1.pngbin0 -> 1914 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_ev_p2.pngbin0 -> 2441 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_ev_p3.pngbin0 -> 2607 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_flash_auto.pngbin0 -> 2648 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_flash_off.pngbin0 -> 1581 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_flash_on.pngbin0 -> 2153 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_loc_off.pngbin0 -> 2733 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_loc_on.pngbin0 -> 1833 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_sce_hdr.pngbin0 -> 2167 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_sce_off.pngbin0 -> 1372 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_sce_on.pngbin0 -> 2656 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_timer_off.pngbin0 -> 1849 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_timer_on.pngbin0 -> 2406 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_wb_cloudy.pngbin0 -> 1758 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_wb_daylight.pngbin0 -> 2904 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_wb_fluorescent.pngbin0 -> 2387 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_wb_off.pngbin0 -> 1582 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_wb_tungsten.pngbin0 -> 2118 bytes
-rw-r--r--res/drawable-hdpi/ic_location.pngbin0 -> 2682 bytes
-rw-r--r--res/drawable-hdpi/ic_location_off.pngbin0 -> 3370 bytes
-rw-r--r--res/drawable-hdpi/ic_menu_camera_holo_light.pngbin0 -> 1051 bytes
-rw-r--r--res/drawable-hdpi/ic_menu_cancel_holo_light.pngbin0 -> 2539 bytes
-rw-r--r--res/drawable-hdpi/ic_menu_done_holo_light.pngbin0 -> 2578 bytes
-rw-r--r--res/drawable-hdpi/ic_menu_edit_holo_dark.pngbin0 -> 1677 bytes
-rw-r--r--res/drawable-hdpi/ic_menu_info_details.pngbin0 -> 2294 bytes
-rw-r--r--res/drawable-hdpi/ic_menu_make_offline.pngbin0 -> 931 bytes
-rw-r--r--res/drawable-hdpi/ic_menu_ptp_holo_light.pngbin0 -> 1349 bytes
-rw-r--r--res/drawable-hdpi/ic_menu_revert_holo_dark.pngbin0 -> 436 bytes
-rw-r--r--res/drawable-hdpi/ic_menu_savephoto.pngbin0 -> 1762 bytes
-rwxr-xr-xres/drawable-hdpi/ic_menu_savephoto_disabled.pngbin0 -> 1434 bytes
-rw-r--r--res/drawable-hdpi/ic_menu_share_holo_light.pngbin0 -> 1007 bytes
-rw-r--r--res/drawable-hdpi/ic_menu_slideshow_holo_light.pngbin0 -> 804 bytes
-rw-r--r--res/drawable-hdpi/ic_menu_tiny_planet.pngbin0 -> 2425 bytes
-rw-r--r--res/drawable-hdpi/ic_menu_trash_holo_light.pngbin0 -> 970 bytes
-rw-r--r--res/drawable-hdpi/ic_pan_border_fast.9.pngbin0 -> 479 bytes
-rw-r--r--res/drawable-hdpi/ic_pan_border_fast_large.9.pngbin0 -> 1073 bytes
-rw-r--r--res/drawable-hdpi/ic_pan_border_fast_xlarge.9.pngbin0 -> 1073 bytes
-rw-r--r--res/drawable-hdpi/ic_pan_left_indicator.pngbin0 -> 569 bytes
-rw-r--r--res/drawable-hdpi/ic_pan_left_indicator_fast.pngbin0 -> 565 bytes
-rw-r--r--res/drawable-hdpi/ic_pan_left_indicator_fast_large.pngbin0 -> 1005 bytes
-rw-r--r--res/drawable-hdpi/ic_pan_left_indicator_fast_xlarge.pngbin0 -> 1005 bytes
-rw-r--r--res/drawable-hdpi/ic_pan_left_indicator_large.pngbin0 -> 1024 bytes
-rw-r--r--res/drawable-hdpi/ic_pan_left_indicator_xlarge.pngbin0 -> 1024 bytes
-rw-r--r--res/drawable-hdpi/ic_pan_progression.pngbin0 -> 1654 bytes
-rw-r--r--res/drawable-hdpi/ic_pan_progression_large.pngbin0 -> 2685 bytes
-rw-r--r--res/drawable-hdpi/ic_pan_progression_xlarge.pngbin0 -> 2685 bytes
-rw-r--r--res/drawable-hdpi/ic_pan_right_indicator.pngbin0 -> 574 bytes
-rw-r--r--res/drawable-hdpi/ic_pan_right_indicator_fast.pngbin0 -> 572 bytes
-rw-r--r--res/drawable-hdpi/ic_pan_right_indicator_fast_large.pngbin0 -> 979 bytes
-rw-r--r--res/drawable-hdpi/ic_pan_right_indicator_fast_xlarge.pngbin0 -> 979 bytes
-rw-r--r--res/drawable-hdpi/ic_pan_right_indicator_large.pngbin0 -> 987 bytes
-rw-r--r--res/drawable-hdpi/ic_pan_right_indicator_xlarge.pngbin0 -> 987 bytes
-rw-r--r--res/drawable-hdpi/ic_photoeditor_border.pngbin0 -> 821 bytes
-rw-r--r--res/drawable-hdpi/ic_photoeditor_color.pngbin0 -> 1874 bytes
-rw-r--r--res/drawable-hdpi/ic_photoeditor_effects.pngbin0 -> 2067 bytes
-rw-r--r--res/drawable-hdpi/ic_photoeditor_fix.pngbin0 -> 840 bytes
-rw-r--r--res/drawable-hdpi/ic_recording_indicator.pngbin0 -> 952 bytes
-rw-r--r--res/drawable-hdpi/ic_sce.pngbin0 -> 3237 bytes
-rw-r--r--res/drawable-hdpi/ic_sce_action.pngbin0 -> 4450 bytes
-rw-r--r--res/drawable-hdpi/ic_sce_night.pngbin0 -> 3497 bytes
-rw-r--r--res/drawable-hdpi/ic_sce_off.pngbin0 -> 4202 bytes
-rw-r--r--res/drawable-hdpi/ic_sce_party.pngbin0 -> 4481 bytes
-rw-r--r--res/drawable-hdpi/ic_sce_sunset.pngbin0 -> 3286 bytes
-rw-r--r--res/drawable-hdpi/ic_scn_holo_light.pngbin0 -> 1062 bytes
-rw-r--r--res/drawable-hdpi/ic_scn_holo_light_large.pngbin0 -> 2264 bytes
-rw-r--r--res/drawable-hdpi/ic_scn_holo_light_xlarge.pngbin0 -> 2264 bytes
-rw-r--r--res/drawable-hdpi/ic_settings_holo_light.pngbin0 -> 3187 bytes
-rw-r--r--res/drawable-hdpi/ic_snapshot_border.9.pngbin0 -> 247 bytes
-rw-r--r--res/drawable-hdpi/ic_snapshot_border_large.9.pngbin0 -> 327 bytes
-rw-r--r--res/drawable-hdpi/ic_snapshot_border_xlarge.9.pngbin0 -> 327 bytes
-rw-r--r--res/drawable-hdpi/ic_switch_back.pngbin0 -> 3490 bytes
-rw-r--r--res/drawable-hdpi/ic_switch_camera.pngbin0 -> 4685 bytes
-rw-r--r--res/drawable-hdpi/ic_switch_front.pngbin0 -> 3962 bytes
-rw-r--r--res/drawable-hdpi/ic_switch_photo_facing_holo_light.pngbin0 -> 4934 bytes
-rw-r--r--res/drawable-hdpi/ic_switch_photo_facing_holo_light_large.pngbin0 -> 2669 bytes
-rw-r--r--res/drawable-hdpi/ic_switch_photo_facing_holo_light_xlarge.pngbin0 -> 2669 bytes
-rw-r--r--res/drawable-hdpi/ic_switch_photosphere.pngbin0 -> 7196 bytes
-rw-r--r--res/drawable-hdpi/ic_switch_video.pngbin0 -> 3393 bytes
-rw-r--r--res/drawable-hdpi/ic_switch_video_facing_holo_light.pngbin0 -> 4012 bytes
-rw-r--r--res/drawable-hdpi/ic_switch_video_facing_holo_light_large.pngbin0 -> 2281 bytes
-rw-r--r--res/drawable-hdpi/ic_switch_video_facing_holo_light_xlarge.pngbin0 -> 2281 bytes
-rw-r--r--res/drawable-hdpi/ic_switcher_menu_indicator.pngbin0 -> 1058 bytes
-rw-r--r--res/drawable-hdpi/ic_timelapse_none.pngbin0 -> 1033 bytes
-rw-r--r--res/drawable-hdpi/ic_timelapse_none_large.pngbin0 -> 1485 bytes
-rw-r--r--res/drawable-hdpi/ic_timelapse_none_xlarge.pngbin0 -> 1485 bytes
-rw-r--r--res/drawable-hdpi/ic_timer.pngbin0 -> 3331 bytes
-rw-r--r--res/drawable-hdpi/ic_vidcontrol_pause.pngbin0 -> 1091 bytes
-rw-r--r--res/drawable-hdpi/ic_vidcontrol_play.pngbin0 -> 1498 bytes
-rw-r--r--res/drawable-hdpi/ic_vidcontrol_reload.pngbin0 -> 1940 bytes
-rw-r--r--res/drawable-hdpi/ic_video_effects_background_fields_of_wheat_holo.pngbin0 -> 407 bytes
-rw-r--r--res/drawable-hdpi/ic_video_effects_background_intergalactic_holo.pngbin0 -> 351 bytes
-rw-r--r--res/drawable-hdpi/ic_video_effects_background_normal_holo_dark.pngbin0 -> 307 bytes
-rw-r--r--res/drawable-hdpi/ic_video_effects_faces_big_eyes_holo_dark.pngbin0 -> 1586 bytes
-rw-r--r--res/drawable-hdpi/ic_video_effects_faces_big_mouth_holo_dark.pngbin0 -> 1294 bytes
-rw-r--r--res/drawable-hdpi/ic_video_effects_faces_big_nose_holo_dark.pngbin0 -> 1183 bytes
-rw-r--r--res/drawable-hdpi/ic_video_effects_faces_small_eyes_holo_dark.pngbin0 -> 960 bytes
-rw-r--r--res/drawable-hdpi/ic_video_effects_faces_small_mouth_holo_dark.pngbin0 -> 1084 bytes
-rw-r--r--res/drawable-hdpi/ic_video_effects_faces_squeeze_holo_dark.pngbin0 -> 844 bytes
-rw-r--r--res/drawable-hdpi/ic_video_thumb.pngbin0 -> 725 bytes
-rw-r--r--res/drawable-hdpi/ic_view_photosphere.pngbin0 -> 12036 bytes
-rw-r--r--res/drawable-hdpi/ic_wb_auto.pngbin0 -> 3487 bytes
-rw-r--r--res/drawable-hdpi/ic_wb_cloudy.pngbin0 -> 2117 bytes
-rw-r--r--res/drawable-hdpi/ic_wb_fluorescent.pngbin0 -> 3614 bytes
-rw-r--r--res/drawable-hdpi/ic_wb_incandescent.pngbin0 -> 3023 bytes
-rw-r--r--res/drawable-hdpi/ic_wb_sunlight.pngbin0 -> 4346 bytes
-rw-r--r--res/drawable-hdpi/icn_media_pause_focused_holo_dark.pngbin0 -> 549 bytes
-rw-r--r--res/drawable-hdpi/icn_media_pause_normal_holo_dark.pngbin0 -> 500 bytes
-rw-r--r--res/drawable-hdpi/icn_media_pause_pressed_holo_dark.pngbin0 -> 1300 bytes
-rw-r--r--res/drawable-hdpi/icn_media_play_focused_holo_dark.pngbin0 -> 1370 bytes
-rw-r--r--res/drawable-hdpi/icn_media_play_normal_holo_dark.pngbin0 -> 1810 bytes
-rw-r--r--res/drawable-hdpi/icn_media_play_pressed_holo_dark.pngbin0 -> 2300 bytes
-rw-r--r--res/drawable-hdpi/list_divider.9.pngbin0 -> 78 bytes
-rw-r--r--res/drawable-hdpi/list_divider_holo_dark.9.pngbin0 -> 78 bytes
-rw-r--r--res/drawable-hdpi/list_divider_large.9.pngbin0 -> 78 bytes
-rw-r--r--res/drawable-hdpi/list_pressed_holo_light.9.pngbin0 -> 159 bytes
-rw-r--r--res/drawable-hdpi/list_selector_background_selected.9.pngbin0 -> 748 bytes
-rw-r--r--res/drawable-hdpi/menu_dropdown_panel_holo_dark.9.pngbin0 -> 922 bytes
-rw-r--r--res/drawable-hdpi/on_screen_hint_frame.9.pngbin0 -> 2181 bytes
-rw-r--r--res/drawable-hdpi/overscroll_edge.pngbin0 -> 1345 bytes
-rw-r--r--res/drawable-hdpi/overscroll_glow.pngbin0 -> 36241 bytes
-rw-r--r--res/drawable-hdpi/panel_undo_holo.9.pngbin0 -> 599 bytes
-rw-r--r--res/drawable-hdpi/placeholder_camera.pngbin0 -> 2950 bytes
-rw-r--r--res/drawable-hdpi/placeholder_empty.pngbin0 -> 2489 bytes
-rw-r--r--res/drawable-hdpi/placeholder_locked.pngbin0 -> 2081 bytes
-rw-r--r--res/drawable-hdpi/preview.pngbin0 -> 51248 bytes
-rw-r--r--res/drawable-hdpi/scrubber_knob.pngbin0 -> 2958 bytes
-rw-r--r--res/drawable-hdpi/spinner_76_inner_holo.pngbin0 -> 2763 bytes
-rw-r--r--res/drawable-hdpi/spinner_76_outer_holo.pngbin0 -> 2370 bytes
-rw-r--r--res/drawable-hdpi/switch_bg_focused_holo_dark.9.pngbin0 -> 269 bytes
-rw-r--r--res/drawable-hdpi/switch_bg_holo_dark.9.pngbin0 -> 182 bytes
-rw-r--r--res/drawable-hdpi/switch_thumb_activated_holo_dark.9.pngbin0 -> 549 bytes
-rw-r--r--res/drawable-hdpi/switch_thumb_disabled_holo_dark.9.pngbin0 -> 535 bytes
-rw-r--r--res/drawable-hdpi/switch_thumb_holo_dark.9.pngbin0 -> 559 bytes
-rw-r--r--res/drawable-hdpi/switch_thumb_pressed_holo_dark.9.pngbin0 -> 566 bytes
-rw-r--r--res/drawable-hdpi/text_select_handle_left.pngbin0 -> 1667 bytes
-rw-r--r--res/drawable-hdpi/text_select_handle_right.pngbin0 -> 1762 bytes
-rw-r--r--res/drawable-hdpi/toast_frame_holo.9.pngbin0 -> 1585 bytes
-rw-r--r--res/drawable-hdpi/wallpaper_picker_preview.pngbin0 -> 413757 bytes
-rw-r--r--res/drawable-land-hdpi/btn_video_shutter_recording_holo_xlarge.pngbin0 -> 25604 bytes
-rw-r--r--res/drawable-land-hdpi/btn_video_shutter_recording_pressed_holo_xlarge.pngbin0 -> 30508 bytes
-rw-r--r--res/drawable-land-hdpi/switcher_bg.9.pngbin0 -> 467 bytes
-rw-r--r--res/drawable-land-mdpi/btn_video_shutter_recording_holo_xlarge.pngbin0 -> 16572 bytes
-rw-r--r--res/drawable-land-mdpi/btn_video_shutter_recording_pressed_holo_xlarge.pngbin0 -> 19646 bytes
-rw-r--r--res/drawable-land-mdpi/switcher_bg.9.pngbin0 -> 344 bytes
-rw-r--r--res/drawable-land-xhdpi/btn_video_shutter_recording_holo_xlarge.pngbin0 -> 40995 bytes
-rw-r--r--res/drawable-land-xhdpi/btn_video_shutter_recording_pressed_holo_xlarge.pngbin0 -> 48460 bytes
-rw-r--r--res/drawable-land-xhdpi/switcher_bg.9.pngbin0 -> 629 bytes
-rw-r--r--res/drawable-mdpi/actionbar_translucent.9.pngbin0 -> 140 bytes
-rw-r--r--res/drawable-mdpi/appwidget_photo_border.9.pngbin0 -> 263 bytes
-rw-r--r--res/drawable-mdpi/background.jpgbin0 -> 1041 bytes
-rw-r--r--res/drawable-mdpi/background_portrait.jpgbin0 -> 1026 bytes
-rw-r--r--res/drawable-mdpi/bg_vidcontrol.pngbin0 -> 5543 bytes
-rw-r--r--res/drawable-mdpi/border_photo_frame_widget_focused_holo.9.pngbin0 -> 1317 bytes
-rw-r--r--res/drawable-mdpi/border_photo_frame_widget_holo.9.pngbin0 -> 3096 bytes
-rw-r--r--res/drawable-mdpi/border_photo_frame_widget_pressed_holo.9.pngbin0 -> 1321 bytes
-rw-r--r--res/drawable-mdpi/btn_make_offline_disabled_on_holo_dark.pngbin0 -> 2262 bytes
-rw-r--r--res/drawable-mdpi/btn_make_offline_normal_off_holo_dark.pngbin0 -> 2252 bytes
-rw-r--r--res/drawable-mdpi/btn_make_offline_normal_on_holo_dark.pngbin0 -> 2242 bytes
-rw-r--r--res/drawable-mdpi/btn_shutter_default.pngbin0 -> 5623 bytes
-rw-r--r--res/drawable-mdpi/btn_shutter_pressed.pngbin0 -> 6013 bytes
-rw-r--r--res/drawable-mdpi/btn_shutter_recording.pngbin0 -> 5933 bytes
-rw-r--r--res/drawable-mdpi/btn_shutter_video_default.pngbin0 -> 5347 bytes
-rw-r--r--res/drawable-mdpi/btn_shutter_video_pressed.pngbin0 -> 5389 bytes
-rw-r--r--res/drawable-mdpi/btn_shutter_video_recording.pngbin0 -> 5744 bytes
-rw-r--r--res/drawable-mdpi/btn_video_shutter_recording_holo.pngbin0 -> 4793 bytes
-rw-r--r--res/drawable-mdpi/btn_video_shutter_recording_pressed_holo.pngbin0 -> 6812 bytes
-rw-r--r--res/drawable-mdpi/cab_divider_vertical_dark.pngbin0 -> 311 bytes
-rw-r--r--res/drawable-mdpi/camera_crop.pngbin0 -> 1093 bytes
-rw-r--r--res/drawable-mdpi/capture_thumbnail_shadow.9.pngbin0 -> 700 bytes
-rw-r--r--res/drawable-mdpi/dialog_full_holo_dark.9.pngbin0 -> 882 bytes
-rw-r--r--res/drawable-mdpi/dropdown_ic_arrow_normal_holo_dark.pngbin0 -> 443 bytes
-rw-r--r--res/drawable-mdpi/filtershow_button_colors_curve.pngbin0 -> 1139 bytes
-rw-r--r--res/drawable-mdpi/filtershow_button_colors_sharpen.pngbin0 -> 732 bytes
-rw-r--r--res/drawable-mdpi/filtershow_button_grad.pngbin0 -> 990 bytes
-rw-r--r--res/drawable-mdpi/filtershow_button_redo.pngbin0 -> 462 bytes
-rw-r--r--res/drawable-mdpi/filtershow_button_undo.pngbin0 -> 308 bytes
-rw-r--r--res/drawable-mdpi/filtershow_scrubber_control_disabled.pngbin0 -> 3223 bytes
-rw-r--r--res/drawable-mdpi/filtershow_scrubber_control_focused.pngbin0 -> 3291 bytes
-rw-r--r--res/drawable-mdpi/filtershow_scrubber_control_normal.pngbin0 -> 3396 bytes
-rw-r--r--res/drawable-mdpi/filtershow_scrubber_control_pressed.pngbin0 -> 3579 bytes
-rw-r--r--res/drawable-mdpi/filtershow_scrubber_primary.9.pngbin0 -> 2854 bytes
-rw-r--r--res/drawable-mdpi/filtershow_scrubber_secondary.9.pngbin0 -> 2853 bytes
-rw-r--r--res/drawable-mdpi/filtershow_scrubber_track.9.pngbin0 -> 161 bytes
-rw-r--r--res/drawable-mdpi/frame_overlay_gallery_camera.pngbin0 -> 720 bytes
-rw-r--r--res/drawable-mdpi/frame_overlay_gallery_folder.pngbin0 -> 623 bytes
-rw-r--r--res/drawable-mdpi/frame_overlay_gallery_picasa.pngbin0 -> 986 bytes
-rw-r--r--res/drawable-mdpi/grid_pressed.9.pngbin0 -> 234 bytes
-rw-r--r--res/drawable-mdpi/grid_selected.9.pngbin0 -> 232 bytes
-rw-r--r--res/drawable-mdpi/ic_360pano_holo_light.pngbin0 -> 1278 bytes
-rw-r--r--res/drawable-mdpi/ic_btn_shutter_retake.pngbin0 -> 994 bytes
-rw-r--r--res/drawable-mdpi/ic_cameraalbum_overlay.pngbin0 -> 3506 bytes
-rw-r--r--res/drawable-mdpi/ic_control_play.pngbin0 -> 6627 bytes
-rw-r--r--res/drawable-mdpi/ic_effects_holo_light.pngbin0 -> 803 bytes
-rw-r--r--res/drawable-mdpi/ic_effects_holo_light_xlarge.pngbin0 -> 1262 bytes
-rw-r--r--res/drawable-mdpi/ic_exposure_0.pngbin0 -> 1087 bytes
-rw-r--r--res/drawable-mdpi/ic_exposure_holo_light.pngbin0 -> 2484 bytes
-rw-r--r--res/drawable-mdpi/ic_exposure_n1.pngbin0 -> 1136 bytes
-rw-r--r--res/drawable-mdpi/ic_exposure_n2.pngbin0 -> 1509 bytes
-rw-r--r--res/drawable-mdpi/ic_exposure_n3.pngbin0 -> 1504 bytes
-rw-r--r--res/drawable-mdpi/ic_exposure_p1.pngbin0 -> 1318 bytes
-rw-r--r--res/drawable-mdpi/ic_exposure_p2.pngbin0 -> 1637 bytes
-rw-r--r--res/drawable-mdpi/ic_exposure_p3.pngbin0 -> 1678 bytes
-rw-r--r--res/drawable-mdpi/ic_flash_auto_holo_light.pngbin0 -> 2186 bytes
-rw-r--r--res/drawable-mdpi/ic_flash_off_holo_light.pngbin0 -> 2131 bytes
-rw-r--r--res/drawable-mdpi/ic_flash_on_holo_light.pngbin0 -> 1688 bytes
-rw-r--r--res/drawable-mdpi/ic_gallery_play.pngbin0 -> 2713 bytes
-rw-r--r--res/drawable-mdpi/ic_gallery_play_big.pngbin0 -> 3975 bytes
-rw-r--r--res/drawable-mdpi/ic_grad_add.pngbin0 -> 2535 bytes
-rw-r--r--res/drawable-mdpi/ic_grad_del.pngbin0 -> 1752 bytes
-rw-r--r--res/drawable-mdpi/ic_hdr.pngbin0 -> 1935 bytes
-rw-r--r--res/drawable-mdpi/ic_hdr_off.pngbin0 -> 2566 bytes
-rw-r--r--res/drawable-mdpi/ic_imagesize.pngbin0 -> 1377 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_ev_0.pngbin0 -> 981 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_ev_n1.pngbin0 -> 1221 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_ev_n2.pngbin0 -> 1473 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_ev_n3.pngbin0 -> 1508 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_ev_p1.pngbin0 -> 1339 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_ev_p2.pngbin0 -> 1552 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_ev_p3.pngbin0 -> 1600 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_flash_auto.pngbin0 -> 1711 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_flash_off.pngbin0 -> 1023 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_flash_on.pngbin0 -> 1433 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_loc_off.pngbin0 -> 1757 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_loc_on.pngbin0 -> 1197 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_sce_hdr.pngbin0 -> 1419 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_sce_off.pngbin0 -> 971 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_sce_on.pngbin0 -> 1642 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_timer_off.pngbin0 -> 1201 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_timer_on.pngbin0 -> 1558 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_wb_cloudy.pngbin0 -> 1224 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_wb_daylight.pngbin0 -> 1781 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_wb_fluorescent.pngbin0 -> 1603 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_wb_off.pngbin0 -> 1044 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_wb_tungsten.pngbin0 -> 1428 bytes
-rw-r--r--res/drawable-mdpi/ic_location.pngbin0 -> 1744 bytes
-rw-r--r--res/drawable-mdpi/ic_location_off.pngbin0 -> 2149 bytes
-rw-r--r--res/drawable-mdpi/ic_menu_camera_holo_light.pngbin0 -> 763 bytes
-rw-r--r--res/drawable-mdpi/ic_menu_cancel_holo_light.pngbin0 -> 1663 bytes
-rw-r--r--res/drawable-mdpi/ic_menu_done_holo_light.pngbin0 -> 1681 bytes
-rw-r--r--res/drawable-mdpi/ic_menu_edit_holo_dark.pngbin0 -> 1136 bytes
-rw-r--r--res/drawable-mdpi/ic_menu_info_details.pngbin0 -> 1096 bytes
-rw-r--r--res/drawable-mdpi/ic_menu_make_offline.pngbin0 -> 743 bytes
-rw-r--r--res/drawable-mdpi/ic_menu_ptp_holo_light.pngbin0 -> 934 bytes
-rw-r--r--res/drawable-mdpi/ic_menu_revert_holo_dark.pngbin0 -> 308 bytes
-rw-r--r--res/drawable-mdpi/ic_menu_savephoto.pngbin0 -> 1273 bytes
-rwxr-xr-xres/drawable-mdpi/ic_menu_savephoto_disabled.pngbin0 -> 1033 bytes
-rw-r--r--res/drawable-mdpi/ic_menu_share_holo_light.pngbin0 -> 706 bytes
-rw-r--r--res/drawable-mdpi/ic_menu_slideshow_holo_light.pngbin0 -> 643 bytes
-rw-r--r--res/drawable-mdpi/ic_menu_tiny_planet.pngbin0 -> 1485 bytes
-rw-r--r--res/drawable-mdpi/ic_menu_trash_holo_light.pngbin0 -> 726 bytes
-rw-r--r--res/drawable-mdpi/ic_pan_border_fast.9.pngbin0 -> 504 bytes
-rw-r--r--res/drawable-mdpi/ic_pan_border_fast_xlarge.9.pngbin0 -> 784 bytes
-rw-r--r--res/drawable-mdpi/ic_pan_left_indicator.pngbin0 -> 486 bytes
-rw-r--r--res/drawable-mdpi/ic_pan_left_indicator_fast.pngbin0 -> 483 bytes
-rw-r--r--res/drawable-mdpi/ic_pan_left_indicator_fast_xlarge.pngbin0 -> 775 bytes
-rw-r--r--res/drawable-mdpi/ic_pan_left_indicator_xlarge.pngbin0 -> 779 bytes
-rw-r--r--res/drawable-mdpi/ic_pan_progression.pngbin0 -> 1097 bytes
-rw-r--r--res/drawable-mdpi/ic_pan_progression_xlarge.pngbin0 -> 1640 bytes
-rw-r--r--res/drawable-mdpi/ic_pan_right_indicator.pngbin0 -> 499 bytes
-rw-r--r--res/drawable-mdpi/ic_pan_right_indicator_fast.pngbin0 -> 501 bytes
-rw-r--r--res/drawable-mdpi/ic_pan_right_indicator_fast_xlarge.pngbin0 -> 777 bytes
-rw-r--r--res/drawable-mdpi/ic_pan_right_indicator_xlarge.pngbin0 -> 780 bytes
-rw-r--r--res/drawable-mdpi/ic_photoeditor_border.pngbin0 -> 819 bytes
-rw-r--r--res/drawable-mdpi/ic_photoeditor_color.pngbin0 -> 1355 bytes
-rw-r--r--res/drawable-mdpi/ic_photoeditor_effects.pngbin0 -> 1588 bytes
-rw-r--r--res/drawable-mdpi/ic_photoeditor_fix.pngbin0 -> 831 bytes
-rwxr-xr-xres/drawable-mdpi/ic_recording_indicator.pngbin0 -> 700 bytes
-rw-r--r--res/drawable-mdpi/ic_sce.pngbin0 -> 2052 bytes
-rw-r--r--res/drawable-mdpi/ic_sce_action.pngbin0 -> 2688 bytes
-rw-r--r--res/drawable-mdpi/ic_sce_night.pngbin0 -> 2188 bytes
-rw-r--r--res/drawable-mdpi/ic_sce_off.pngbin0 -> 2501 bytes
-rw-r--r--res/drawable-mdpi/ic_sce_party.pngbin0 -> 2544 bytes
-rw-r--r--res/drawable-mdpi/ic_sce_sunset.pngbin0 -> 2078 bytes
-rw-r--r--res/drawable-mdpi/ic_scn_holo_light.pngbin0 -> 752 bytes
-rw-r--r--res/drawable-mdpi/ic_scn_holo_light_xlarge.pngbin0 -> 1356 bytes
-rw-r--r--res/drawable-mdpi/ic_settings_holo_light.pngbin0 -> 2183 bytes
-rw-r--r--res/drawable-mdpi/ic_snapshot_border.9.pngbin0 -> 223 bytes
-rw-r--r--res/drawable-mdpi/ic_snapshot_border_xlarge.9.pngbin0 -> 299 bytes
-rw-r--r--res/drawable-mdpi/ic_switch_back.pngbin0 -> 2179 bytes
-rw-r--r--res/drawable-mdpi/ic_switch_camera.pngbin0 -> 2862 bytes
-rw-r--r--res/drawable-mdpi/ic_switch_front.pngbin0 -> 2512 bytes
-rw-r--r--res/drawable-mdpi/ic_switch_photo_facing_holo_light.pngbin0 -> 3086 bytes
-rw-r--r--res/drawable-mdpi/ic_switch_photo_facing_holo_light_xlarge.pngbin0 -> 1629 bytes
-rw-r--r--res/drawable-mdpi/ic_switch_photosphere.pngbin0 -> 4115 bytes
-rw-r--r--res/drawable-mdpi/ic_switch_video.pngbin0 -> 2145 bytes
-rw-r--r--res/drawable-mdpi/ic_switch_video_facing_holo_light.pngbin0 -> 2572 bytes
-rw-r--r--res/drawable-mdpi/ic_switch_video_facing_holo_light_xlarge.pngbin0 -> 1384 bytes
-rw-r--r--res/drawable-mdpi/ic_switcher_menu_indicator.pngbin0 -> 788 bytes
-rw-r--r--res/drawable-mdpi/ic_timelapse_none.pngbin0 -> 751 bytes
-rw-r--r--res/drawable-mdpi/ic_timelapse_none_xlarge.pngbin0 -> 1052 bytes
-rw-r--r--res/drawable-mdpi/ic_timer.pngbin0 -> 2171 bytes
-rw-r--r--res/drawable-mdpi/ic_vidcontrol_pause.pngbin0 -> 835 bytes
-rw-r--r--res/drawable-mdpi/ic_vidcontrol_play.pngbin0 -> 1027 bytes
-rw-r--r--res/drawable-mdpi/ic_vidcontrol_reload.pngbin0 -> 1208 bytes
-rw-r--r--res/drawable-mdpi/ic_video_effects_background_fields_of_wheat_holo.pngbin0 -> 237 bytes
-rw-r--r--res/drawable-mdpi/ic_video_effects_background_intergalactic_holo.pngbin0 -> 209 bytes
-rw-r--r--res/drawable-mdpi/ic_video_effects_background_normal_holo_dark.pngbin0 -> 195 bytes
-rw-r--r--res/drawable-mdpi/ic_video_effects_faces_big_eyes_holo_dark.pngbin0 -> 1075 bytes
-rw-r--r--res/drawable-mdpi/ic_video_effects_faces_big_mouth_holo_dark.pngbin0 -> 897 bytes
-rw-r--r--res/drawable-mdpi/ic_video_effects_faces_big_nose_holo_dark.pngbin0 -> 844 bytes
-rw-r--r--res/drawable-mdpi/ic_video_effects_faces_small_eyes_holo_dark.pngbin0 -> 735 bytes
-rw-r--r--res/drawable-mdpi/ic_video_effects_faces_small_mouth_holo_dark.pngbin0 -> 794 bytes
-rw-r--r--res/drawable-mdpi/ic_video_effects_faces_squeeze_holo_dark.pngbin0 -> 647 bytes
-rw-r--r--res/drawable-mdpi/ic_video_thumb.pngbin0 -> 644 bytes
-rw-r--r--res/drawable-mdpi/ic_view_photosphere.pngbin0 -> 7131 bytes
-rw-r--r--res/drawable-mdpi/ic_wb_auto.pngbin0 -> 2255 bytes
-rw-r--r--res/drawable-mdpi/ic_wb_cloudy.pngbin0 -> 1450 bytes
-rw-r--r--res/drawable-mdpi/ic_wb_fluorescent.pngbin0 -> 2346 bytes
-rw-r--r--res/drawable-mdpi/ic_wb_incandescent.pngbin0 -> 1946 bytes
-rw-r--r--res/drawable-mdpi/ic_wb_sunlight.pngbin0 -> 2580 bytes
-rw-r--r--res/drawable-mdpi/icn_media_pause_focused_holo_dark.pngbin0 -> 420 bytes
-rw-r--r--res/drawable-mdpi/icn_media_pause_normal_holo_dark.pngbin0 -> 367 bytes
-rw-r--r--res/drawable-mdpi/icn_media_pause_pressed_holo_dark.pngbin0 -> 857 bytes
-rw-r--r--res/drawable-mdpi/icn_media_play_focused_holo_dark.pngbin0 -> 956 bytes
-rw-r--r--res/drawable-mdpi/icn_media_play_normal_holo_dark.pngbin0 -> 1217 bytes
-rw-r--r--res/drawable-mdpi/icn_media_play_pressed_holo_dark.pngbin0 -> 1537 bytes
-rw-r--r--res/drawable-mdpi/list_divider.9.pngbin0 -> 78 bytes
-rw-r--r--res/drawable-mdpi/list_divider_holo_dark.9.pngbin0 -> 78 bytes
-rw-r--r--res/drawable-mdpi/list_pressed_holo_light.9.pngbin0 -> 158 bytes
-rw-r--r--res/drawable-mdpi/list_selector_background_selected.9.pngbin0 -> 562 bytes
-rw-r--r--res/drawable-mdpi/menu_dropdown_panel_holo_dark.9.pngbin0 -> 651 bytes
-rw-r--r--res/drawable-mdpi/on_screen_hint_frame.9.pngbin0 -> 2181 bytes
-rw-r--r--res/drawable-mdpi/overscroll_edge.pngbin0 -> 903 bytes
-rw-r--r--res/drawable-mdpi/overscroll_glow.pngbin0 -> 20055 bytes
-rw-r--r--res/drawable-mdpi/panel_undo_holo.9.pngbin0 -> 374 bytes
-rw-r--r--res/drawable-mdpi/placeholder_camera.pngbin0 -> 2013 bytes
-rw-r--r--res/drawable-mdpi/placeholder_empty.pngbin0 -> 2176 bytes
-rw-r--r--res/drawable-mdpi/placeholder_locked.pngbin0 -> 1460 bytes
-rw-r--r--res/drawable-mdpi/preview.pngbin0 -> 51248 bytes
-rw-r--r--res/drawable-mdpi/scrubber_knob.pngbin0 -> 2132 bytes
-rw-r--r--res/drawable-mdpi/spinner_76_inner_holo.pngbin0 -> 1846 bytes
-rw-r--r--res/drawable-mdpi/spinner_76_outer_holo.pngbin0 -> 1640 bytes
-rw-r--r--res/drawable-mdpi/switch_bg_focused_holo_dark.9.pngbin0 -> 216 bytes
-rw-r--r--res/drawable-mdpi/switch_bg_holo_dark.9.pngbin0 -> 163 bytes
-rw-r--r--res/drawable-mdpi/switch_thumb_activated_holo_dark.9.pngbin0 -> 351 bytes
-rw-r--r--res/drawable-mdpi/switch_thumb_disabled_holo_dark.9.pngbin0 -> 350 bytes
-rw-r--r--res/drawable-mdpi/switch_thumb_holo_dark.9.pngbin0 -> 362 bytes
-rw-r--r--res/drawable-mdpi/switch_thumb_pressed_holo_dark.9.pngbin0 -> 362 bytes
-rw-r--r--res/drawable-mdpi/text_select_handle_left.pngbin0 -> 1117 bytes
-rw-r--r--res/drawable-mdpi/text_select_handle_right.pngbin0 -> 1201 bytes
-rw-r--r--res/drawable-mdpi/toast_frame_holo.9.pngbin0 -> 1585 bytes
-rw-r--r--res/drawable-mdpi/wallpaper_picker_preview.pngbin0 -> 413757 bytes
-rw-r--r--res/drawable-nodpi/brush_marker.pngbin0 -> 19953 bytes
-rw-r--r--res/drawable-nodpi/brush_spatter.pngbin0 -> 16366 bytes
-rw-r--r--res/drawable-nodpi/filtershow_icon_vignette.pngbin0 -> 7235 bytes
-rw-r--r--res/drawable-nodpi/geometry_shadow.9.pngbin0 -> 4456 bytes
-rw-r--r--res/drawable-port-hdpi/btn_video_shutter_recording_holo_xlarge.pngbin0 -> 21860 bytes
-rw-r--r--res/drawable-port-hdpi/btn_video_shutter_recording_pressed_holo_xlarge.pngbin0 -> 26947 bytes
-rw-r--r--res/drawable-port-hdpi/switcher_bg.9.pngbin0 -> 487 bytes
-rw-r--r--res/drawable-port-mdpi/btn_video_shutter_recording_holo_xlarge.pngbin0 -> 14283 bytes
-rw-r--r--res/drawable-port-mdpi/btn_video_shutter_recording_pressed_holo_xlarge.pngbin0 -> 17375 bytes
-rw-r--r--res/drawable-port-mdpi/switcher_bg.9.pngbin0 -> 354 bytes
-rw-r--r--res/drawable-port-xhdpi/btn_video_shutter_recording_holo_xlarge.pngbin0 -> 37445 bytes
-rw-r--r--res/drawable-port-xhdpi/btn_video_shutter_recording_pressed_holo_xlarge.pngbin0 -> 44576 bytes
-rw-r--r--res/drawable-port-xhdpi/switcher_bg.9.pngbin0 -> 663 bytes
-rw-r--r--res/drawable-sw600dp-hdpi/btn_shutter_default.pngbin0 -> 16853 bytes
-rw-r--r--res/drawable-sw600dp-hdpi/btn_shutter_pressed.pngbin0 -> 18420 bytes
-rw-r--r--res/drawable-sw600dp-hdpi/btn_shutter_recording.pngbin0 -> 17642 bytes
-rw-r--r--res/drawable-sw600dp-hdpi/btn_shutter_video_default.pngbin0 -> 16418 bytes
-rw-r--r--res/drawable-sw600dp-hdpi/btn_shutter_video_pressed.pngbin0 -> 16701 bytes
-rw-r--r--res/drawable-sw600dp-hdpi/btn_shutter_video_recording.pngbin0 -> 17257 bytes
-rw-r--r--res/drawable-sw600dp-land-hdpi/switcher_bg.9.pngbin0 -> 3265 bytes
-rw-r--r--res/drawable-sw600dp-land-mdpi/switcher_bg.9.pngbin0 -> 1976 bytes
-rw-r--r--res/drawable-sw600dp-land-xhdpi/switcher_bg.9.pngbin0 -> 4807 bytes
-rw-r--r--res/drawable-sw600dp-mdpi/btn_shutter_default.pngbin0 -> 9471 bytes
-rw-r--r--res/drawable-sw600dp-mdpi/btn_shutter_pressed.pngbin0 -> 10231 bytes
-rw-r--r--res/drawable-sw600dp-mdpi/btn_shutter_recording.pngbin0 -> 9955 bytes
-rw-r--r--res/drawable-sw600dp-mdpi/btn_shutter_video_default.pngbin0 -> 9145 bytes
-rw-r--r--res/drawable-sw600dp-mdpi/btn_shutter_video_pressed.pngbin0 -> 9250 bytes
-rw-r--r--res/drawable-sw600dp-mdpi/btn_shutter_video_recording.pngbin0 -> 9706 bytes
-rw-r--r--res/drawable-sw600dp-port-hdpi/switcher_bg.9.pngbin0 -> 4640 bytes
-rw-r--r--res/drawable-sw600dp-port-mdpi/switcher_bg.9.pngbin0 -> 2607 bytes
-rw-r--r--res/drawable-sw600dp-port-xhdpi/switcher_bg.9.pngbin0 -> 6972 bytes
-rw-r--r--res/drawable-sw600dp-xhdpi/btn_shutter_default.pngbin0 -> 26114 bytes
-rw-r--r--res/drawable-sw600dp-xhdpi/btn_shutter_pressed.pngbin0 -> 27298 bytes
-rw-r--r--res/drawable-sw600dp-xhdpi/btn_shutter_recording.pngbin0 -> 27478 bytes
-rw-r--r--res/drawable-sw600dp-xhdpi/btn_shutter_video_default.pngbin0 -> 25502 bytes
-rw-r--r--res/drawable-sw600dp-xhdpi/btn_shutter_video_pressed.pngbin0 -> 24552 bytes
-rw-r--r--res/drawable-sw600dp-xhdpi/btn_shutter_video_recording.pngbin0 -> 26791 bytes
-rw-r--r--res/drawable-sw600dp/bg_vidcontrol.pngbin0 -> 9346 bytes
-rw-r--r--res/drawable-sw600dp/ic_pan_thumb.9.pngbin0 -> 303 bytes
-rw-r--r--res/drawable-sw600dp/ic_vidcontrol_pause.pngbin0 -> 1091 bytes
-rw-r--r--res/drawable-sw600dp/ic_vidcontrol_play.pngbin0 -> 1498 bytes
-rw-r--r--res/drawable-sw600dp/ic_vidcontrol_reload.pngbin0 -> 1940 bytes
-rw-r--r--res/drawable-sw600dp/ic_video_thumb.pngbin0 -> 812 bytes
-rw-r--r--res/drawable-sw600dp/scrubber_knob.pngbin0 -> 2958 bytes
-rw-r--r--res/drawable-xhdpi/actionbar_translucent.9.pngbin0 -> 161 bytes
-rw-r--r--res/drawable-xhdpi/bg_vidcontrol.pngbin0 -> 14666 bytes
-rw-r--r--res/drawable-xhdpi/btn_shutter_default.pngbin0 -> 13989 bytes
-rw-r--r--res/drawable-xhdpi/btn_shutter_pressed.pngbin0 -> 14954 bytes
-rw-r--r--res/drawable-xhdpi/btn_shutter_recording.pngbin0 -> 14425 bytes
-rw-r--r--res/drawable-xhdpi/btn_shutter_video_default.pngbin0 -> 13510 bytes
-rw-r--r--res/drawable-xhdpi/btn_shutter_video_pressed.pngbin0 -> 13549 bytes
-rw-r--r--res/drawable-xhdpi/btn_shutter_video_recording.pngbin0 -> 14285 bytes
-rw-r--r--res/drawable-xhdpi/btn_video_shutter_recording_holo.pngbin0 -> 13519 bytes
-rw-r--r--res/drawable-xhdpi/btn_video_shutter_recording_pressed_holo.pngbin0 -> 18802 bytes
-rw-r--r--res/drawable-xhdpi/camera_crop.pngbin0 -> 2400 bytes
-rw-r--r--res/drawable-xhdpi/capture_thumbnail_shadow.9.pngbin0 -> 1577 bytes
-rw-r--r--res/drawable-xhdpi/dialog_full_holo_dark.9.pngbin0 -> 2159 bytes
-rw-r--r--res/drawable-xhdpi/dropdown_ic_arrow_normal_holo_dark.pngbin0 -> 810 bytes
-rw-r--r--res/drawable-xhdpi/filtershow_button_colors_curve.pngbin0 -> 2047 bytes
-rw-r--r--res/drawable-xhdpi/filtershow_button_colors_sharpen.pngbin0 -> 818 bytes
-rw-r--r--res/drawable-xhdpi/filtershow_button_grad.pngbin0 -> 1920 bytes
-rw-r--r--res/drawable-xhdpi/filtershow_button_redo.pngbin0 -> 785 bytes
-rw-r--r--res/drawable-xhdpi/filtershow_button_undo.pngbin0 -> 575 bytes
-rw-r--r--res/drawable-xhdpi/filtershow_scrubber_control_disabled.pngbin0 -> 3731 bytes
-rw-r--r--res/drawable-xhdpi/filtershow_scrubber_control_focused.pngbin0 -> 4071 bytes
-rw-r--r--res/drawable-xhdpi/filtershow_scrubber_control_normal.pngbin0 -> 4337 bytes
-rw-r--r--res/drawable-xhdpi/filtershow_scrubber_control_pressed.pngbin0 -> 4867 bytes
-rw-r--r--res/drawable-xhdpi/filtershow_scrubber_primary.9.pngbin0 -> 2874 bytes
-rw-r--r--res/drawable-xhdpi/filtershow_scrubber_secondary.9.pngbin0 -> 2866 bytes
-rw-r--r--res/drawable-xhdpi/filtershow_scrubber_track.9.pngbin0 -> 174 bytes
-rw-r--r--res/drawable-xhdpi/frame_overlay_gallery_camera.pngbin0 -> 1284 bytes
-rw-r--r--res/drawable-xhdpi/frame_overlay_gallery_folder.pngbin0 -> 1026 bytes
-rw-r--r--res/drawable-xhdpi/frame_overlay_gallery_picasa.pngbin0 -> 1976 bytes
-rw-r--r--res/drawable-xhdpi/grid_pressed.9.pngbin0 -> 246 bytes
-rw-r--r--res/drawable-xhdpi/grid_selected.9.pngbin0 -> 246 bytes
-rw-r--r--res/drawable-xhdpi/ic_360pano_holo_light.pngbin0 -> 2706 bytes
-rw-r--r--res/drawable-xhdpi/ic_btn_shutter_retake.pngbin0 -> 1940 bytes
-rw-r--r--res/drawable-xhdpi/ic_cameraalbum_overlay.pngbin0 -> 7705 bytes
-rw-r--r--res/drawable-xhdpi/ic_effects_holo_light.pngbin0 -> 1131 bytes
-rw-r--r--res/drawable-xhdpi/ic_effects_holo_light_xlarge.pngbin0 -> 2500 bytes
-rw-r--r--res/drawable-xhdpi/ic_exposure_0.pngbin0 -> 2253 bytes
-rw-r--r--res/drawable-xhdpi/ic_exposure_holo_light.pngbin0 -> 5936 bytes
-rw-r--r--res/drawable-xhdpi/ic_exposure_n1.pngbin0 -> 1881 bytes
-rw-r--r--res/drawable-xhdpi/ic_exposure_n2.pngbin0 -> 2993 bytes
-rw-r--r--res/drawable-xhdpi/ic_exposure_n3.pngbin0 -> 3206 bytes
-rw-r--r--res/drawable-xhdpi/ic_exposure_p1.pngbin0 -> 2414 bytes
-rw-r--r--res/drawable-xhdpi/ic_exposure_p2.pngbin0 -> 3524 bytes
-rw-r--r--res/drawable-xhdpi/ic_exposure_p3.pngbin0 -> 3701 bytes
-rw-r--r--res/drawable-xhdpi/ic_flash_auto_holo_light.pngbin0 -> 4835 bytes
-rw-r--r--res/drawable-xhdpi/ic_flash_off_holo_light.pngbin0 -> 5010 bytes
-rw-r--r--res/drawable-xhdpi/ic_flash_on_holo_light.pngbin0 -> 3501 bytes
-rw-r--r--res/drawable-xhdpi/ic_gallery_play.pngbin0 -> 5610 bytes
-rw-r--r--res/drawable-xhdpi/ic_gallery_play_big.pngbin0 -> 9484 bytes
-rw-r--r--res/drawable-xhdpi/ic_grad_add.pngbin0 -> 5964 bytes
-rw-r--r--res/drawable-xhdpi/ic_grad_del.pngbin0 -> 3313 bytes
-rw-r--r--res/drawable-xhdpi/ic_hdr.pngbin0 -> 4022 bytes
-rw-r--r--res/drawable-xhdpi/ic_hdr_off.pngbin0 -> 5860 bytes
-rw-r--r--res/drawable-xhdpi/ic_imagesize.pngbin0 -> 2560 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_ev_0.pngbin0 -> 1970 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_ev_n1.pngbin0 -> 2075 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_ev_n2.pngbin0 -> 2935 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_ev_n3.pngbin0 -> 3154 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_ev_p1.pngbin0 -> 2461 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_ev_p2.pngbin0 -> 3353 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_ev_p3.pngbin0 -> 3545 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_flash_auto.pngbin0 -> 3626 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_flash_off.pngbin0 -> 2107 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_flash_on.pngbin0 -> 2822 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_loc_off.pngbin0 -> 3845 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_loc_on.pngbin0 -> 2492 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_sce_hdr.pngbin0 -> 2941 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_sce_off.pngbin0 -> 1865 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_sce_on.pngbin0 -> 3688 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_timer_off.pngbin0 -> 2483 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_timer_on.pngbin0 -> 3381 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_wb_cloudy.pngbin0 -> 2374 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_wb_daylight.pngbin0 -> 4102 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_wb_fluorescent.pngbin0 -> 3379 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_wb_off.pngbin0 -> 2006 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_wb_tungsten.pngbin0 -> 2676 bytes
-rw-r--r--res/drawable-xhdpi/ic_location.pngbin0 -> 3712 bytes
-rw-r--r--res/drawable-xhdpi/ic_location_off.pngbin0 -> 4792 bytes
-rw-r--r--res/drawable-xhdpi/ic_menu_cancel_holo_light.pngbin0 -> 4121 bytes
-rw-r--r--res/drawable-xhdpi/ic_menu_done_holo_light.pngbin0 -> 3784 bytes
-rw-r--r--res/drawable-xhdpi/ic_menu_edit_holo_dark.pngbin0 -> 2303 bytes
-rw-r--r--res/drawable-xhdpi/ic_menu_make_offline.pngbin0 -> 1172 bytes
-rw-r--r--res/drawable-xhdpi/ic_menu_revert_holo_dark.pngbin0 -> 575 bytes
-rw-r--r--res/drawable-xhdpi/ic_menu_savephoto.pngbin0 -> 2429 bytes
-rwxr-xr-xres/drawable-xhdpi/ic_menu_savephoto_disabled.pngbin0 -> 1912 bytes
-rw-r--r--res/drawable-xhdpi/ic_menu_tiny_planet.pngbin0 -> 3386 bytes
-rw-r--r--res/drawable-xhdpi/ic_pan_border_fast.9.pngbin0 -> 611 bytes
-rw-r--r--res/drawable-xhdpi/ic_pan_border_fast_xlarge.9.pngbin0 -> 1362 bytes
-rw-r--r--res/drawable-xhdpi/ic_pan_left_indicator.pngbin0 -> 663 bytes
-rw-r--r--res/drawable-xhdpi/ic_pan_left_indicator_fast.pngbin0 -> 667 bytes
-rw-r--r--res/drawable-xhdpi/ic_pan_left_indicator_fast_xlarge.pngbin0 -> 1275 bytes
-rw-r--r--res/drawable-xhdpi/ic_pan_left_indicator_xlarge.pngbin0 -> 1285 bytes
-rw-r--r--res/drawable-xhdpi/ic_pan_progression.pngbin0 -> 2177 bytes
-rw-r--r--res/drawable-xhdpi/ic_pan_progression_xlarge.pngbin0 -> 3692 bytes
-rw-r--r--res/drawable-xhdpi/ic_pan_right_indicator.pngbin0 -> 663 bytes
-rw-r--r--res/drawable-xhdpi/ic_pan_right_indicator_fast.pngbin0 -> 659 bytes
-rw-r--r--res/drawable-xhdpi/ic_pan_right_indicator_fast_xlarge.pngbin0 -> 1239 bytes
-rw-r--r--res/drawable-xhdpi/ic_pan_right_indicator_xlarge.pngbin0 -> 1261 bytes
-rw-r--r--res/drawable-xhdpi/ic_photoeditor_border.pngbin0 -> 823 bytes
-rw-r--r--res/drawable-xhdpi/ic_photoeditor_color.pngbin0 -> 2286 bytes
-rw-r--r--res/drawable-xhdpi/ic_photoeditor_effects.pngbin0 -> 2824 bytes
-rw-r--r--res/drawable-xhdpi/ic_photoeditor_fix.pngbin0 -> 899 bytes
-rw-r--r--res/drawable-xhdpi/ic_recording_indicator.pngbin0 -> 574 bytes
-rw-r--r--res/drawable-xhdpi/ic_sce.pngbin0 -> 4808 bytes
-rw-r--r--res/drawable-xhdpi/ic_sce_action.pngbin0 -> 6537 bytes
-rw-r--r--res/drawable-xhdpi/ic_sce_night.pngbin0 -> 4969 bytes
-rw-r--r--res/drawable-xhdpi/ic_sce_off.pngbin0 -> 6262 bytes
-rw-r--r--res/drawable-xhdpi/ic_sce_party.pngbin0 -> 6658 bytes
-rw-r--r--res/drawable-xhdpi/ic_sce_sunset.pngbin0 -> 4676 bytes
-rw-r--r--res/drawable-xhdpi/ic_scn_holo_light.pngbin0 -> 1413 bytes
-rw-r--r--res/drawable-xhdpi/ic_scn_holo_light_xlarge.pngbin0 -> 3281 bytes
-rw-r--r--res/drawable-xhdpi/ic_settings_holo_light.pngbin0 -> 4174 bytes
-rw-r--r--res/drawable-xhdpi/ic_snapshot_border.9.pngbin0 -> 257 bytes
-rw-r--r--res/drawable-xhdpi/ic_snapshot_border_xlarge.9.pngbin0 -> 419 bytes
-rw-r--r--res/drawable-xhdpi/ic_switch_back.pngbin0 -> 4913 bytes
-rw-r--r--res/drawable-xhdpi/ic_switch_camera.pngbin0 -> 6819 bytes
-rw-r--r--res/drawable-xhdpi/ic_switch_front.pngbin0 -> 5638 bytes
-rw-r--r--res/drawable-xhdpi/ic_switch_photo_facing_holo_light.pngbin0 -> 7228 bytes
-rw-r--r--res/drawable-xhdpi/ic_switch_photo_facing_holo_light_xlarge.pngbin0 -> 3728 bytes
-rw-r--r--res/drawable-xhdpi/ic_switch_photosphere.pngbin0 -> 10581 bytes
-rw-r--r--res/drawable-xhdpi/ic_switch_refocus.pngbin0 -> 833 bytes
-rw-r--r--res/drawable-xhdpi/ic_switch_video.pngbin0 -> 5016 bytes
-rw-r--r--res/drawable-xhdpi/ic_switch_video_facing_holo_light.pngbin0 -> 5719 bytes
-rw-r--r--res/drawable-xhdpi/ic_switch_video_facing_holo_light_xlarge.pngbin0 -> 3126 bytes
-rw-r--r--res/drawable-xhdpi/ic_switcher_menu_indicator.pngbin0 -> 1314 bytes
-rw-r--r--res/drawable-xhdpi/ic_timelapse_none.pngbin0 -> 1339 bytes
-rw-r--r--res/drawable-xhdpi/ic_timelapse_none_xlarge.pngbin0 -> 1986 bytes
-rw-r--r--res/drawable-xhdpi/ic_timer.pngbin0 -> 4636 bytes
-rw-r--r--res/drawable-xhdpi/ic_vidcontrol_pause.pngbin0 -> 1394 bytes
-rw-r--r--res/drawable-xhdpi/ic_vidcontrol_play.pngbin0 -> 2027 bytes
-rw-r--r--res/drawable-xhdpi/ic_vidcontrol_reload.pngbin0 -> 2694 bytes
-rw-r--r--res/drawable-xhdpi/ic_video_effects_background_fields_of_wheat_holo.pngbin0 -> 499 bytes
-rw-r--r--res/drawable-xhdpi/ic_video_effects_background_intergalactic_holo.pngbin0 -> 447 bytes
-rw-r--r--res/drawable-xhdpi/ic_video_effects_background_normal_holo_dark.pngbin0 -> 364 bytes
-rw-r--r--res/drawable-xhdpi/ic_video_effects_faces_big_eyes_holo_dark.pngbin0 -> 2174 bytes
-rw-r--r--res/drawable-xhdpi/ic_video_effects_faces_big_mouth_holo_dark.pngbin0 -> 1623 bytes
-rw-r--r--res/drawable-xhdpi/ic_video_effects_faces_big_nose_holo_dark.pngbin0 -> 1542 bytes
-rw-r--r--res/drawable-xhdpi/ic_video_effects_faces_small_eyes_holo_dark.pngbin0 -> 1210 bytes
-rw-r--r--res/drawable-xhdpi/ic_video_effects_faces_small_mouth_holo_dark.pngbin0 -> 1421 bytes
-rw-r--r--res/drawable-xhdpi/ic_video_effects_faces_squeeze_holo_dark.pngbin0 -> 1001 bytes
-rw-r--r--res/drawable-xhdpi/ic_video_thumb.pngbin0 -> 902 bytes
-rw-r--r--res/drawable-xhdpi/ic_view_photosphere.pngbin0 -> 17191 bytes
-rw-r--r--res/drawable-xhdpi/ic_wb_auto.pngbin0 -> 4973 bytes
-rw-r--r--res/drawable-xhdpi/ic_wb_cloudy.pngbin0 -> 2868 bytes
-rw-r--r--res/drawable-xhdpi/ic_wb_fluorescent.pngbin0 -> 5057 bytes
-rw-r--r--res/drawable-xhdpi/ic_wb_incandescent.pngbin0 -> 4287 bytes
-rw-r--r--res/drawable-xhdpi/ic_wb_sunlight.pngbin0 -> 6350 bytes
-rw-r--r--res/drawable-xhdpi/list_divider.9.pngbin0 -> 83 bytes
-rw-r--r--res/drawable-xhdpi/list_divider_holo_dark.9.pngbin0 -> 83 bytes
-rw-r--r--res/drawable-xhdpi/list_pressed_holo_light.9.pngbin0 -> 163 bytes
-rw-r--r--res/drawable-xhdpi/list_selector_background_selected.9.pngbin0 -> 985 bytes
-rw-r--r--res/drawable-xhdpi/menu_dropdown_panel_holo_dark.9.pngbin0 -> 1362 bytes
-rw-r--r--res/drawable-xhdpi/overscroll_edge.pngbin0 -> 1889 bytes
-rw-r--r--res/drawable-xhdpi/overscroll_glow.pngbin0 -> 50899 bytes
-rw-r--r--res/drawable-xhdpi/panel_undo_holo.9.pngbin0 -> 814 bytes
-rw-r--r--res/drawable-xhdpi/placeholder_camera.pngbin0 -> 4055 bytes
-rw-r--r--res/drawable-xhdpi/placeholder_empty.pngbin0 -> 2942 bytes
-rw-r--r--res/drawable-xhdpi/placeholder_locked.pngbin0 -> 3029 bytes
-rw-r--r--res/drawable-xhdpi/preview.pngbin0 -> 83662 bytes
-rw-r--r--res/drawable-xhdpi/scrubber_knob.pngbin0 -> 2202 bytes
-rw-r--r--res/drawable-xhdpi/spinner_76_inner_holo.pngbin0 -> 4116 bytes
-rw-r--r--res/drawable-xhdpi/spinner_76_outer_holo.pngbin0 -> 3726 bytes
-rw-r--r--res/drawable-xhdpi/switch_bg_focused_holo_dark.9.pngbin0 -> 285 bytes
-rw-r--r--res/drawable-xhdpi/switch_bg_holo_dark.9.pngbin0 -> 229 bytes
-rw-r--r--res/drawable-xhdpi/switch_thumb_activated_holo_dark.9.pngbin0 -> 653 bytes
-rw-r--r--res/drawable-xhdpi/switch_thumb_disabled_holo_dark.9.pngbin0 -> 633 bytes
-rw-r--r--res/drawable-xhdpi/switch_thumb_holo_dark.9.pngbin0 -> 687 bytes
-rw-r--r--res/drawable-xhdpi/switch_thumb_pressed_holo_dark.9.pngbin0 -> 660 bytes
-rw-r--r--res/drawable-xhdpi/text_select_handle_left.pngbin0 -> 2239 bytes
-rw-r--r--res/drawable-xhdpi/text_select_handle_right.pngbin0 -> 2373 bytes
-rw-r--r--res/drawable-xhdpi/toast_frame_holo.9.pngbin0 -> 1585 bytes
-rw-r--r--res/drawable/action_bar_two_line_background.xml21
-rw-r--r--res/drawable/bg_pressed.xml20
-rw-r--r--res/drawable/bg_pressed_exit_fading.xml21
-rw-r--r--res/drawable/bg_text_on_preview.xml21
-rw-r--r--res/drawable/border_photo_frame_widget.xml22
-rw-r--r--res/drawable/btn_new_shutter.xml21
-rw-r--r--res/drawable/btn_new_shutter_video.xml21
-rw-r--r--res/drawable/btn_shutter_video_recording.xml21
-rw-r--r--res/drawable/filtershow_addpoint.pngbin0 -> 5073 bytes
-rw-r--r--res/drawable/filtershow_background.pngbin0 -> 1863 bytes
-rw-r--r--res/drawable/filtershow_border_4x5.9.pngbin0 -> 300783 bytes
-rwxr-xr-xres/drawable/filtershow_border_black.9.pngbin0 -> 688 bytes
-rw-r--r--res/drawable/filtershow_border_brush.9.pngbin0 -> 618721 bytes
-rwxr-xr-xres/drawable/filtershow_border_film.pngbin0 -> 36176 bytes
-rw-r--r--res/drawable/filtershow_border_grunge.9.pngbin0 -> 86589 bytes
-rwxr-xr-xres/drawable/filtershow_border_rounded_black.9.pngbin0 -> 1113 bytes
-rwxr-xr-xres/drawable/filtershow_border_rounded_white.9.pngbin0 -> 1219 bytes
-rw-r--r--res/drawable/filtershow_border_sumi_e.9.pngbin0 -> 45106 bytes
-rw-r--r--res/drawable/filtershow_border_tape.9.pngbin0 -> 216055 bytes
-rwxr-xr-xres/drawable/filtershow_border_white.9.pngbin0 -> 687 bytes
-rw-r--r--res/drawable/filtershow_button_background.xml8
-rw-r--r--res/drawable/filtershow_button_border.pngbin0 -> 1021 bytes
-rw-r--r--res/drawable/filtershow_button_colors.pngbin0 -> 1277 bytes
-rw-r--r--res/drawable/filtershow_button_colors_contrast.pngbin0 -> 1218 bytes
-rw-r--r--res/drawable/filtershow_button_colors_vignette.pngbin0 -> 2147 bytes
-rw-r--r--res/drawable/filtershow_button_current.pngbin0 -> 1355 bytes
-rw-r--r--res/drawable/filtershow_button_fx.pngbin0 -> 1115 bytes
-rw-r--r--res/drawable/filtershow_button_geometry.pngbin0 -> 975 bytes
-rw-r--r--res/drawable/filtershow_button_geometry_crop.pngbin0 -> 999 bytes
-rw-r--r--res/drawable/filtershow_button_geometry_flip.pngbin0 -> 1809 bytes
-rw-r--r--res/drawable/filtershow_button_geometry_rotate.pngbin0 -> 2185 bytes
-rw-r--r--res/drawable/filtershow_button_geometry_straighten.pngbin0 -> 3104 bytes
-rw-r--r--res/drawable/filtershow_button_operations.pngbin0 -> 1270 bytes
-rw-r--r--res/drawable/filtershow_button_origin.pngbin0 -> 1069 bytes
-rw-r--r--res/drawable/filtershow_button_redo.pngbin0 -> 964 bytes
-rw-r--r--res/drawable/filtershow_button_selected_background.9.pngbin0 -> 2885 bytes
-rw-r--r--res/drawable/filtershow_button_settings.pngbin0 -> 1062 bytes
-rw-r--r--res/drawable/filtershow_button_show_original.pngbin0 -> 1738 bytes
-rw-r--r--res/drawable/filtershow_button_undo.pngbin0 -> 965 bytes
-rw-r--r--res/drawable/filtershow_color_picker_circle.xml24
-rw-r--r--res/drawable/filtershow_color_picker_roundrect.xml25
-rw-r--r--res/drawable/filtershow_delpoint.pngbin0 -> 4657 bytes
-rw-r--r--res/drawable/filtershow_drawing.pngbin0 -> 1277 bytes
-rw-r--r--res/drawable/filtershow_fx_0000_vintage.pngbin0 -> 11635 bytes
-rw-r--r--res/drawable/filtershow_fx_0001_instant.pngbin0 -> 11179 bytes
-rw-r--r--res/drawable/filtershow_fx_0002_bleach.pngbin0 -> 12263 bytes
-rw-r--r--res/drawable/filtershow_fx_0003_blue_crush.pngbin0 -> 11417 bytes
-rw-r--r--res/drawable/filtershow_fx_0004_bw_contrast.pngbin0 -> 4389 bytes
-rw-r--r--res/drawable/filtershow_fx_0005_punch.pngbin0 -> 11338 bytes
-rw-r--r--res/drawable/filtershow_fx_0006_x_process.pngbin0 -> 8548 bytes
-rw-r--r--res/drawable/filtershow_fx_0007_washout.pngbin0 -> 5907 bytes
-rw-r--r--res/drawable/filtershow_fx_0008_washout_color.pngbin0 -> 11387 bytes
-rw-r--r--res/drawable/filtershow_grad_button.xml23
-rw-r--r--res/drawable/filtershow_menu_marker.pngbin0 -> 1164 bytes
-rw-r--r--res/drawable/filtershow_scrubber.xml22
-rw-r--r--res/drawable/filtershow_slider.xml28
-rw-r--r--res/drawable/filtershow_state_button_background0
-rw-r--r--res/drawable/filtershow_tiled_background.xml21
-rw-r--r--res/drawable/filtershow_vertical_bar.pngbin0 -> 148 bytes
-rw-r--r--res/drawable/filtershow_vertical_line.xml22
-rw-r--r--res/drawable/icn_media_pause.xml23
-rw-r--r--res/drawable/icn_media_play.xml23
-rw-r--r--res/drawable/ingest_item_list_selector.xml23
-rw-r--r--res/drawable/menu_save_photo.xml20
-rw-r--r--res/drawable/photoeditor_effect_redeye.pngbin0 -> 1799 bytes
-rw-r--r--res/drawable/photopage_bottom_button_background.xml5
-rw-r--r--res/drawable/setting_picker.xml21
-rw-r--r--res/drawable/switch_inner_holo_dark.xml22
-rw-r--r--res/drawable/switch_track_holo_dark.xml20
-rw-r--r--res/drawable/transparent_button_background.xml6
-rw-r--r--res/drawable/white_text_bg_gradient.xml22
-rw-r--r--res/interpolator/decelerate_cubic.xml17
-rw-r--r--res/interpolator/decelerate_quint.xml17
-rw-r--r--res/layout-land/camera_controls.xml69
-rw-r--r--res/layout-land/filtershow_activity.xml85
-rw-r--r--res/layout-land/filtershow_category_panel_new.xml32
-rw-r--r--res/layout-land/filtershow_editor_panel.xml127
-rw-r--r--res/layout-land/filtershow_main_panel.xml98
-rw-r--r--res/layout-land/filtershow_state_panel_new.xml33
-rw-r--r--res/layout-land/keyguard_widget.xml63
-rw-r--r--res/layout-land/on_screen_hint.xml29
-rw-r--r--res/layout-land/review_module_control.xml48
-rw-r--r--res/layout-land/switcher_popup.xml28
-rw-r--r--res/layout-port/camera_controls.xml69
-rw-r--r--res/layout-port/keyguard_widget.xml60
-rw-r--r--res/layout-port/on_screen_hint.xml31
-rw-r--r--res/layout-port/review_module_control.xml48
-rw-r--r--res/layout-port/switcher_popup.xml28
-rw-r--r--res/layout/action_bar_text.xml28
-rw-r--r--res/layout/action_bar_two_line_text.xml42
-rw-r--r--res/layout/action_mode.xml48
-rw-r--r--res/layout/album_content.xml57
-rw-r--r--res/layout/album_header.xml54
-rw-r--r--res/layout/album_set_item.xml39
-rw-r--r--res/layout/appwidget_loading_item.xml30
-rw-r--r--res/layout/appwidget_main.xml42
-rw-r--r--res/layout/appwidget_photo_item.xml27
-rw-r--r--res/layout/bg_replacement_training_message.xml56
-rw-r--r--res/layout/camera.xml21
-rw-r--r--res/layout/camera_filmstrip.xml41
-rw-r--r--res/layout/choose_widget_type.xml54
-rw-r--r--res/layout/count_down_to_capture.xml35
-rw-r--r--res/layout/countdown_setting_popup.xml101
-rw-r--r--res/layout/crop_activity.xml55
-rw-r--r--res/layout/cropimage.xml21
-rw-r--r--res/layout/details.xml23
-rw-r--r--res/layout/details_list.xml22
-rw-r--r--res/layout/dialog_picker.xml38
-rw-r--r--res/layout/editor_grad_button.xml48
-rw-r--r--res/layout/effect_setting_item.xml29
-rw-r--r--res/layout/effect_setting_popup.xml68
-rw-r--r--res/layout/face_view.xml19
-rw-r--r--res/layout/filtershow_actionbar.xml27
-rw-r--r--res/layout/filtershow_activity.xml87
-rw-r--r--res/layout/filtershow_category_panel.xml62
-rw-r--r--res/layout/filtershow_category_panel_new.xml41
-rw-r--r--res/layout/filtershow_color_gird.xml203
-rw-r--r--res/layout/filtershow_color_picker.xml58
-rw-r--r--res/layout/filtershow_control_action_slider.xml55
-rw-r--r--res/layout/filtershow_control_style_chooser.xml37
-rw-r--r--res/layout/filtershow_control_title_slider.xml43
-rw-r--r--res/layout/filtershow_cp_custom_title.xml26
-rw-r--r--res/layout/filtershow_crop_button.xml27
-rw-r--r--res/layout/filtershow_curves_button.xml27
-rw-r--r--res/layout/filtershow_default_editor.xml30
-rw-r--r--res/layout/filtershow_draw_button.xml27
-rw-r--r--res/layout/filtershow_draw_size.xml36
-rw-r--r--res/layout/filtershow_editor_panel.xml117
-rw-r--r--res/layout/filtershow_export_dialog.xml80
-rw-r--r--res/layout/filtershow_grad_editor.xml29
-rw-r--r--res/layout/filtershow_history_operation_row.xml47
-rw-r--r--res/layout/filtershow_history_panel.xml64
-rw-r--r--res/layout/filtershow_main_panel.xml102
-rw-r--r--res/layout/filtershow_presets_management_dialog.xml66
-rw-r--r--res/layout/filtershow_presets_management_row.xml51
-rw-r--r--res/layout/filtershow_seekbar.xml31
-rw-r--r--res/layout/filtershow_state_panel.xml45
-rw-r--r--res/layout/filtershow_state_panel_new.xml32
-rw-r--r--res/layout/filtershow_tiny_planet_editor.xml30
-rw-r--r--res/layout/filtershow_vignette_editor.xml30
-rw-r--r--res/layout/filtershow_zoom_editor.xml30
-rw-r--r--res/layout/gl_root_group.xml26
-rw-r--r--res/layout/in_line_setting_check_box.xml31
-rw-r--r--res/layout/in_line_setting_menu.xml27
-rw-r--r--res/layout/ingest_activity_item_list.xml59
-rw-r--r--res/layout/ingest_date_tile.xml63
-rw-r--r--res/layout/ingest_fullsize.xml43
-rw-r--r--res/layout/ingest_thumbnail.xml22
-rw-r--r--res/layout/list_pref_setting_popup.xml41
-rw-r--r--res/layout/main.xml20
-rw-r--r--res/layout/manage_offline_bar.xml61
-rw-r--r--res/layout/menu_indicators.xml57
-rw-r--r--res/layout/menu_indicators_keyguard.xml57
-rw-r--r--res/layout/more_setting_popup.xml26
-rw-r--r--res/layout/movie_view.xml27
-rw-r--r--res/layout/multigrid_content.xml57
-rwxr-xr-xres/layout/photo_frame.xml32
-rw-r--r--res/layout/photo_module.xml51
-rw-r--r--res/layout/photo_set_item.xml14
-rw-r--r--res/layout/photopage_bottom_controls.xml50
-rw-r--r--res/layout/photopage_progress_bar.xml40
-rw-r--r--res/layout/popup_list_item.xml28
-rw-r--r--res/layout/rotate_dialog.xml110
-rw-r--r--res/layout/rotate_text_toast.xml39
-rw-r--r--res/layout/secure_album_placeholder.xml23
-rw-r--r--res/layout/setting_item.xml27
-rw-r--r--res/layout/time_interval_picker.xml65
-rw-r--r--res/layout/time_interval_popup.xml87
-rw-r--r--res/layout/trim_menu.xml32
-rw-r--r--res/layout/trim_view.xml27
-rw-r--r--res/layout/undo_bar.xml31
-rw-r--r--res/layout/video_module.xml53
-rw-r--r--res/layout/viewfinder_labels_video.xml31
-rw-r--r--res/menu/album.xml31
-rw-r--r--res/menu/albumset.xml37
-rw-r--r--res/menu/crop.xml25
-rw-r--r--res/menu/filterby.xml23
-rw-r--r--res/menu/filtershow_activity_menu.xml37
-rw-r--r--res/menu/filtershow_menu_chan_sat.xml43
-rw-r--r--res/menu/filtershow_menu_crop.xml35
-rw-r--r--res/menu/filtershow_menu_curves.xml18
-rw-r--r--res/menu/filtershow_menu_draw.xml41
-rw-r--r--res/menu/filtershow_menu_grad.xml27
-rw-r--r--res/menu/gallery.xml23
-rw-r--r--res/menu/gallery_multiselect.xml33
-rw-r--r--res/menu/groupby.xml29
-rw-r--r--res/menu/ingest_menu_item_list_selection.xml22
-rw-r--r--res/menu/movie.xml23
-rw-r--r--res/menu/operation.xml73
-rw-r--r--res/menu/photo.xml78
-rw-r--r--res/menu/pickup.xml20
-rw-r--r--res/menu/settings.xml21
-rw-r--r--res/mipmap-hdpi/ic_launcher_camera.pngbin0 -> 9395 bytes
-rw-r--r--res/mipmap-hdpi/ic_launcher_gallery.pngbin0 -> 20425 bytes
-rw-r--r--res/mipmap-hdpi/ic_launcher_video_camera.pngbin0 -> 7051 bytes
-rw-r--r--res/mipmap-mdpi/ic_launcher_camera.pngbin0 -> 4954 bytes
-rw-r--r--res/mipmap-mdpi/ic_launcher_gallery.pngbin0 -> 17130 bytes
-rw-r--r--res/mipmap-mdpi/ic_launcher_video_camera.pngbin0 -> 3482 bytes
-rw-r--r--res/mipmap-xhdpi/ic_launcher_camera.pngbin0 -> 14455 bytes
-rw-r--r--res/mipmap-xhdpi/ic_launcher_gallery.pngbin0 -> 24283 bytes
-rw-r--r--res/mipmap-xxhdpi/ic_launcher_camera.pngbin0 -> 28169 bytes
-rw-r--r--res/raw/backdropper.graph91
-rw-r--r--res/raw/beep_once.oggbin0 -> 6656 bytes
-rw-r--r--res/raw/beep_twice.oggbin0 -> 6979 bytes
-rw-r--r--res/raw/blank.jpgbin0 -> 1954 bytes
-rw-r--r--res/raw/focus_complete.oggbin0 -> 9376 bytes
-rw-r--r--res/raw/goofy_face.graph123
-rw-r--r--res/raw/video_record.oggbin0 -> 9572 bytes
-rw-r--r--res/values-af/filtershow_strings.xml96
-rw-r--r--res/values-af/strings.xml400
-rw-r--r--res/values-am/filtershow_strings.xml96
-rw-r--r--res/values-am/strings.xml400
-rw-r--r--res/values-ar/filtershow_strings.xml96
-rw-r--r--res/values-ar/strings.xml400
-rw-r--r--res/values-be/filtershow_strings.xml96
-rw-r--r--res/values-be/strings.xml400
-rw-r--r--res/values-bg/filtershow_strings.xml96
-rw-r--r--res/values-bg/strings.xml400
-rw-r--r--res/values-ca/filtershow_strings.xml96
-rw-r--r--res/values-ca/strings.xml400
-rw-r--r--res/values-cs/filtershow_strings.xml96
-rw-r--r--res/values-cs/strings.xml400
-rw-r--r--res/values-da/filtershow_strings.xml96
-rw-r--r--res/values-da/strings.xml398
-rw-r--r--res/values-de/filtershow_strings.xml96
-rw-r--r--res/values-de/strings.xml400
-rw-r--r--res/values-el/filtershow_strings.xml96
-rw-r--r--res/values-el/strings.xml400
-rw-r--r--res/values-en-rGB/filtershow_strings.xml96
-rw-r--r--res/values-en-rGB/strings.xml400
-rw-r--r--res/values-es-rUS/filtershow_strings.xml96
-rw-r--r--res/values-es-rUS/strings.xml400
-rw-r--r--res/values-es/filtershow_strings.xml96
-rw-r--r--res/values-es/strings.xml400
-rw-r--r--res/values-et/filtershow_strings.xml96
-rw-r--r--res/values-et/strings.xml400
-rw-r--r--res/values-fa/filtershow_strings.xml96
-rw-r--r--res/values-fa/strings.xml400
-rw-r--r--res/values-fi/filtershow_strings.xml96
-rw-r--r--res/values-fi/strings.xml400
-rw-r--r--res/values-fr/filtershow_strings.xml96
-rw-r--r--res/values-fr/strings.xml400
-rw-r--r--res/values-hi/filtershow_strings.xml96
-rw-r--r--res/values-hi/strings.xml400
-rw-r--r--res/values-hr/filtershow_strings.xml96
-rw-r--r--res/values-hr/strings.xml400
-rw-r--r--res/values-hu/filtershow_strings.xml96
-rw-r--r--res/values-hu/strings.xml400
-rw-r--r--res/values-in/filtershow_strings.xml96
-rw-r--r--res/values-in/strings.xml400
-rw-r--r--res/values-it/filtershow_strings.xml96
-rw-r--r--res/values-it/strings.xml400
-rw-r--r--res/values-iw/filtershow_strings.xml96
-rw-r--r--res/values-iw/strings.xml400
-rw-r--r--res/values-ja/filtershow_strings.xml96
-rw-r--r--res/values-ja/strings.xml400
-rw-r--r--res/values-ko/filtershow_strings.xml96
-rw-r--r--res/values-ko/strings.xml400
-rw-r--r--res/values-land/dimensions.xml20
-rw-r--r--res/values-land/styles.xml75
-rw-r--r--res/values-large-hdpi/drawable.xml32
-rw-r--r--res/values-large/dimens.xml22
-rw-r--r--res/values-large/filtershow_values.xml32
-rw-r--r--res/values-lt/filtershow_strings.xml96
-rw-r--r--res/values-lt/strings.xml400
-rw-r--r--res/values-lv/filtershow_strings.xml96
-rw-r--r--res/values-lv/strings.xml400
-rw-r--r--res/values-ms/filtershow_strings.xml96
-rw-r--r--res/values-ms/strings.xml400
-rw-r--r--res/values-nb/filtershow_strings.xml96
-rw-r--r--res/values-nb/strings.xml398
-rw-r--r--res/values-nl/filtershow_strings.xml96
-rw-r--r--res/values-nl/strings.xml400
-rw-r--r--res/values-notouch-v14/styles.xml25
-rw-r--r--res/values-pl/filtershow_strings.xml96
-rw-r--r--res/values-pl/strings.xml400
-rw-r--r--res/values-port/styles.xml65
-rw-r--r--res/values-pt-rPT/filtershow_strings.xml96
-rw-r--r--res/values-pt-rPT/strings.xml400
-rw-r--r--res/values-pt/filtershow_strings.xml96
-rw-r--r--res/values-pt/strings.xml400
-rw-r--r--res/values-rm/strings.xml667
-rw-r--r--res/values-ro/filtershow_strings.xml96
-rw-r--r--res/values-ro/strings.xml400
-rw-r--r--res/values-ru/filtershow_strings.xml96
-rw-r--r--res/values-ru/strings.xml400
-rw-r--r--res/values-sk/filtershow_strings.xml96
-rw-r--r--res/values-sk/strings.xml400
-rw-r--r--res/values-sl/filtershow_strings.xml96
-rw-r--r--res/values-sl/strings.xml400
-rw-r--r--res/values-sr/filtershow_strings.xml96
-rw-r--r--res/values-sr/strings.xml400
-rw-r--r--res/values-sv/filtershow_strings.xml96
-rw-r--r--res/values-sv/strings.xml400
-rw-r--r--res/values-sw/filtershow_strings.xml96
-rw-r--r--res/values-sw/strings.xml405
-rwxr-xr-xres/values-sw320dp-land/photoeditor_dimens.xml20
-rwxr-xr-xres/values-sw320dp-port/photoeditor_dimens.xml20
-rwxr-xr-xres/values-sw320dp/photoeditor_dimens.xml37
-rw-r--r--res/values-sw360dp-land/dimensions.xml18
-rw-r--r--res/values-sw360dp/dimensions.xml18
-rw-r--r--res/values-sw600dp-hdpi/drawable.xml32
-rw-r--r--res/values-sw600dp/dimens.xml26
-rw-r--r--res/values-sw600dp/dimensions.xml20
-rwxr-xr-xres/values-sw600dp/photoeditor_dimens.xml39
-rw-r--r--res/values-sw640dp/dimens.xml41
-rw-r--r--res/values-sw640dp/drawable.xml31
-rw-r--r--res/values-sw640dp/styles.xml22
-rw-r--r--res/values-sw800dp/dimens.xml27
-rw-r--r--res/values-sw800dp/dimensions.xml20
-rwxr-xr-xres/values-sw800dp/photoeditor_dimens.xml39
-rw-r--r--res/values-th/filtershow_strings.xml96
-rw-r--r--res/values-th/strings.xml400
-rw-r--r--res/values-tl/filtershow_strings.xml96
-rw-r--r--res/values-tl/strings.xml400
-rw-r--r--res/values-tr/filtershow_strings.xml96
-rw-r--r--res/values-tr/strings.xml400
-rw-r--r--res/values-uk/filtershow_strings.xml96
-rw-r--r--res/values-uk/strings.xml400
-rw-r--r--res/values-v11/styles.xml24
-rw-r--r--res/values-v13/styles.xml20
-rw-r--r--res/values-v14/styles.xml29
-rw-r--r--res/values-vi/filtershow_strings.xml96
-rw-r--r--res/values-vi/strings.xml400
-rw-r--r--res/values-w1024dp/strings.xml42
-rw-r--r--res/values-w480dp/bool.xml18
-rw-r--r--res/values-xlarge-land/drawable.xml22
-rw-r--r--res/values-xlarge-port/drawable.xml22
-rw-r--r--res/values-xlarge/dimens.xml41
-rw-r--r--res/values-xlarge/dimensions.xml33
-rw-r--r--res/values-xlarge/drawable.xml29
-rw-r--r--res/values-xlarge/filtershow_values.xml32
-rw-r--r--res/values-xlarge/styles.xml29
-rw-r--r--res/values-zh-rCN/filtershow_strings.xml96
-rw-r--r--res/values-zh-rCN/strings.xml400
-rw-r--r--res/values-zh-rTW/filtershow_strings.xml96
-rw-r--r--res/values-zh-rTW/strings.xml400
-rw-r--r--res/values-zu/filtershow_strings.xml96
-rw-r--r--res/values-zu/strings.xml402
-rw-r--r--res/values/arrays.xml489
-rw-r--r--res/values/attrs.xml46
-rw-r--r--res/values/bool.xml18
-rw-r--r--res/values/colors.xml73
-rw-r--r--res/values/config.xml22
-rw-r--r--res/values/crop_colors.xml20
-rw-r--r--res/values/crop_dimens.xml23
-rw-r--r--res/values/dimens.xml154
-rw-r--r--res/values/filtershow_color.xml51
-rw-r--r--res/values/filtershow_ids.xml52
-rw-r--r--res/values/filtershow_strings.xml248
-rw-r--r--res/values/filtershow_styles.xml68
-rw-r--r--res/values/filtershow_values.xml43
-rw-r--r--res/values/filtershow_values_attrs.xml32
-rw-r--r--res/values/iconbutton_styles.xml49
-rw-r--r--res/values/ids.xml23
-rw-r--r--res/values/strings.xml1102
-rw-r--r--res/values/styles.xml292
-rw-r--r--res/xml/camera_preferences.xml101
-rw-r--r--res/xml/device_filter.xml19
-rw-r--r--res/xml/video_preferences.xml74
-rw-r--r--res/xml/wallpaper_picker_preview.xml19
-rw-r--r--res/xml/widget_info.xml8
-rw-r--r--src/android/util/Pools.java165
-rw-r--r--src/com/android/camera/AndroidCameraManagerImpl.java779
-rw-r--r--src/com/android/camera/CameraActivity.java571
-rw-r--r--src/com/android/camera/CameraBackupAgent.java32
-rw-r--r--src/com/android/camera/CameraButtonIntentReceiver.java53
-rw-r--r--src/com/android/camera/CameraDisabledException.java24
-rw-r--r--src/com/android/camera/CameraErrorCallback.java35
-rw-r--r--src/com/android/camera/CameraHardwareException.java28
-rw-r--r--src/com/android/camera/CameraHolder.java299
-rw-r--r--src/com/android/camera/CameraManager.java317
-rw-r--r--src/com/android/camera/CameraManagerFactory.java37
-rw-r--r--src/com/android/camera/CameraModule.java70
-rw-r--r--src/com/android/camera/CameraPreference.java63
-rw-r--r--src/com/android/camera/CameraScreenNail.java524
-rw-r--r--src/com/android/camera/CameraSettings.java570
-rw-r--r--src/com/android/camera/CaptureAnimManager.java228
-rw-r--r--src/com/android/camera/ComboPreferences.java335
-rw-r--r--src/com/android/camera/CountDownTimerPreference.java48
-rw-r--r--src/com/android/camera/DisableCameraReceiver.java85
-rw-r--r--src/com/android/camera/EffectsRecorder.java1239
-rw-r--r--src/com/android/camera/Exif.java54
-rw-r--r--src/com/android/camera/FocusOverlayManager.java558
-rw-r--r--src/com/android/camera/IconListPreference.java117
-rw-r--r--src/com/android/camera/ImageTaskManager.java48
-rw-r--r--src/com/android/camera/IntArray.java45
-rw-r--r--src/com/android/camera/ListPreference.java202
-rw-r--r--src/com/android/camera/LocationManager.java181
-rw-r--r--src/com/android/camera/MediaSaveService.java233
-rw-r--r--src/com/android/camera/OnClickAttr.java31
-rw-r--r--src/com/android/camera/OnScreenHint.java190
-rw-r--r--src/com/android/camera/OnScreenIndicators.java190
-rw-r--r--src/com/android/camera/PhotoController.java65
-rw-r--r--src/com/android/camera/PhotoMenu.java200
-rw-r--r--src/com/android/camera/PhotoModule.java2006
-rw-r--r--src/com/android/camera/PhotoUI.java864
-rw-r--r--src/com/android/camera/PieController.java259
-rw-r--r--src/com/android/camera/PreferenceGroup.java79
-rw-r--r--src/com/android/camera/PreferenceInflater.java108
-rw-r--r--src/com/android/camera/PreviewFrameLayout.java136
-rw-r--r--src/com/android/camera/PreviewGestures.java199
-rw-r--r--src/com/android/camera/ProxyLauncher.java46
-rw-r--r--src/com/android/camera/RecordLocationPreference.java58
-rw-r--r--src/com/android/camera/RotateDialogController.java169
-rw-r--r--src/com/android/camera/SecureCameraActivity.java23
-rwxr-xr-xsrc/com/android/camera/ShutterButton.java130
-rw-r--r--src/com/android/camera/SoundClips.java197
-rw-r--r--src/com/android/camera/StaticBitmapScreenNail.java32
-rw-r--r--src/com/android/camera/Storage.java181
-rw-r--r--src/com/android/camera/SurfaceTextureRenderer.java224
-rw-r--r--src/com/android/camera/SwitchAnimManager.java146
-rw-r--r--src/com/android/camera/Thumbnail.java68
-rw-r--r--src/com/android/camera/Util.java804
-rw-r--r--src/com/android/camera/VideoController.java42
-rw-r--r--src/com/android/camera/VideoMenu.java205
-rw-r--r--src/com/android/camera/VideoModule.java2233
-rw-r--r--src/com/android/camera/VideoUI.java698
-rw-r--r--src/com/android/camera/data/AbstractLocalDataAdapterWrapper.java90
-rw-r--r--src/com/android/camera/data/CameraDataAdapter.java348
-rw-r--r--src/com/android/camera/data/CameraPreviewData.java63
-rw-r--r--src/com/android/camera/data/FixedFirstDataAdapter.java154
-rw-r--r--src/com/android/camera/data/FixedLastDataAdapter.java127
-rw-r--r--src/com/android/camera/data/LocalData.java726
-rw-r--r--src/com/android/camera/data/LocalDataAdapter.java91
-rw-r--r--src/com/android/camera/data/PanoramaMetadataLoader.java106
-rw-r--r--src/com/android/camera/drawable/TextDrawable.java121
-rw-r--r--src/com/android/camera/ui/AbstractSettingPopup.java44
-rw-r--r--src/com/android/camera/ui/CameraControls.java262
-rw-r--r--src/com/android/camera/ui/CameraRootView.java181
-rw-r--r--src/com/android/camera/ui/CameraSwitcher.java378
-rw-r--r--src/com/android/camera/ui/CheckedLinearLayout.java60
-rw-r--r--src/com/android/camera/ui/CountDownView.java131
-rw-r--r--src/com/android/camera/ui/CountdownTimerPopup.java145
-rw-r--r--src/com/android/camera/ui/EffectSettingPopup.java214
-rw-r--r--src/com/android/camera/ui/ExpandedGridView.java36
-rw-r--r--src/com/android/camera/ui/FaceView.java226
-rw-r--r--src/com/android/camera/ui/FilmStripGestureRecognizer.java112
-rw-r--r--src/com/android/camera/ui/FilmStripView.java1720
-rw-r--r--src/com/android/camera/ui/FocusIndicator.java24
-rw-r--r--src/com/android/camera/ui/InLineSettingCheckBox.java83
-rw-r--r--src/com/android/camera/ui/InLineSettingItem.java94
-rw-r--r--src/com/android/camera/ui/InLineSettingMenu.java78
-rw-r--r--src/com/android/camera/ui/LayoutChangeHelper.java43
-rw-r--r--src/com/android/camera/ui/LayoutChangeNotifier.java28
-rw-r--r--src/com/android/camera/ui/LayoutNotifyView.java48
-rw-r--r--src/com/android/camera/ui/ListPrefSettingPopup.java127
-rw-r--r--src/com/android/camera/ui/MoreSettingPopup.java203
-rw-r--r--src/com/android/camera/ui/OnIndicatorEventListener.java25
-rw-r--r--src/com/android/camera/ui/OverlayRenderer.java95
-rw-r--r--src/com/android/camera/ui/PieItem.java170
-rw-r--r--src/com/android/camera/ui/PieMenuButton.java62
-rw-r--r--src/com/android/camera/ui/PieRenderer.java1091
-rw-r--r--src/com/android/camera/ui/PopupManager.java66
-rw-r--r--src/com/android/camera/ui/PreviewSurfaceView.java50
-rw-r--r--src/com/android/camera/ui/RenderOverlay.java176
-rw-r--r--src/com/android/camera/ui/Rotatable.java22
-rw-r--r--src/com/android/camera/ui/RotatableLayout.java283
-rw-r--r--src/com/android/camera/ui/RotateImageView.java176
-rw-r--r--src/com/android/camera/ui/RotateLayout.java203
-rw-r--r--src/com/android/camera/ui/RotateTextToast.java59
-rw-r--r--src/com/android/camera/ui/Switch.java505
-rw-r--r--src/com/android/camera/ui/TimeIntervalPopup.java164
-rw-r--r--src/com/android/camera/ui/TwoStateImageView.java55
-rw-r--r--src/com/android/camera/ui/ZoomRenderer.java158
-rw-r--r--src/com/android/gallery3d/anim/AlphaAnimation.java48
-rw-r--r--src/com/android/gallery3d/anim/Animation.java92
-rw-r--r--src/com/android/gallery3d/anim/CanvasAnimation.java25
-rw-r--r--src/com/android/gallery3d/anim/FloatAnimation.java40
-rw-r--r--src/com/android/gallery3d/anim/StateTransitionAnimation.java180
-rw-r--r--src/com/android/gallery3d/app/AbstractGalleryActivity.java343
-rw-r--r--src/com/android/gallery3d/app/ActivityState.java276
-rw-r--r--src/com/android/gallery3d/app/AlbumDataLoader.java397
-rw-r--r--src/com/android/gallery3d/app/AlbumPage.java786
-rw-r--r--src/com/android/gallery3d/app/AlbumPicker.java40
-rw-r--r--src/com/android/gallery3d/app/AlbumSetDataLoader.java393
-rw-r--r--src/com/android/gallery3d/app/AlbumSetPage.java764
-rw-r--r--src/com/android/gallery3d/app/AppBridge.java72
-rw-r--r--src/com/android/gallery3d/app/BatchService.java48
-rw-r--r--src/com/android/gallery3d/app/CommonControllerOverlay.java346
-rw-r--r--src/com/android/gallery3d/app/Config.java127
-rw-r--r--src/com/android/gallery3d/app/ControllerOverlay.java56
-rw-r--r--src/com/android/gallery3d/app/DialogPicker.java41
-rw-r--r--src/com/android/gallery3d/app/EyePosition.java226
-rw-r--r--src/com/android/gallery3d/app/FilmstripPage.java21
-rw-r--r--src/com/android/gallery3d/app/FilterUtils.java257
-rw-r--r--src/com/android/gallery3d/app/Gallery.java274
-rw-r--r--src/com/android/gallery3d/app/GalleryActionBar.java438
-rw-r--r--src/com/android/gallery3d/app/GalleryApp.java41
-rw-r--r--src/com/android/gallery3d/app/GalleryAppImpl.java127
-rw-r--r--src/com/android/gallery3d/app/GalleryContext.java34
-rw-r--r--src/com/android/gallery3d/app/LoadingListener.java27
-rw-r--r--src/com/android/gallery3d/app/Log.java53
-rw-r--r--src/com/android/gallery3d/app/ManageCachePage.java419
-rw-r--r--src/com/android/gallery3d/app/MovieActivity.java263
-rw-r--r--src/com/android/gallery3d/app/MovieControllerOverlay.java185
-rw-r--r--src/com/android/gallery3d/app/MoviePlayer.java525
-rw-r--r--src/com/android/gallery3d/app/MuteVideo.java104
-rw-r--r--src/com/android/gallery3d/app/NotificationIds.java22
-rw-r--r--src/com/android/gallery3d/app/OrientationManager.java166
-rw-r--r--src/com/android/gallery3d/app/PackagesMonitor.java71
-rw-r--r--src/com/android/gallery3d/app/PanoramaMetadataSupport.java93
-rw-r--r--src/com/android/gallery3d/app/PhotoDataAdapter.java1133
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java1571
-rw-r--r--src/com/android/gallery3d/app/PhotoPageBottomControls.java137
-rw-r--r--src/com/android/gallery3d/app/PhotoPageProgressBar.java50
-rw-r--r--src/com/android/gallery3d/app/PickerActivity.java83
-rw-r--r--src/com/android/gallery3d/app/SinglePhotoDataAdapter.java263
-rw-r--r--src/com/android/gallery3d/app/SinglePhotoPage.java21
-rw-r--r--src/com/android/gallery3d/app/SlideshowDataAdapter.java204
-rw-r--r--src/com/android/gallery3d/app/SlideshowPage.java366
-rw-r--r--src/com/android/gallery3d/app/StateManager.java339
-rw-r--r--src/com/android/gallery3d/app/StitchingChangeListener.java27
-rw-r--r--src/com/android/gallery3d/app/TimeBar.java266
-rw-r--r--src/com/android/gallery3d/app/TransitionStore.java46
-rw-r--r--src/com/android/gallery3d/app/TrimControllerOverlay.java111
-rw-r--r--src/com/android/gallery3d/app/TrimTimeBar.java339
-rw-r--r--src/com/android/gallery3d/app/TrimVideo.java337
-rw-r--r--src/com/android/gallery3d/app/VideoUtils.java328
-rw-r--r--src/com/android/gallery3d/app/Wallpaper.java135
-rw-r--r--src/com/android/gallery3d/data/ActionImage.java103
-rw-r--r--src/com/android/gallery3d/data/BucketHelper.java241
-rw-r--r--src/com/android/gallery3d/data/BytesBufferPool.java91
-rw-r--r--src/com/android/gallery3d/data/CameraShortcutImage.java34
-rw-r--r--src/com/android/gallery3d/data/ChangeNotifier.java57
-rw-r--r--src/com/android/gallery3d/data/ClusterAlbum.java143
-rw-r--r--src/com/android/gallery3d/data/ClusterAlbumSet.java159
-rw-r--r--src/com/android/gallery3d/data/ClusterSource.java86
-rw-r--r--src/com/android/gallery3d/data/Clustering.java29
-rw-r--r--src/com/android/gallery3d/data/ComboAlbum.java103
-rw-r--r--src/com/android/gallery3d/data/ComboAlbumSet.java96
-rw-r--r--src/com/android/gallery3d/data/ComboSource.java55
-rw-r--r--src/com/android/gallery3d/data/ContentListener.java21
-rw-r--r--src/com/android/gallery3d/data/DataManager.java371
-rw-r--r--src/com/android/gallery3d/data/DataSourceType.java45
-rw-r--r--src/com/android/gallery3d/data/DecodeUtils.java312
-rw-r--r--src/com/android/gallery3d/data/DownloadCache.java370
-rw-r--r--src/com/android/gallery3d/data/DownloadEntry.java72
-rw-r--r--src/com/android/gallery3d/data/DownloadUtils.java79
-rw-r--r--src/com/android/gallery3d/data/EmptyAlbumImage.java34
-rw-r--r--src/com/android/gallery3d/data/Exif.java48
-rw-r--r--src/com/android/gallery3d/data/Face.java65
-rw-r--r--src/com/android/gallery3d/data/FaceClustering.java142
-rw-r--r--src/com/android/gallery3d/data/FilterDeleteSet.java256
-rw-r--r--src/com/android/gallery3d/data/FilterEmptyPromptSet.java82
-rw-r--r--src/com/android/gallery3d/data/FilterSource.java94
-rw-r--r--src/com/android/gallery3d/data/FilterTypeSet.java137
-rw-r--r--src/com/android/gallery3d/data/ImageCacheRequest.java102
-rw-r--r--src/com/android/gallery3d/data/ImageCacheService.java123
-rw-r--r--src/com/android/gallery3d/data/LocalAlbum.java325
-rw-r--r--src/com/android/gallery3d/data/LocalAlbumSet.java211
-rw-r--r--src/com/android/gallery3d/data/LocalImage.java355
-rw-r--r--src/com/android/gallery3d/data/LocalMediaItem.java109
-rw-r--r--src/com/android/gallery3d/data/LocalMergeAlbum.java257
-rw-r--r--src/com/android/gallery3d/data/LocalSource.java275
-rw-r--r--src/com/android/gallery3d/data/LocalVideo.java242
-rw-r--r--src/com/android/gallery3d/data/LocationClustering.java316
-rw-r--r--src/com/android/gallery3d/data/Log.java53
-rw-r--r--src/com/android/gallery3d/data/MediaDetails.java170
-rw-r--r--src/com/android/gallery3d/data/MediaItem.java134
-rw-r--r--src/com/android/gallery3d/data/MediaObject.java166
-rw-r--r--src/com/android/gallery3d/data/MediaSet.java348
-rw-r--r--src/com/android/gallery3d/data/MediaSource.java96
-rw-r--r--src/com/android/gallery3d/data/MtpClient.java443
-rw-r--r--src/com/android/gallery3d/data/PanoramaMetadataJob.java40
-rw-r--r--src/com/android/gallery3d/data/Path.java241
-rw-r--r--src/com/android/gallery3d/data/PathMatcher.java102
-rw-r--r--src/com/android/gallery3d/data/SecureAlbum.java206
-rw-r--r--src/com/android/gallery3d/data/SecureSource.java56
-rw-r--r--src/com/android/gallery3d/data/SingleItemAlbum.java68
-rw-r--r--src/com/android/gallery3d/data/SizeClustering.java141
-rw-r--r--src/com/android/gallery3d/data/SnailAlbum.java44
-rw-r--r--src/com/android/gallery3d/data/SnailItem.java95
-rw-r--r--src/com/android/gallery3d/data/SnailSource.java70
-rw-r--r--src/com/android/gallery3d/data/TagClustering.java95
-rw-r--r--src/com/android/gallery3d/data/TimeClustering.java439
-rw-r--r--src/com/android/gallery3d/data/UnlockImage.java34
-rw-r--r--src/com/android/gallery3d/data/UriImage.java298
-rw-r--r--src/com/android/gallery3d/data/UriSource.java95
-rw-r--r--src/com/android/gallery3d/filtershow/CenteredLinearLayout.java51
-rw-r--r--src/com/android/gallery3d/filtershow/EditorPlaceHolder.java82
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java1121
-rw-r--r--src/com/android/gallery3d/filtershow/cache/ImageLoader.java502
-rw-r--r--src/com/android/gallery3d/filtershow/category/Action.java186
-rw-r--r--src/com/android/gallery3d/filtershow/category/CategoryAdapter.java182
-rw-r--r--src/com/android/gallery3d/filtershow/category/CategoryPanel.java108
-rw-r--r--src/com/android/gallery3d/filtershow/category/CategoryTrack.java77
-rw-r--r--src/com/android/gallery3d/filtershow/category/CategoryView.java176
-rw-r--r--src/com/android/gallery3d/filtershow/category/MainPanel.java239
-rw-r--r--src/com/android/gallery3d/filtershow/colorpicker/ColorGridDialog.java100
-rw-r--r--src/com/android/gallery3d/filtershow/colorpicker/ColorListener.java21
-rw-r--r--src/com/android/gallery3d/filtershow/colorpicker/ColorOpacityView.java197
-rw-r--r--src/com/android/gallery3d/filtershow/colorpicker/ColorPickerDialog.java123
-rw-r--r--src/com/android/gallery3d/filtershow/colorpicker/ColorRectView.java225
-rw-r--r--src/com/android/gallery3d/filtershow/colorpicker/ColorValueView.java180
-rw-r--r--src/com/android/gallery3d/filtershow/colorpicker/RGBListener.java21
-rw-r--r--src/com/android/gallery3d/filtershow/controller/ActionSlider.java71
-rw-r--r--src/com/android/gallery3d/filtershow/controller/BasicParameterInt.java113
-rw-r--r--src/com/android/gallery3d/filtershow/controller/BasicParameterStyle.java111
-rw-r--r--src/com/android/gallery3d/filtershow/controller/BasicSlider.java87
-rw-r--r--src/com/android/gallery3d/filtershow/controller/Control.java32
-rw-r--r--src/com/android/gallery3d/filtershow/controller/FilterView.java25
-rw-r--r--src/com/android/gallery3d/filtershow/controller/Parameter.java33
-rw-r--r--src/com/android/gallery3d/filtershow/controller/ParameterActionAndInt.java29
-rw-r--r--src/com/android/gallery3d/filtershow/controller/ParameterInteger.java31
-rw-r--r--src/com/android/gallery3d/filtershow/controller/ParameterSet.java23
-rw-r--r--src/com/android/gallery3d/filtershow/controller/ParameterStyles.java37
-rw-r--r--src/com/android/gallery3d/filtershow/controller/StyleChooser.java88
-rw-r--r--src/com/android/gallery3d/filtershow/controller/TitledSlider.java106
-rw-r--r--src/com/android/gallery3d/filtershow/crop/BoundedRect.java368
-rw-r--r--src/com/android/gallery3d/filtershow/crop/CropActivity.java697
-rw-r--r--src/com/android/gallery3d/filtershow/crop/CropDrawingUtils.java168
-rw-r--r--src/com/android/gallery3d/filtershow/crop/CropExtras.java121
-rw-r--r--src/com/android/gallery3d/filtershow/crop/CropMath.java260
-rw-r--r--src/com/android/gallery3d/filtershow/crop/CropObject.java330
-rw-r--r--src/com/android/gallery3d/filtershow/crop/CropView.java378
-rw-r--r--src/com/android/gallery3d/filtershow/data/FilterStackDBHelper.java101
-rw-r--r--src/com/android/gallery3d/filtershow/data/FilterStackSource.java197
-rw-r--r--src/com/android/gallery3d/filtershow/data/UserPresetsManager.java149
-rw-r--r--src/com/android/gallery3d/filtershow/editors/BasicEditor.java138
-rw-r--r--src/com/android/gallery3d/filtershow/editors/Editor.java330
-rw-r--r--src/com/android/gallery3d/filtershow/editors/EditorChanSat.java227
-rw-r--r--src/com/android/gallery3d/filtershow/editors/EditorCrop.java168
-rw-r--r--src/com/android/gallery3d/filtershow/editors/EditorCurves.java56
-rw-r--r--src/com/android/gallery3d/filtershow/editors/EditorDraw.java158
-rw-r--r--src/com/android/gallery3d/filtershow/editors/EditorGrad.java315
-rw-r--r--src/com/android/gallery3d/filtershow/editors/EditorInfo.java23
-rw-r--r--src/com/android/gallery3d/filtershow/editors/EditorMirror.java109
-rw-r--r--src/com/android/gallery3d/filtershow/editors/EditorPanel.java143
-rw-r--r--src/com/android/gallery3d/filtershow/editors/EditorRedEye.java65
-rw-r--r--src/com/android/gallery3d/filtershow/editors/EditorRotate.java112
-rw-r--r--src/com/android/gallery3d/filtershow/editors/EditorStraighten.java103
-rw-r--r--src/com/android/gallery3d/filtershow/editors/EditorTinyPlanet.java58
-rw-r--r--src/com/android/gallery3d/filtershow/editors/EditorVignette.java53
-rw-r--r--src/com/android/gallery3d/filtershow/editors/EditorZoom.java27
-rw-r--r--src/com/android/gallery3d/filtershow/editors/ImageOnlyEditor.java50
-rw-r--r--src/com/android/gallery3d/filtershow/editors/ParametricEditor.java206
-rw-r--r--src/com/android/gallery3d/filtershow/editors/SwapButton.java111
-rw-r--r--src/com/android/gallery3d/filtershow/filters/BaseFiltersManager.java296
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ColorSpaceMatrix.java225
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java196
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterChanSatRepresentation.java211
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterColorBorderRepresentation.java113
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterCropRepresentation.java179
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterCurvesRepresentation.java170
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterDirectRepresentation.java38
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java171
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterFxRepresentation.java112
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterGradRepresentation.java497
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterImageBorderRepresentation.java91
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterMirrorRepresentation.java190
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterPoint.java21
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterPointRepresentation.java88
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterRedEyeRepresentation.java67
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterRepresentation.java262
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterRotateRepresentation.java190
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterStraightenRepresentation.java154
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterTinyPlanetRepresentation.java101
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterUserPresetRepresentation.java53
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterVignetteRepresentation.java173
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FiltersManagerInterface.java21
-rw-r--r--src/com/android/gallery3d/filtershow/filters/IconUtilities.java75
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilter.java109
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterBorder.java92
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterBwFilter.java64
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterChanSat.java161
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterContrast.java58
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterCurves.java112
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterDownsample.java83
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java278
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterEdge.java53
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterExposure.java56
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterFx.java111
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterGrad.java190
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterHighlights.java74
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterHue.java64
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterKMeans.java95
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterNegative.java39
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterParametricBorder.java69
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java260
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterRedEye.java79
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterSaturated.java58
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterShadows.java58
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterSharpen.java107
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterTinyPlanet.java158
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterVibrance.java57
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterVignette.java98
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterWBalance.java59
-rw-r--r--src/com/android/gallery3d/filtershow/filters/RedEyeCandidate.java50
-rw-r--r--src/com/android/gallery3d/filtershow/filters/SimpleImageFilter.java37
-rw-r--r--src/com/android/gallery3d/filtershow/filters/SplineMath.java166
-rw-r--r--src/com/android/gallery3d/filtershow/filters/convolve3x3.rs67
-rw-r--r--src/com/android/gallery3d/filtershow/filters/grad.rs121
-rw-r--r--src/com/android/gallery3d/filtershow/filters/grey.rs22
-rw-r--r--src/com/android/gallery3d/filtershow/filters/saturation.rs161
-rw-r--r--src/com/android/gallery3d/filtershow/history/HistoryItem.java53
-rw-r--r--src/com/android/gallery3d/filtershow/history/HistoryManager.java172
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/ControlPoint.java64
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/EclipseControl.java302
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/GeometryMathUtils.java416
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/GradControl.java274
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java307
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/ImageCurves.java445
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/ImageDraw.java139
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/ImageGrad.java215
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/ImageMirror.java78
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/ImagePoint.java89
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/ImageRedEye.java137
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/ImageRotate.java81
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/ImageShow.java578
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/ImageStraighten.java260
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/ImageTinyPlanet.java174
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/ImageVignette.java165
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/Line.java26
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/MasterImage.java581
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/Oval.java29
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/Spline.java450
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/Buffer.java74
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/CacheProcessing.java193
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/CachingPipeline.java469
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/FilterEnvironment.java178
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/HighresRenderingRequestTask.java90
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java694
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/ImageSavingTask.java125
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/PipelineInterface.java31
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/ProcessingService.java283
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/ProcessingTask.java88
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/ProcessingTaskController.java97
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/RenderingRequest.java174
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/RenderingRequestCaller.java21
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/RenderingRequestTask.java81
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/SharedBuffer.java77
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/SharedPreset.java42
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/UpdatePreviewTask.java79
-rw-r--r--src/com/android/gallery3d/filtershow/presets/PresetManagementDialog.java69
-rw-r--r--src/com/android/gallery3d/filtershow/presets/UserPresetsAdapter.java171
-rw-r--r--src/com/android/gallery3d/filtershow/provider/SharedImageProvider.java137
-rw-r--r--src/com/android/gallery3d/filtershow/state/DragListener.java110
-rw-r--r--src/com/android/gallery3d/filtershow/state/PanelTrack.java37
-rw-r--r--src/com/android/gallery3d/filtershow/state/State.java78
-rw-r--r--src/com/android/gallery3d/filtershow/state/StateAdapter.java115
-rw-r--r--src/com/android/gallery3d/filtershow/state/StatePanel.java44
-rw-r--r--src/com/android/gallery3d/filtershow/state/StatePanelTrack.java351
-rw-r--r--src/com/android/gallery3d/filtershow/state/StateView.java291
-rw-r--r--src/com/android/gallery3d/filtershow/tools/IconFactory.java108
-rw-r--r--src/com/android/gallery3d/filtershow/tools/MatrixFit.java200
-rw-r--r--src/com/android/gallery3d/filtershow/tools/SaveImage.java632
-rw-r--r--src/com/android/gallery3d/filtershow/tools/XmpPresets.java133
-rw-r--r--src/com/android/gallery3d/filtershow/ui/ExportDialog.java90
-rw-r--r--src/com/android/gallery3d/filtershow/ui/FramedTextButton.java137
-rw-r--r--src/com/android/gallery3d/filtershow/ui/SelectionRenderer.java48
-rw-r--r--src/com/android/gallery3d/gadget/LocalPhotoSource.java205
-rw-r--r--src/com/android/gallery3d/gadget/MediaSetSource.java233
-rw-r--r--src/com/android/gallery3d/gadget/PhotoAppWidgetProvider.java139
-rw-r--r--src/com/android/gallery3d/gadget/WidgetClickHandler.java77
-rw-r--r--src/com/android/gallery3d/gadget/WidgetConfigure.java209
-rw-r--r--src/com/android/gallery3d/gadget/WidgetDatabaseHelper.java309
-rw-r--r--src/com/android/gallery3d/gadget/WidgetService.java143
-rw-r--r--src/com/android/gallery3d/gadget/WidgetSource.java31
-rw-r--r--src/com/android/gallery3d/gadget/WidgetTypeChooser.java59
-rw-r--r--src/com/android/gallery3d/gadget/WidgetUtils.java80
-rw-r--r--src/com/android/gallery3d/glrenderer/BasicTexture.java212
-rw-r--r--src/com/android/gallery3d/glrenderer/BitmapTexture.java54
-rw-r--r--src/com/android/gallery3d/glrenderer/CanvasTexture.java52
-rw-r--r--src/com/android/gallery3d/glrenderer/ColorTexture.java63
-rw-r--r--src/com/android/gallery3d/glrenderer/ExtTexture.java60
-rw-r--r--src/com/android/gallery3d/glrenderer/FadeInTexture.java43
-rw-r--r--src/com/android/gallery3d/glrenderer/FadeOutTexture.java42
-rw-r--r--src/com/android/gallery3d/glrenderer/FadeTexture.java81
-rw-r--r--src/com/android/gallery3d/glrenderer/GLCanvas.java217
-rw-r--r--src/com/android/gallery3d/glrenderer/GLES11Canvas.java997
-rw-r--r--src/com/android/gallery3d/glrenderer/GLES11IdImpl.java68
-rw-r--r--src/com/android/gallery3d/glrenderer/GLES20Canvas.java1009
-rw-r--r--src/com/android/gallery3d/glrenderer/GLES20IdImpl.java42
-rw-r--r--src/com/android/gallery3d/glrenderer/GLId.java33
-rw-r--r--src/com/android/gallery3d/glrenderer/GLPaint.java41
-rw-r--r--src/com/android/gallery3d/glrenderer/MultiLineTexture.java52
-rw-r--r--src/com/android/gallery3d/glrenderer/NinePatchChunk.java82
-rw-r--r--src/com/android/gallery3d/glrenderer/NinePatchTexture.java424
-rw-r--r--src/com/android/gallery3d/glrenderer/RawTexture.java73
-rw-r--r--src/com/android/gallery3d/glrenderer/ResourceTexture.java53
-rw-r--r--src/com/android/gallery3d/glrenderer/StringTexture.java88
-rw-r--r--src/com/android/gallery3d/glrenderer/Texture.java44
-rw-r--r--src/com/android/gallery3d/glrenderer/TextureUploader.java105
-rw-r--r--src/com/android/gallery3d/glrenderer/TiledTexture.java349
-rw-r--r--src/com/android/gallery3d/glrenderer/UploadedTexture.java298
-rw-r--r--src/com/android/gallery3d/ingest/ImportTask.java95
-rw-r--r--src/com/android/gallery3d/ingest/IngestActivity.java570
-rw-r--r--src/com/android/gallery3d/ingest/IngestService.java320
-rw-r--r--src/com/android/gallery3d/ingest/MtpDeviceIndex.java596
-rw-r--r--src/com/android/gallery3d/ingest/SimpleDate.java114
-rw-r--r--src/com/android/gallery3d/ingest/adapter/CheckBroker.java56
-rw-r--r--src/com/android/gallery3d/ingest/adapter/MtpAdapter.java192
-rw-r--r--src/com/android/gallery3d/ingest/adapter/MtpPagerAdapter.java102
-rw-r--r--src/com/android/gallery3d/ingest/data/BitmapWithMetadata.java29
-rw-r--r--src/com/android/gallery3d/ingest/data/MtpBitmapFetch.java106
-rw-r--r--src/com/android/gallery3d/ingest/ui/DateTileView.java107
-rw-r--r--src/com/android/gallery3d/ingest/ui/IngestGridView.java58
-rw-r--r--src/com/android/gallery3d/ingest/ui/MtpFullscreenView.java115
-rw-r--r--src/com/android/gallery3d/ingest/ui/MtpImageView.java280
-rw-r--r--src/com/android/gallery3d/ingest/ui/MtpThumbnailTileView.java106
-rw-r--r--src/com/android/gallery3d/onetimeinitializer/GalleryWidgetMigrator.java169
-rw-r--r--src/com/android/gallery3d/provider/GalleryProvider.java228
-rw-r--r--src/com/android/gallery3d/ui/AbstractSlotRenderer.java119
-rw-r--r--src/com/android/gallery3d/ui/ActionModeHandler.java501
-rw-r--r--src/com/android/gallery3d/ui/AlbumLabelMaker.java206
-rw-r--r--src/com/android/gallery3d/ui/AlbumSetSlidingWindow.java549
-rw-r--r--src/com/android/gallery3d/ui/AlbumSetSlotRenderer.java242
-rw-r--r--src/com/android/gallery3d/ui/AlbumSlidingWindow.java365
-rw-r--r--src/com/android/gallery3d/ui/AlbumSlotRenderer.java201
-rw-r--r--src/com/android/gallery3d/ui/AnimationTime.java45
-rw-r--r--src/com/android/gallery3d/ui/BitmapLoader.java108
-rw-r--r--src/com/android/gallery3d/ui/BitmapScreenNail.java61
-rw-r--r--src/com/android/gallery3d/ui/BitmapTileProvider.java103
-rw-r--r--src/com/android/gallery3d/ui/CacheStorageUsageInfo.java90
-rw-r--r--src/com/android/gallery3d/ui/CaptureAnimation.java56
-rw-r--r--src/com/android/gallery3d/ui/DetailsAddressResolver.java118
-rw-r--r--src/com/android/gallery3d/ui/DetailsHelper.java148
-rw-r--r--src/com/android/gallery3d/ui/DialogDetailsView.java288
-rw-r--r--src/com/android/gallery3d/ui/DownUpDetector.java61
-rw-r--r--src/com/android/gallery3d/ui/EdgeEffect.java443
-rw-r--r--src/com/android/gallery3d/ui/EdgeView.java132
-rw-r--r--src/com/android/gallery3d/ui/FlingScroller.java141
-rw-r--r--src/com/android/gallery3d/ui/GLRoot.java53
-rw-r--r--src/com/android/gallery3d/ui/GLRootView.java630
-rw-r--r--src/com/android/gallery3d/ui/GLView.java465
-rw-r--r--src/com/android/gallery3d/ui/GestureRecognizer.java132
-rw-r--r--src/com/android/gallery3d/ui/Log.java54
-rw-r--r--src/com/android/gallery3d/ui/ManageCacheDrawer.java116
-rw-r--r--src/com/android/gallery3d/ui/MeasureHelper.java65
-rw-r--r--src/com/android/gallery3d/ui/MenuExecutor.java448
-rw-r--r--src/com/android/gallery3d/ui/OrientationSource.java22
-rw-r--r--src/com/android/gallery3d/ui/Paper.java183
-rw-r--r--src/com/android/gallery3d/ui/PhotoFallbackEffect.java179
-rw-r--r--src/com/android/gallery3d/ui/PhotoView.java1858
-rw-r--r--src/com/android/gallery3d/ui/PopupList.java206
-rw-r--r--src/com/android/gallery3d/ui/PositionController.java1821
-rw-r--r--src/com/android/gallery3d/ui/PreparePageFadeoutTexture.java85
-rw-r--r--src/com/android/gallery3d/ui/ProgressSpinner.java80
-rw-r--r--src/com/android/gallery3d/ui/RelativePosition.java42
-rw-r--r--src/com/android/gallery3d/ui/ScreenNail.java35
-rw-r--r--src/com/android/gallery3d/ui/ScrollBarView.java97
-rw-r--r--src/com/android/gallery3d/ui/ScrollerHelper.java97
-rw-r--r--src/com/android/gallery3d/ui/SelectionManager.java251
-rw-r--r--src/com/android/gallery3d/ui/SelectionMenu.java61
-rw-r--r--src/com/android/gallery3d/ui/SlideshowView.java163
-rw-r--r--src/com/android/gallery3d/ui/SlotView.java788
-rw-r--r--src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java142
-rw-r--r--src/com/android/gallery3d/ui/SynchronizedHandler.java41
-rw-r--r--src/com/android/gallery3d/ui/TileImageView.java786
-rw-r--r--src/com/android/gallery3d/ui/TileImageViewAdapter.java200
-rw-r--r--src/com/android/gallery3d/ui/TiledScreenNail.java218
-rw-r--r--src/com/android/gallery3d/ui/UndoBarView.java211
-rw-r--r--src/com/android/gallery3d/ui/UserInteractionListener.java26
-rw-r--r--src/com/android/gallery3d/ui/WakeLockHoldingProgressListener.java66
-rw-r--r--src/com/android/gallery3d/util/AccessibilityUtils.java54
-rw-r--r--src/com/android/gallery3d/util/BucketNames.java29
-rw-r--r--src/com/android/gallery3d/util/CacheManager.java82
-rw-r--r--src/com/android/gallery3d/util/GalleryUtils.java404
-rw-r--r--src/com/android/gallery3d/util/Holder.java29
-rw-r--r--src/com/android/gallery3d/util/IdentityCache.java78
-rw-r--r--src/com/android/gallery3d/util/IntArray.java60
-rw-r--r--src/com/android/gallery3d/util/InterruptableOutputStream.java67
-rw-r--r--src/com/android/gallery3d/util/JobLimiter.java159
-rw-r--r--src/com/android/gallery3d/util/LinkedNode.java71
-rw-r--r--src/com/android/gallery3d/util/Log.java53
-rw-r--r--src/com/android/gallery3d/util/MediaSetUtils.java66
-rw-r--r--src/com/android/gallery3d/util/MotionEventHelper.java120
-rw-r--r--src/com/android/gallery3d/util/Profile.java226
-rw-r--r--src/com/android/gallery3d/util/ProfileData.java168
-rw-r--r--src/com/android/gallery3d/util/RangeArray.java52
-rw-r--r--src/com/android/gallery3d/util/RangeBoolArray.java49
-rw-r--r--src/com/android/gallery3d/util/RangeIntArray.java49
-rw-r--r--src/com/android/gallery3d/util/ReverseGeocoder.java418
-rw-r--r--src/com/android/gallery3d/util/SaveVideoFileInfo.java29
-rw-r--r--src/com/android/gallery3d/util/SaveVideoFileUtils.java154
-rw-r--r--src/com/android/gallery3d/util/UpdateHelper.java59
-rw-r--r--src/com/android/photos/AlbumActivity.java48
-rw-r--r--src/com/android/photos/AlbumFragment.java168
-rw-r--r--src/com/android/photos/AlbumSetFragment.java135
-rw-r--r--src/com/android/photos/BitmapRegionTileSource.java183
-rw-r--r--src/com/android/photos/FullscreenViewer.java44
-rw-r--r--src/com/android/photos/GalleryActivity.java184
-rw-r--r--src/com/android/photos/MultiChoiceManager.java295
-rw-r--r--src/com/android/photos/MultiSelectGridFragment.java348
-rw-r--r--src/com/android/photos/PhotoFragment.java25
-rw-r--r--src/com/android/photos/PhotoSetFragment.java133
-rw-r--r--src/com/android/photos/SelectionManager.java184
-rw-r--r--src/com/android/photos/adapters/AlbumSetCursorAdapter.java75
-rw-r--r--src/com/android/photos/adapters/PhotoThumbnailAdapter.java75
-rw-r--r--src/com/android/photos/data/AlbumSetLoader.java54
-rw-r--r--src/com/android/photos/data/BitmapDecoder.java224
-rw-r--r--src/com/android/photos/data/FileRetriever.java109
-rw-r--r--src/com/android/photos/data/GalleryBitmapPool.java161
-rw-r--r--src/com/android/photos/data/MediaCache.java676
-rw-r--r--src/com/android/photos/data/MediaCacheDatabase.java286
-rw-r--r--src/com/android/photos/data/MediaCacheUtils.java167
-rw-r--r--src/com/android/photos/data/MediaRetriever.java129
-rw-r--r--src/com/android/photos/data/NotificationWatcher.java55
-rw-r--r--src/com/android/photos/data/PhotoDatabase.java195
-rw-r--r--src/com/android/photos/data/PhotoProvider.java536
-rw-r--r--src/com/android/photos/data/PhotoSetLoader.java115
-rw-r--r--src/com/android/photos/data/SQLiteContentProvider.java265
-rw-r--r--src/com/android/photos/data/SparseArrayBitmapPool.java212
-rw-r--r--src/com/android/photos/drawables/AutoThumbnailDrawable.java309
-rw-r--r--src/com/android/photos/drawables/DataUriThumbnailDrawable.java54
-rw-r--r--src/com/android/photos/shims/BitmapJobDrawable.java180
-rw-r--r--src/com/android/photos/shims/LoaderCompatShim.java31
-rw-r--r--src/com/android/photos/shims/MediaItemsLoader.java190
-rw-r--r--src/com/android/photos/shims/MediaSetLoader.java191
-rw-r--r--src/com/android/photos/views/BlockingGLTextureView.java438
-rw-r--r--src/com/android/photos/views/GalleryThumbnailView.java883
-rw-r--r--src/com/android/photos/views/HeaderGridView.java466
-rw-r--r--src/com/android/photos/views/SquareImageView.java53
-rw-r--r--src/com/android/photos/views/TiledImageRenderer.java825
-rw-r--r--src/com/android/photos/views/TiledImageView.java382
-rw-r--r--src_pd/com/android/camera/PanoramaStitchingManager.java41
-rw-r--r--src_pd/com/android/gallery3d/app/StitchingProgressManager.java34
-rw-r--r--src_pd/com/android/gallery3d/filtershow/editors/EditorManager.java40
-rw-r--r--src_pd/com/android/gallery3d/filtershow/filters/FiltersManager.java141
-rw-r--r--src_pd/com/android/gallery3d/picasasource/PicasaSource.java148
-rw-r--r--src_pd/com/android/gallery3d/settings/GallerySettings.java23
-rw-r--r--src_pd/com/android/gallery3d/util/HelpUtils.java28
-rw-r--r--src_pd/com/android/gallery3d/util/LightCycleHelper.java100
-rw-r--r--src_pd/com/android/gallery3d/util/RefocusHelper.java25
-rw-r--r--src_pd/com/android/gallery3d/util/UsageStatistics.java53
-rw-r--r--src_pd/com/android/gallery3d/util/XmpUtilHelper.java33
-rw-r--r--src_pd/com/android/photos/data/PhotoProviderAuthority.java21
-rw-r--r--tests/Android.mk18
-rw-r--r--tests/AndroidManifest.xml48
-rw-r--r--tests/res/raw/android_lawn.mp4bin0 -> 1514621 bytes
-rwxr-xr-xtests/res/raw/galaxy_nexus.jpgbin0 -> 1018845 bytes
-rw-r--r--tests/res/raw/jpeg_control.jpgbin0 -> 116135 bytes
-rw-r--r--tests/res/xml/galaxy_nexus.xml43
-rwxr-xr-xtests/src/com/android/gallery3d/CameraTestRunner.java46
-rwxr-xr-xtests/src/com/android/gallery3d/StressTests.java47
-rw-r--r--tests/src/com/android/gallery3d/anim/AnimationTest.java80
-rw-r--r--tests/src/com/android/gallery3d/common/BlobCacheTest.java738
-rw-r--r--tests/src/com/android/gallery3d/common/UtilsTest.java202
-rw-r--r--tests/src/com/android/gallery3d/data/GalleryAppMock.java50
-rw-r--r--tests/src/com/android/gallery3d/data/GalleryAppStub.java47
-rw-r--r--tests/src/com/android/gallery3d/data/LocalDataTest.java461
-rw-r--r--tests/src/com/android/gallery3d/data/MediaSetTest.java63
-rw-r--r--tests/src/com/android/gallery3d/data/MockItem.java53
-rw-r--r--tests/src/com/android/gallery3d/data/MockSet.java88
-rw-r--r--tests/src/com/android/gallery3d/data/MockSource.java48
-rw-r--r--tests/src/com/android/gallery3d/data/PathTest.java82
-rw-r--r--tests/src/com/android/gallery3d/data/RealDataTest.java110
-rw-r--r--tests/src/com/android/gallery3d/exif/ExifDataTest.java154
-rw-r--r--tests/src/com/android/gallery3d/exif/ExifInterfaceTest.java533
-rw-r--r--tests/src/com/android/gallery3d/exif/ExifModifierTest.java184
-rw-r--r--tests/src/com/android/gallery3d/exif/ExifOutputStreamTest.java198
-rw-r--r--tests/src/com/android/gallery3d/exif/ExifParserTest.java243
-rw-r--r--tests/src/com/android/gallery3d/exif/ExifReaderTest.java165
-rw-r--r--tests/src/com/android/gallery3d/exif/ExifTagTest.java219
-rw-r--r--tests/src/com/android/gallery3d/exif/ExifTestRunner.java135
-rw-r--r--tests/src/com/android/gallery3d/exif/ExifXmlDataTestCase.java108
-rw-r--r--tests/src/com/android/gallery3d/exif/ExifXmlReader.java125
-rw-r--r--tests/src/com/android/gallery3d/exif/Util.java195
-rw-r--r--tests/src/com/android/gallery3d/functional/CameraTest.java81
-rw-r--r--tests/src/com/android/gallery3d/functional/ImageCaptureIntentTest.java148
-rw-r--r--tests/src/com/android/gallery3d/functional/VideoCaptureIntentTest.java258
-rw-r--r--tests/src/com/android/gallery3d/glrenderer/GLCanvasMock.java71
-rw-r--r--tests/src/com/android/gallery3d/glrenderer/GLCanvasTest.java386
-rw-r--r--tests/src/com/android/gallery3d/glrenderer/GLMock.java197
-rw-r--r--tests/src/com/android/gallery3d/glrenderer/GLStub.java1490
-rw-r--r--tests/src/com/android/gallery3d/glrenderer/TextureTest.java208
-rw-r--r--tests/src/com/android/gallery3d/jpegstream/JpegStreamReaderTest.java84
-rw-r--r--tests/src/com/android/gallery3d/jpegstream/JpegStreamTestCase.java71
-rw-r--r--tests/src/com/android/gallery3d/jpegstream/JpegStreamTestRunner.java78
-rw-r--r--tests/src/com/android/gallery3d/jpegstream/JpegStreamWriterTest.java138
-rwxr-xr-xtests/src/com/android/gallery3d/stress/CameraLatency.java148
-rw-r--r--tests/src/com/android/gallery3d/stress/CameraStartUp.java155
-rwxr-xr-xtests/src/com/android/gallery3d/stress/CameraStressTestRunner.java61
-rwxr-xr-xtests/src/com/android/gallery3d/stress/ImageCapture.java119
-rw-r--r--tests/src/com/android/gallery3d/stress/ShotToShotLatency.java142
-rwxr-xr-xtests/src/com/android/gallery3d/stress/SwitchPreview.java116
-rw-r--r--tests/src/com/android/gallery3d/stress/TestUtil.java57
-rwxr-xr-xtests/src/com/android/gallery3d/stress/VideoCapture.java112
-rw-r--r--tests/src/com/android/gallery3d/ui/GLCanvasStub.java160
-rw-r--r--tests/src/com/android/gallery3d/ui/GLRootMock.java50
-rw-r--r--tests/src/com/android/gallery3d/ui/GLRootStub.java41
-rw-r--r--tests/src/com/android/gallery3d/ui/GLViewMock.java87
-rw-r--r--tests/src/com/android/gallery3d/ui/GLViewTest.java398
-rw-r--r--tests/src/com/android/gallery3d/ui/PointerInfo.java222
-rw-r--r--tests/src/com/android/gallery3d/unittest/CameraUnitTest.java107
-rw-r--r--tests/src/com/android/gallery3d/util/IntArrayTest.java60
-rw-r--r--tests/src/com/android/gallery3d/util/ProfileTest.java179
-rw-r--r--tests/src/com/android/photos/data/DataTestRunner.java46
-rw-r--r--tests/src/com/android/photos/data/MediaCacheTest.java388
-rw-r--r--tests/src/com/android/photos/data/PhotoDatabaseTest.java229
-rw-r--r--tests/src/com/android/photos/data/PhotoDatabaseUtils.java135
-rw-r--r--tests/src/com/android/photos/data/PhotoProviderTest.java391
-rw-r--r--tests/src/com/android/photos/data/TestHelper.java53
-rw-r--r--tests_camera/Android.mk16
-rw-r--r--tests_camera/AndroidManifest.xml44
-rw-r--r--tests_camera/src/com/android/camera/CameraLaunchPerformance.java47
-rwxr-xr-xtests_camera/src/com/android/camera/CameraTestRunner.java48
-rwxr-xr-xtests_camera/src/com/android/camera/StressTests.java47
-rw-r--r--tests_camera/src/com/android/camera/UnitTests.java35
-rw-r--r--tests_camera/src/com/android/camera/activity/CameraActivityTest.java53
-rw-r--r--tests_camera/src/com/android/camera/activity/CameraTestCase.java246
-rw-r--r--tests_camera/src/com/android/camera/functional/CameraTest.java81
-rw-r--r--tests_camera/src/com/android/camera/functional/ImageCaptureIntentTest.java148
-rw-r--r--tests_camera/src/com/android/camera/functional/VideoCaptureIntentTest.java258
-rwxr-xr-xtests_camera/src/com/android/camera/power/ImageAndVideoCapture.java116
-rwxr-xr-xtests_camera/src/com/android/camera/stress/CameraLatency.java149
-rw-r--r--tests_camera/src/com/android/camera/stress/CameraStartUp.java157
-rwxr-xr-xtests_camera/src/com/android/camera/stress/CameraStressTestRunner.java61
-rwxr-xr-xtests_camera/src/com/android/camera/stress/ImageCapture.java121
-rw-r--r--tests_camera/src/com/android/camera/stress/ShotToShotLatency.java143
-rwxr-xr-xtests_camera/src/com/android/camera/stress/SwitchPreview.java117
-rw-r--r--tests_camera/src/com/android/camera/stress/TestUtil.java57
-rwxr-xr-xtests_camera/src/com/android/camera/stress/VideoCapture.java115
-rw-r--r--tests_camera/src/com/android/camera/unittest/CameraUnitTest.java107
1739 files changed, 174559 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 000000000..cf5b767bb
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,56 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-v13
+LOCAL_STATIC_JAVA_LIBRARIES += com.android.gallery3d.common2
+LOCAL_STATIC_JAVA_LIBRARIES += xmp_toolkit
+LOCAL_STATIC_JAVA_LIBRARIES += mp4parser
+LOCAL_STATIC_JAVA_LIBRARIES += android-support-v8-renderscript
+
+LOCAL_RENDERSCRIPT_TARGET_API := 18
+LOCAL_RENDERSCRIPT_COMPATIBILITY := 18
+LOCAL_RENDERSCRIPT_FLAGS := -rs-package-name=android.support.v8.renderscript
+
+# Keep track of previously compiled RS files too (from bundled GalleryGoogle).
+prev_compiled_rs_files := $(call all-renderscript-files-under, src)
+
+# We already have these files from GalleryGoogle, so don't install them.
+LOCAL_RENDERSCRIPT_SKIP_INSTALL := $(prev_compiled_rs_files)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src) $(prev_compiled_rs_files)
+LOCAL_SRC_FILES += $(call all-java-files-under, src_pd)
+
+LOCAL_RESOURCE_DIR += $(LOCAL_PATH)/res
+
+LOCAL_AAPT_FLAGS := --auto-add-overlay
+
+LOCAL_PACKAGE_NAME := Gallery2
+
+LOCAL_OVERRIDES_PACKAGES := Gallery Gallery3D GalleryNew3D
+
+LOCAL_SDK_VERSION := current
+
+# If this is an unbundled build (to install seprately) then include
+# the libraries in the APK, otherwise just put them in /system/lib and
+# leave them out of the APK
+ifneq (,$(TARGET_BUILD_APPS))
+ LOCAL_JNI_SHARED_LIBRARIES := libjni_eglfence libjni_filtershow_filters librsjni libjni_jpegstream
+else
+ LOCAL_REQUIRED_MODULES := libjni_eglfence libjni_filtershow_filters libjni_jpegstream
+endif
+
+LOCAL_PROGUARD_FLAG_FILES := proguard.flags
+
+include $(BUILD_PACKAGE)
+
+include $(call all-makefiles-under, jni)
+
+ifeq ($(strip $(LOCAL_PACKAGE_OVERRIDES)),)
+
+# Use the following include to make gallery test apk
+include $(call all-makefiles-under, $(LOCAL_PATH))
+
+endif
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
new file mode 100644
index 000000000..ef1d91459
--- /dev/null
+++ b/AndroidManifest.xml
@@ -0,0 +1,409 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<manifest android:versionCode="40030"
+ android:versionName="1.1.40030"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.gallery3d">
+
+ <original-package android:name="com.android.gallery3d" />
+
+ <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" />
+
+ <permission android:name="com.android.gallery3d.permission.GALLERY_PROVIDER"
+ android:protectionLevel="signatureOrSystem" />
+
+ <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+ <uses-permission android:name="android.permission.CAMERA" />
+ <uses-permission android:name="android.permission.GET_ACCOUNTS" />
+ <uses-permission android:name="android.permission.INTERNET" />
+ <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
+ <uses-permission android:name="android.permission.NFC" />
+ <uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
+ <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
+ <uses-permission android:name="android.permission.RECORD_AUDIO" />
+ <uses-permission android:name="android.permission.SET_WALLPAPER" />
+ <uses-permission android:name="android.permission.USE_CREDENTIALS" />
+ <uses-permission android:name="android.permission.VIBRATE" />
+ <uses-permission android:name="android.permission.WAKE_LOCK" />
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+ <uses-permission android:name="android.permission.WRITE_SETTINGS" />
+ <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
+ <uses-permission android:name="com.android.gallery3d.permission.GALLERY_PROVIDER" />
+
+ <supports-screens android:smallScreens="false"
+ android:normalScreens="true" android:largeScreens="true"
+ android:anyDensity="true" />
+
+ <application android:icon="@mipmap/ic_launcher_gallery" android:label="@string/app_name"
+ android:name="com.android.gallery3d.app.GalleryAppImpl"
+ android:theme="@style/Theme.Gallery"
+ android:logo="@mipmap/ic_launcher_gallery"
+ android:hardwareAccelerated="true"
+ android:largeHeap="true"
+ android:backupAgent="com.android.camera.CameraBackupAgent"
+ android:restoreAnyVersion="true">
+ <uses-library android:name="com.google.android.media.effects" android:required="false" />
+ <meta-data android:name="com.google.android.backup.api_key"
+ android:value="AEdPqrEAAAAIRIXquXawbz6duuuCIUAZ_YJv1zbFMMcjZ0NoVw" />
+ <activity android:name="com.android.gallery3d.app.MovieActivity"
+ android:label="@string/movie_view_label"
+ android:configChanges="orientation|keyboardHidden|screenSize">
+ <intent-filter>
+ <action android:name="android.intent.action.VIEW" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.BROWSABLE" />
+ <data android:scheme="rtsp" />
+ </intent-filter>
+ <intent-filter>
+ <action android:name="android.intent.action.VIEW" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.BROWSABLE" />
+ <data android:scheme="http" />
+ <data android:scheme="https" />
+ <data android:scheme="content" />
+ <data android:scheme="file" />
+ <data android:mimeType="video/mpeg4" />
+ <data android:mimeType="video/mp4" />
+ <data android:mimeType="video/3gp" />
+ <data android:mimeType="video/3gpp" />
+ <data android:mimeType="video/3gpp2" />
+ <data android:mimeType="video/webm" />
+ <data android:mimeType="video/avi" />
+ <data android:mimeType="application/sdp" />
+ </intent-filter>
+ <intent-filter>
+ <!-- HTTP live support -->
+ <action android:name="android.intent.action.VIEW" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.BROWSABLE" />
+ <data android:scheme="http" />
+ <data android:scheme="https" />
+ <data android:mimeType="audio/x-mpegurl" />
+ <data android:mimeType="audio/mpegurl" />
+ <data android:mimeType="application/vnd.apple.mpegurl" />
+ <data android:mimeType="application/x-mpegurl" />
+ </intent-filter>
+ </activity>
+
+ <activity android:name="com.android.gallery3d.app.Gallery" android:label="@string/app_name"
+ android:configChanges="keyboardHidden|orientation|screenSize">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ <category android:name="android.intent.category.APP_GALLERY" />
+ </intent-filter>
+ <intent-filter>
+ <action android:name="android.intent.action.GET_CONTENT" />
+ <category android:name="android.intent.category.OPENABLE" />
+ <data android:mimeType="vnd.android.cursor.dir/image" />
+ </intent-filter>
+ <intent-filter>
+ <action android:name="android.intent.action.GET_CONTENT" />
+ <category android:name="android.intent.category.OPENABLE" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <data android:mimeType="image/*" />
+ <data android:mimeType="video/*" />
+ </intent-filter>
+ <!-- We do NOT support the PICK intent, we add these intent-filter for
+ backward compatibility. Handle it as GET_CONTENT. -->
+ <intent-filter>
+ <action android:name="android.intent.action.PICK" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <data android:mimeType="image/*" />
+ <data android:mimeType="video/*" />
+ </intent-filter>
+ <intent-filter>
+ <action android:name="android.intent.action.PICK" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <data android:mimeType="vnd.android.cursor.dir/image" />
+ <data android:mimeType="vnd.android.cursor.dir/video" />
+ </intent-filter>
+ <intent-filter>
+ <action android:name="android.intent.action.VIEW" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <data android:mimeType="vnd.android.cursor.dir/image" />
+ <data android:mimeType="vnd.android.cursor.dir/video" />
+ </intent-filter>
+ <intent-filter>
+ <action android:name="android.intent.action.VIEW" />
+ <action android:name="com.android.camera.action.REVIEW" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.BROWSABLE" />
+ <data android:scheme="" />
+ <data android:scheme="http" />
+ <data android:scheme="https" />
+ <data android:scheme="content" />
+ <data android:scheme="file" />
+ <data android:mimeType="image/bmp" />
+ <data android:mimeType="image/jpeg" />
+ <data android:mimeType="image/gif" />
+ <data android:mimeType="image/png" />
+ <data android:mimeType="image/webp" />
+ <data android:mimeType="image/x-ms-bmp" />
+ <data android:mimeType="image/vnd.wap.wbmp" />
+ <data android:mimeType="application/vnd.google.panorama360+jpg" />
+ </intent-filter>
+ <intent-filter>
+ <action android:name="com.android.camera.action.REVIEW" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.BROWSABLE" />
+ <data android:scheme="http" />
+ <data android:scheme="https" />
+ <data android:scheme="content" />
+ <data android:scheme="file" />
+ <data android:mimeType="video/mpeg4" />
+ <data android:mimeType="video/mp4" />
+ <data android:mimeType="video/3gp" />
+ <data android:mimeType="video/3gpp" />
+ <data android:mimeType="video/3gpp2" />
+ <data android:mimeType="application/sdp" />
+ </intent-filter>
+ </activity>
+
+ <!-- we add this activity-alias for shortcut backward compatibility -->
+ <!-- Note: The alias must put after the target activity -->
+ <activity-alias android:name="com.cooliris.media.Gallery"
+ android:targetActivity="com.android.gallery3d.app.Gallery"
+ android:configChanges="keyboardHidden|orientation|screenSize"
+ android:label="@string/app_name">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ </intent-filter>
+ </activity-alias>
+
+ <!-- This activity receives USB_DEVICE_ATTACHED intents and allows importing
+ media from attached MTP devices, like cameras and camera phones -->
+ <activity android:launchMode="singleInstance"
+ android:taskAffinity="" android:name="com.android.gallery3d.ingest.IngestActivity"
+ android:configChanges="orientation|screenSize"
+ android:label="@string/app_name">
+ <intent-filter>
+ <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
+ </intent-filter>
+ <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
+ android:resource="@xml/device_filter" />
+ </activity>
+ <service android:name="com.android.gallery3d.ingest.IngestService" />
+
+ <activity android:name="com.android.gallery3d.app.Wallpaper"
+ android:configChanges="keyboardHidden|orientation|screenSize"
+ android:theme="@style/android:Theme.Translucent.NoTitleBar">
+ <intent-filter android:label="@string/camera_setas_wallpaper">
+ <action android:name="android.intent.action.ATTACH_DATA" />
+ <data android:mimeType="image/*" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ <intent-filter android:label="@string/app_name">
+ <action android:name="android.intent.action.SET_WALLPAPER" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ <meta-data android:name="android.wallpaper.preview"
+ android:resource="@xml/wallpaper_picker_preview" />
+ </activity>
+ <activity android:name="com.android.gallery3d.app.TrimVideo"
+ android:label="@string/trim_label">
+ </activity>
+
+ <permission android:name="com.android.gallery3d.filtershow.permission.READ"
+ android:protectionLevel="signature" />
+
+ <permission android:name="com.android.gallery3d.filtershow.permission.WRITE"
+ android:protectionLevel="signature" />
+
+ <provider
+ android:name="com.android.gallery3d.filtershow.provider.SharedImageProvider"
+ android:authorities="com.android.gallery3d.filtershow.provider.SharedImageProvider"
+ android:grantUriPermissions="true"
+ android:readPermission="com.android.gallery3d.filtershow.permission.READ"
+ android:writePermission="com.android.gallery3d.filtershow.permission.WRITE" />
+
+ <service
+ android:name=".filtershow.pipeline.ProcessingService"
+ android:exported="false" />
+
+ <activity
+ android:name="com.android.gallery3d.filtershow.FilterShowActivity"
+ android:label="@string/title_activity_filter_show"
+ android:theme="@style/Theme.FilterShow"
+ android:configChanges="keyboardHidden|orientation|screenSize">
+ <intent-filter>
+ <action android:name="android.intent.action.EDIT" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <data android:mimeType="image/*" />
+ </intent-filter>
+ <intent-filter>
+ <action android:name="action_nextgen_edit" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <data android:mimeType="image/*" />
+ </intent-filter>
+ </activity>
+
+ <activity
+ android:name="com.android.gallery3d.filtershow.crop.CropActivity"
+ android:label="@string/crop"
+ android:theme="@style/Theme.FilterShow"
+ android:configChanges="keyboardHidden|orientation|screenSize">
+ <intent-filter android:label="@string/crop_label">
+ <action android:name="com.android.camera.action.CROP" />
+ <data android:scheme="http" />
+ <data android:scheme="https" />
+ <data android:scheme="content" />
+ <data android:scheme="file" />
+ <data android:scheme="" />
+ <data android:mimeType="image/*" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.ALTERNATIVE" />
+ <category android:name="android.intent.category.SELECTED_ALTERNATIVE" />
+ </intent-filter>
+ </activity>
+
+ <uses-library android:name="com.google.android.media.effects"
+ android:required="false" />
+
+ <activity android:name="com.android.gallery3d.settings.GallerySettings"
+ android:theme="@style/Theme.Gallery"
+ android:configChanges="orientation|keyboardHidden|screenSize" />
+
+ <provider android:name="com.android.gallery3d.provider.GalleryProvider"
+ android:syncable="false"
+ android:grantUriPermissions="true"
+ android:exported="true"
+ android:permission="com.android.gallery3d.permission.GALLERY_PROVIDER"
+ android:authorities="com.android.gallery3d.provider" />
+ <provider
+ android:name="com.android.photos.data.PhotoProvider"
+ android:authorities="com.android.gallery3d.photoprovider"
+ android:syncable="false"
+ android:exported="false"/>
+ <activity android:name="com.android.gallery3d.gadget.WidgetClickHandler" />
+ <activity android:name="com.android.gallery3d.app.DialogPicker"
+ android:configChanges="keyboardHidden|orientation|screenSize"
+ android:theme="@style/DialogPickerTheme"/>
+ <activity android:name="com.android.gallery3d.app.AlbumPicker"
+ android:configChanges="keyboardHidden|orientation|screenSize"
+ android:theme="@style/DialogPickerTheme"/>
+ <activity android:name="com.android.gallery3d.gadget.WidgetTypeChooser"
+ android:configChanges="keyboardHidden|orientation|screenSize"
+ android:theme="@style/Theme.Gallery.Dialog"/>
+ <activity android:name="com.android.camera.CameraActivity"
+ android:taskAffinity="com.android.camera.CameraActivity"
+ android:label="@string/camera_label"
+ android:theme="@style/Theme.Camera"
+ android:icon="@mipmap/ic_launcher_camera"
+ android:configChanges="orientation|screenSize|keyboardHidden"
+ android:clearTaskOnLaunch="true"
+ android:windowSoftInputMode="stateAlwaysHidden|adjustPan">
+ <intent-filter>
+ <action android:name="android.media.action.IMAGE_CAPTURE" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ <intent-filter>
+ <action android:name="android.media.action.STILL_IMAGE_CAMERA" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ <meta-data android:name="com.android.keyguard.layout"
+ android:resource="@layout/keyguard_widget" />
+ </activity>
+
+ <activity android:name="com.android.camera.SecureCameraActivity"
+ android:taskAffinity="com.android.camera.SecureCameraActivity"
+ android:excludeFromRecents="true"
+ android:label="@string/camera_label"
+ android:theme="@style/Theme.Camera"
+ android:icon="@mipmap/ic_launcher_camera"
+ android:configChanges="orientation|screenSize|keyboardHidden"
+ android:clearTaskOnLaunch="true"
+ android:windowSoftInputMode="stateAlwaysHidden|adjustPan">
+ <intent-filter>
+ <action android:name="android.media.action.STILL_IMAGE_CAMERA_SECURE" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ <intent-filter>
+ <action android:name="android.media.action.IMAGE_CAPTURE_SECURE" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ <meta-data android:name="com.android.keyguard.layout"
+ android:resource="@layout/keyguard_widget" />
+ </activity>
+
+ <activity-alias android:icon="@mipmap/ic_launcher_camera"
+ android:label="@string/camera_label"
+ android:name="com.android.camera.CameraLauncher"
+ android:targetActivity="com.android.camera.CameraActivity" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity-alias>
+
+ <activity-alias android:icon="@mipmap/ic_launcher_camera"
+ android:label="@string/camera_label"
+ android:name="com.android.camera.Camera"
+ android:targetActivity="com.android.camera.CameraActivity" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ </activity-alias>
+
+ <activity-alias android:icon="@mipmap/ic_launcher_video_camera"
+ android:label="@string/video_camera_label"
+ android:name="com.android.camera.VideoCamera"
+ android:targetActivity="com.android.camera.CameraActivity" >
+ <intent-filter>
+ <action android:name="android.media.action.VIDEO_CAMERA" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ <intent-filter>
+ <action android:name="android.media.action.VIDEO_CAPTURE" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ </activity-alias>
+
+ <receiver android:name="com.android.gallery3d.gadget.PhotoAppWidgetProvider"
+ android:label="@string/appwidget_title">
+ <intent-filter>
+ <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
+ </intent-filter>
+ <meta-data android:name="android.appwidget.provider"
+ android:resource="@xml/widget_info" />
+ </receiver>
+ <receiver android:name="com.android.gallery3d.app.PackagesMonitor">
+ <intent-filter>
+ <action android:name="android.intent.action.PACKAGE_ADDED"/>
+ <action android:name="android.intent.action.PACKAGE_REMOVED"/>
+ <action android:name="android.intent.action.PACKAGE_CHANGED"/>
+ <data android:scheme="package"/>
+ </intent-filter>
+ </receiver>
+ <service android:name="com.android.gallery3d.app.PackagesMonitor$AsyncService"/>
+ <receiver android:name="com.android.camera.CameraButtonIntentReceiver">
+ <intent-filter>
+ <action android:name="android.intent.action.CAMERA_BUTTON"/>
+ </intent-filter>
+ </receiver>
+ <receiver android:name="com.android.camera.DisableCameraReceiver">
+ <intent-filter>
+ <action android:name="android.intent.action.BOOT_COMPLETED" />
+ </intent-filter>
+ </receiver>
+ <service android:name="com.android.gallery3d.gadget.WidgetService"
+ android:permission="android.permission.BIND_REMOTEVIEWS"/>
+ <activity android:name="com.android.gallery3d.gadget.WidgetConfigure"
+ android:configChanges="keyboardHidden|orientation|screenSize"
+ android:theme="@style/android:Theme.Translucent.NoTitleBar">
+ <intent-filter>
+ <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
+ </intent-filter>
+ </activity>
+ <activity android:name="com.android.camera.ProxyLauncher"
+ android:theme="@style/Theme.ProxyLauncher">
+ </activity>
+ <service android:name="com.android.gallery3d.app.BatchService" />
+ <service android:name="com.android.camera.MediaSaveService" />
+ </application>
+</manifest>
diff --git a/CleanSpec.mk b/CleanSpec.mk
new file mode 100644
index 000000000..20db30919
--- /dev/null
+++ b/CleanSpec.mk
@@ -0,0 +1,56 @@
+# Copyright (C) 2007 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# If you don't need to do a full clean build but would like to touch
+# a file or delete some intermediate files, add a clean step to the end
+# of the list. These steps will only be run once, if they haven't been
+# run before.
+#
+# E.g.:
+# $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
+# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
+#
+# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
+# files that are missing or have been moved.
+#
+# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
+# Use $(OUT_DIR) to refer to the "out" directory.
+#
+# If you need to re-do something that's already mentioned, just copy
+# the command and add it to the bottom of the list. E.g., if a change
+# that you made last week required touching a file and a change you
+# made today requires touching the same file, just copy the old
+# touch step and add it to the end of the list.
+#
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
+
+# For example:
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
+#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
+#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/APPS/Camera*)
+$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Camera*)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/APPS/Gallery*)
+$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Gallery*)
+$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Gallery*)
+$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Gallery*)
+$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Gallery*)
+
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
diff --git a/gallerycommon/Android.mk b/gallerycommon/Android.mk
new file mode 100644
index 000000000..1d341472c
--- /dev/null
+++ b/gallerycommon/Android.mk
@@ -0,0 +1,27 @@
+# Copyright 2011, The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH := $(call my-dir)
+
+# Build the com.android.emailcommon static library. At the moment, this includes
+# the emailcommon files themselves plus everything under src/org (apache code). All of our
+# AIDL files are also compiled into the static library
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := com.android.gallery3d.common2
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+LOCAL_SDK_VERSION := 16
+
+include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
new file mode 100644
index 000000000..f4de5c9ff
--- /dev/null
+++ b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
@@ -0,0 +1,234 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.gallery3d.common;
+
+import android.app.admin.DevicePolicyManager;
+import android.content.ComponentName;
+import android.hardware.Camera;
+import android.os.Build;
+import android.provider.MediaStore.MediaColumns;
+import android.view.View;
+import android.view.WindowManager;
+
+import java.lang.reflect.Field;
+
+public class ApiHelper {
+ public static interface VERSION_CODES {
+ // These value are copied from Build.VERSION_CODES
+ public static final int GINGERBREAD_MR1 = 10;
+ public static final int HONEYCOMB = 11;
+ public static final int HONEYCOMB_MR1 = 12;
+ public static final int HONEYCOMB_MR2 = 13;
+ public static final int ICE_CREAM_SANDWICH = 14;
+ public static final int ICE_CREAM_SANDWICH_MR1 = 15;
+ public static final int JELLY_BEAN = 16;
+ public static final int JELLY_BEAN_MR1 = 17;
+ public static final int JELLY_BEAN_MR2 = 18;
+ }
+
+ public static final boolean AT_LEAST_16 = Build.VERSION.SDK_INT >= 16;
+
+ public static final boolean USE_888_PIXEL_FORMAT =
+ Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN;
+
+ public static final boolean ENABLE_PHOTO_EDITOR =
+ Build.VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH;
+
+ public static final boolean HAS_VIEW_SYSTEM_UI_FLAG_LAYOUT_STABLE =
+ hasField(View.class, "SYSTEM_UI_FLAG_LAYOUT_STABLE");
+
+ public static final boolean HAS_VIEW_SYSTEM_UI_FLAG_HIDE_NAVIGATION =
+ hasField(View.class, "SYSTEM_UI_FLAG_HIDE_NAVIGATION");
+
+ public static final boolean HAS_MEDIA_COLUMNS_WIDTH_AND_HEIGHT =
+ hasField(MediaColumns.class, "WIDTH");
+
+ public static final boolean HAS_REUSING_BITMAP_IN_BITMAP_REGION_DECODER =
+ Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN;
+
+ public static final boolean HAS_REUSING_BITMAP_IN_BITMAP_FACTORY =
+ Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
+
+ public static final boolean HAS_SET_BEAM_PUSH_URIS =
+ Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN;
+
+ public static final boolean HAS_SET_DEFALT_BUFFER_SIZE = hasMethod(
+ "android.graphics.SurfaceTexture", "setDefaultBufferSize",
+ int.class, int.class);
+
+ public static final boolean HAS_RELEASE_SURFACE_TEXTURE = hasMethod(
+ "android.graphics.SurfaceTexture", "release");
+
+ public static final boolean HAS_SURFACE_TEXTURE =
+ Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
+
+ public static final boolean HAS_MTP =
+ Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB_MR1;
+
+ public static final boolean HAS_AUTO_FOCUS_MOVE_CALLBACK =
+ Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN;
+
+ public static final boolean HAS_REMOTE_VIEWS_SERVICE =
+ Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
+
+ public static final boolean HAS_INTENT_EXTRA_LOCAL_ONLY =
+ Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
+
+ public static final boolean HAS_SET_SYSTEM_UI_VISIBILITY =
+ hasMethod(View.class, "setSystemUiVisibility", int.class);
+
+ public static final boolean HAS_FACE_DETECTION;
+ static {
+ boolean hasFaceDetection = false;
+ try {
+ Class<?> listenerClass = Class.forName(
+ "android.hardware.Camera$FaceDetectionListener");
+ hasFaceDetection =
+ hasMethod(Camera.class, "setFaceDetectionListener", listenerClass) &&
+ hasMethod(Camera.class, "startFaceDetection") &&
+ hasMethod(Camera.class, "stopFaceDetection") &&
+ hasMethod(Camera.Parameters.class, "getMaxNumDetectedFaces");
+ } catch (Throwable t) {
+ }
+ HAS_FACE_DETECTION = hasFaceDetection;
+ }
+
+ public static final boolean HAS_GET_CAMERA_DISABLED =
+ hasMethod(DevicePolicyManager.class, "getCameraDisabled", ComponentName.class);
+
+ public static final boolean HAS_MEDIA_ACTION_SOUND =
+ Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN;
+
+ public static final boolean HAS_TIME_LAPSE_RECORDING =
+ Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
+
+ public static final boolean HAS_ZOOM_WHEN_RECORDING =
+ Build.VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH;
+
+ public static final boolean HAS_CAMERA_FOCUS_AREA =
+ Build.VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH;
+
+ public static final boolean HAS_CAMERA_METERING_AREA =
+ Build.VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH;
+
+ public static final boolean HAS_MOTION_EVENT_TRANSFORM =
+ Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
+
+ public static final boolean HAS_EFFECTS_RECORDING = false;
+
+ // "Background" filter does not have "context" input port in jelly bean.
+ public static final boolean HAS_EFFECTS_RECORDING_CONTEXT_INPUT =
+ Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR1;
+
+ public static final boolean HAS_GET_SUPPORTED_VIDEO_SIZE =
+ Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
+
+ public static final boolean HAS_SET_ICON_ATTRIBUTE =
+ Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
+
+ public static final boolean HAS_MEDIA_PROVIDER_FILES_TABLE =
+ Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
+
+ public static final boolean HAS_SURFACE_TEXTURE_RECORDING =
+ Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN;
+
+ public static final boolean HAS_ACTION_BAR =
+ Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
+
+ // Ex: View.setTranslationX.
+ public static final boolean HAS_VIEW_TRANSFORM_PROPERTIES =
+ Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
+
+ public static final boolean HAS_CAMERA_HDR =
+ Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR1;
+
+ public static final boolean HAS_OPTIONS_IN_MUTABLE =
+ Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
+
+ public static final boolean CAN_START_PREVIEW_IN_JPEG_CALLBACK =
+ Build.VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH;
+
+ public static final boolean HAS_VIEW_PROPERTY_ANIMATOR =
+ Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB_MR1;
+
+ public static final boolean HAS_POST_ON_ANIMATION =
+ Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN;
+
+ public static final boolean HAS_ANNOUNCE_FOR_ACCESSIBILITY =
+ Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN;
+
+ public static final boolean HAS_OBJECT_ANIMATION =
+ Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
+
+ public static final boolean HAS_GLES20_REQUIRED =
+ Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
+
+ public static final boolean HAS_ROTATION_ANIMATION =
+ hasField(WindowManager.LayoutParams.class, "rotationAnimation");
+
+ public static final boolean HAS_ORIENTATION_LOCK =
+ Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR2;
+
+ public static final boolean HAS_CANCELLATION_SIGNAL =
+ Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN;
+
+ public static final boolean HAS_MEDIA_MUXER =
+ Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR2;
+
+ public static final boolean HAS_DISPLAY_LISTENER =
+ Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR1;
+
+ public static int getIntFieldIfExists(Class<?> klass, String fieldName,
+ Class<?> obj, int defaultVal) {
+ try {
+ Field f = klass.getDeclaredField(fieldName);
+ return f.getInt(obj);
+ } catch (Exception e) {
+ return defaultVal;
+ }
+ }
+
+ private static boolean hasField(Class<?> klass, String fieldName) {
+ try {
+ klass.getDeclaredField(fieldName);
+ return true;
+ } catch (NoSuchFieldException e) {
+ return false;
+ }
+ }
+
+ private static boolean hasMethod(String className, String methodName,
+ Class<?>... parameterTypes) {
+ try {
+ Class<?> klass = Class.forName(className);
+ klass.getDeclaredMethod(methodName, parameterTypes);
+ return true;
+ } catch (Throwable th) {
+ return false;
+ }
+ }
+
+ private static boolean hasMethod(
+ Class<?> klass, String methodName, Class<?> ... paramTypes) {
+ try {
+ klass.getDeclaredMethod(methodName, paramTypes);
+ return true;
+ } catch (NoSuchMethodException e) {
+ return false;
+ }
+ }
+}
diff --git a/gallerycommon/src/com/android/gallery3d/common/AsyncTaskUtil.java b/gallerycommon/src/com/android/gallery3d/common/AsyncTaskUtil.java
new file mode 100644
index 000000000..b70c4d365
--- /dev/null
+++ b/gallerycommon/src/com/android/gallery3d/common/AsyncTaskUtil.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.gallery3d.common;
+
+import android.os.AsyncTask;
+import android.os.Build;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.concurrent.Executor;
+
+/**
+ * Helper class to execute an AsyncTask in parallel if SDK version is 11 or newer.
+ */
+public class AsyncTaskUtil {
+ private static Method sMethodExecuteOnExecutor;
+ private static Executor sExecutor;
+ static {
+ if (Build.VERSION.SDK_INT >= 11) {
+ try {
+ sExecutor = (Executor) AsyncTask.class.getField("THREAD_POOL_EXECUTOR")
+ .get(null);
+ sMethodExecuteOnExecutor = AsyncTask.class.getMethod(
+ "executeOnExecutor", Executor.class, Object[].class);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ } catch (NoSuchFieldException e) {
+ throw new RuntimeException(e);
+ } catch (NoSuchMethodException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ public static <Param> void executeInParallel(AsyncTask<Param, ?, ?> task, Param... params) {
+ if (Build.VERSION.SDK_INT < 11) {
+ task.execute(params);
+ } else {
+ try {
+ sMethodExecuteOnExecutor.invoke(task, sExecutor, params);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ private AsyncTaskUtil() {
+ }
+}
+
diff --git a/gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java b/gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java
new file mode 100644
index 000000000..a671ed2b9
--- /dev/null
+++ b/gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java
@@ -0,0 +1,260 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.gallery3d.common;
+
+import android.graphics.Bitmap;
+import android.graphics.Bitmap.CompressFormat;
+import android.graphics.BitmapFactory;
+import android.graphics.Canvas;
+import android.graphics.Matrix;
+import android.graphics.Paint;
+import android.os.Build;
+import android.util.FloatMath;
+import android.util.Log;
+
+import java.io.ByteArrayOutputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+public class BitmapUtils {
+ private static final String TAG = "BitmapUtils";
+ private static final int DEFAULT_JPEG_QUALITY = 90;
+ public static final int UNCONSTRAINED = -1;
+
+ private BitmapUtils(){}
+
+ /*
+ * Compute the sample size as a function of minSideLength
+ * and maxNumOfPixels.
+ * minSideLength is used to specify that minimal width or height of a
+ * bitmap.
+ * maxNumOfPixels is used to specify the maximal size in pixels that is
+ * tolerable in terms of memory usage.
+ *
+ * The function returns a sample size based on the constraints.
+ * Both size and minSideLength can be passed in as UNCONSTRAINED,
+ * which indicates no care of the corresponding constraint.
+ * The functions prefers returning a sample size that
+ * generates a smaller bitmap, unless minSideLength = UNCONSTRAINED.
+ *
+ * Also, the function rounds up the sample size to a power of 2 or multiple
+ * of 8 because BitmapFactory only honors sample size this way.
+ * For example, BitmapFactory downsamples an image by 2 even though the
+ * request is 3. So we round up the sample size to avoid OOM.
+ */
+ public static int computeSampleSize(int width, int height,
+ int minSideLength, int maxNumOfPixels) {
+ int initialSize = computeInitialSampleSize(
+ width, height, minSideLength, maxNumOfPixels);
+
+ return initialSize <= 8
+ ? Utils.nextPowerOf2(initialSize)
+ : (initialSize + 7) / 8 * 8;
+ }
+
+ private static int computeInitialSampleSize(int w, int h,
+ int minSideLength, int maxNumOfPixels) {
+ if (maxNumOfPixels == UNCONSTRAINED
+ && minSideLength == UNCONSTRAINED) return 1;
+
+ int lowerBound = (maxNumOfPixels == UNCONSTRAINED) ? 1 :
+ (int) FloatMath.ceil(FloatMath.sqrt((float) (w * h) / maxNumOfPixels));
+
+ if (minSideLength == UNCONSTRAINED) {
+ return lowerBound;
+ } else {
+ int sampleSize = Math.min(w / minSideLength, h / minSideLength);
+ return Math.max(sampleSize, lowerBound);
+ }
+ }
+
+ // This computes a sample size which makes the longer side at least
+ // minSideLength long. If that's not possible, return 1.
+ public static int computeSampleSizeLarger(int w, int h,
+ int minSideLength) {
+ int initialSize = Math.max(w / minSideLength, h / minSideLength);
+ if (initialSize <= 1) return 1;
+
+ return initialSize <= 8
+ ? Utils.prevPowerOf2(initialSize)
+ : initialSize / 8 * 8;
+ }
+
+ // Find the min x that 1 / x >= scale
+ public static int computeSampleSizeLarger(float scale) {
+ int initialSize = (int) FloatMath.floor(1f / scale);
+ if (initialSize <= 1) return 1;
+
+ return initialSize <= 8
+ ? Utils.prevPowerOf2(initialSize)
+ : initialSize / 8 * 8;
+ }
+
+ // Find the max x that 1 / x <= scale.
+ public static int computeSampleSize(float scale) {
+ Utils.assertTrue(scale > 0);
+ int initialSize = Math.max(1, (int) FloatMath.ceil(1 / scale));
+ return initialSize <= 8
+ ? Utils.nextPowerOf2(initialSize)
+ : (initialSize + 7) / 8 * 8;
+ }
+
+ public static Bitmap resizeBitmapByScale(
+ Bitmap bitmap, float scale, boolean recycle) {
+ int width = Math.round(bitmap.getWidth() * scale);
+ int height = Math.round(bitmap.getHeight() * scale);
+ if (width == bitmap.getWidth()
+ && height == bitmap.getHeight()) return bitmap;
+ Bitmap target = Bitmap.createBitmap(width, height, getConfig(bitmap));
+ Canvas canvas = new Canvas(target);
+ canvas.scale(scale, scale);
+ Paint paint = new Paint(Paint.FILTER_BITMAP_FLAG | Paint.DITHER_FLAG);
+ canvas.drawBitmap(bitmap, 0, 0, paint);
+ if (recycle) bitmap.recycle();
+ return target;
+ }
+
+ private static Bitmap.Config getConfig(Bitmap bitmap) {
+ Bitmap.Config config = bitmap.getConfig();
+ if (config == null) {
+ config = Bitmap.Config.ARGB_8888;
+ }
+ return config;
+ }
+
+ public static Bitmap resizeDownBySideLength(
+ Bitmap bitmap, int maxLength, boolean recycle) {
+ int srcWidth = bitmap.getWidth();
+ int srcHeight = bitmap.getHeight();
+ float scale = Math.min(
+ (float) maxLength / srcWidth, (float) maxLength / srcHeight);
+ if (scale >= 1.0f) return bitmap;
+ return resizeBitmapByScale(bitmap, scale, recycle);
+ }
+
+ public static Bitmap resizeAndCropCenter(Bitmap bitmap, int size, boolean recycle) {
+ int w = bitmap.getWidth();
+ int h = bitmap.getHeight();
+ if (w == size && h == size) return bitmap;
+
+ // scale the image so that the shorter side equals to the target;
+ // the longer side will be center-cropped.
+ float scale = (float) size / Math.min(w, h);
+
+ Bitmap target = Bitmap.createBitmap(size, size, getConfig(bitmap));
+ int width = Math.round(scale * bitmap.getWidth());
+ int height = Math.round(scale * bitmap.getHeight());
+ Canvas canvas = new Canvas(target);
+ canvas.translate((size - width) / 2f, (size - height) / 2f);
+ canvas.scale(scale, scale);
+ Paint paint = new Paint(Paint.FILTER_BITMAP_FLAG | Paint.DITHER_FLAG);
+ canvas.drawBitmap(bitmap, 0, 0, paint);
+ if (recycle) bitmap.recycle();
+ return target;
+ }
+
+ public static void recycleSilently(Bitmap bitmap) {
+ if (bitmap == null) return;
+ try {
+ bitmap.recycle();
+ } catch (Throwable t) {
+ Log.w(TAG, "unable recycle bitmap", t);
+ }
+ }
+
+ public static Bitmap rotateBitmap(Bitmap source, int rotation, boolean recycle) {
+ if (rotation == 0) return source;
+ int w = source.getWidth();
+ int h = source.getHeight();
+ Matrix m = new Matrix();
+ m.postRotate(rotation);
+ Bitmap bitmap = Bitmap.createBitmap(source, 0, 0, w, h, m, true);
+ if (recycle) source.recycle();
+ return bitmap;
+ }
+
+ public static Bitmap createVideoThumbnail(String filePath) {
+ // MediaMetadataRetriever is available on API Level 8
+ // but is hidden until API Level 10
+ Class<?> clazz = null;
+ Object instance = null;
+ try {
+ clazz = Class.forName("android.media.MediaMetadataRetriever");
+ instance = clazz.newInstance();
+
+ Method method = clazz.getMethod("setDataSource", String.class);
+ method.invoke(instance, filePath);
+
+ // The method name changes between API Level 9 and 10.
+ if (Build.VERSION.SDK_INT <= 9) {
+ return (Bitmap) clazz.getMethod("captureFrame").invoke(instance);
+ } else {
+ byte[] data = (byte[]) clazz.getMethod("getEmbeddedPicture").invoke(instance);
+ if (data != null) {
+ Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
+ if (bitmap != null) return bitmap;
+ }
+ return (Bitmap) clazz.getMethod("getFrameAtTime").invoke(instance);
+ }
+ } catch (IllegalArgumentException ex) {
+ // Assume this is a corrupt video file
+ } catch (RuntimeException ex) {
+ // Assume this is a corrupt video file.
+ } catch (InstantiationException e) {
+ Log.e(TAG, "createVideoThumbnail", e);
+ } catch (InvocationTargetException e) {
+ Log.e(TAG, "createVideoThumbnail", e);
+ } catch (ClassNotFoundException e) {
+ Log.e(TAG, "createVideoThumbnail", e);
+ } catch (NoSuchMethodException e) {
+ Log.e(TAG, "createVideoThumbnail", e);
+ } catch (IllegalAccessException e) {
+ Log.e(TAG, "createVideoThumbnail", e);
+ } finally {
+ try {
+ if (instance != null) {
+ clazz.getMethod("release").invoke(instance);
+ }
+ } catch (Exception ignored) {
+ }
+ }
+ return null;
+ }
+
+ public static byte[] compressToBytes(Bitmap bitmap) {
+ return compressToBytes(bitmap, DEFAULT_JPEG_QUALITY);
+ }
+
+ public static byte[] compressToBytes(Bitmap bitmap, int quality) {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(65536);
+ bitmap.compress(CompressFormat.JPEG, quality, baos);
+ return baos.toByteArray();
+ }
+
+ public static boolean isSupportedByRegionDecoder(String mimeType) {
+ if (mimeType == null) return false;
+ mimeType = mimeType.toLowerCase();
+ return mimeType.startsWith("image/") &&
+ (!mimeType.equals("image/gif") && !mimeType.endsWith("bmp"));
+ }
+
+ public static boolean isRotationSupported(String mimeType) {
+ if (mimeType == null) return false;
+ mimeType = mimeType.toLowerCase();
+ return mimeType.equals("image/jpeg");
+ }
+}
diff --git a/gallerycommon/src/com/android/gallery3d/common/BlobCache.java b/gallerycommon/src/com/android/gallery3d/common/BlobCache.java
new file mode 100644
index 000000000..3c131e591
--- /dev/null
+++ b/gallerycommon/src/com/android/gallery3d/common/BlobCache.java
@@ -0,0 +1,668 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// This is an on-disk cache which maps a 64-bits key to a byte array.
+//
+// It consists of three files: one index file and two data files. One of the
+// data files is "active", and the other is "inactive". New entries are
+// appended into the active region until it reaches the size limit. At that
+// point the active file and the inactive file are swapped, and the new active
+// file is truncated to empty (and the index for that file is also cleared).
+// The index is a hash table with linear probing. When the load factor reaches
+// 0.5, it does the same thing like when the size limit is reached.
+//
+// The index file format: (all numbers are stored in little-endian)
+// [0] Magic number: 0xB3273030
+// [4] MaxEntries: Max number of hash entries per region.
+// [8] MaxBytes: Max number of data bytes per region (including header).
+// [12] ActiveRegion: The active growing region: 0 or 1.
+// [16] ActiveEntries: The number of hash entries used in the active region.
+// [20] ActiveBytes: The number of data bytes used in the active region.
+// [24] Version number.
+// [28] Checksum of [0..28).
+// [32] Hash entries for region 0. The size is X = (12 * MaxEntries bytes).
+// [32 + X] Hash entries for region 1. The size is also X.
+//
+// Each hash entry is 12 bytes: 8 bytes key and 4 bytes offset into the data
+// file. The offset is 0 when the slot is free. Note that 0 is a valid value
+// for key. The keys are used directly as index into a hash table, so they
+// should be suitably distributed.
+//
+// Each data file stores data for one region. The data file is concatenated
+// blobs followed by the magic number 0xBD248510.
+//
+// The blob format:
+// [0] Key of this blob
+// [8] Checksum of this blob
+// [12] Offset of this blob
+// [16] Length of this blob (not including header)
+// [20] Blob
+//
+// Below are the interface for BlobCache. The instance of this class does not
+// support concurrent use by multiple threads.
+//
+// public BlobCache(String path, int maxEntries, int maxBytes, boolean reset) throws IOException;
+// public void insert(long key, byte[] data) throws IOException;
+// public byte[] lookup(long key) throws IOException;
+// public void lookup(LookupRequest req) throws IOException;
+// public void close();
+// public void syncIndex();
+// public void syncAll();
+// public static void deleteFiles(String path);
+//
+package com.android.gallery3d.common;
+
+import android.util.Log;
+
+import java.io.Closeable;
+import java.io.File;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.nio.ByteOrder;
+import java.nio.MappedByteBuffer;
+import java.nio.channels.FileChannel;
+import java.util.Arrays;
+import java.util.zip.Adler32;
+
+public class BlobCache implements Closeable {
+ private static final String TAG = "BlobCache";
+
+ private static final int MAGIC_INDEX_FILE = 0xB3273030;
+ private static final int MAGIC_DATA_FILE = 0xBD248510;
+
+ // index header offset
+ private static final int IH_MAGIC = 0;
+ private static final int IH_MAX_ENTRIES = 4;
+ private static final int IH_MAX_BYTES = 8;
+ private static final int IH_ACTIVE_REGION = 12;
+ private static final int IH_ACTIVE_ENTRIES = 16;
+ private static final int IH_ACTIVE_BYTES = 20;
+ private static final int IH_VERSION = 24;
+ private static final int IH_CHECKSUM = 28;
+ private static final int INDEX_HEADER_SIZE = 32;
+
+ private static final int DATA_HEADER_SIZE = 4;
+
+ // blob header offset
+ private static final int BH_KEY = 0;
+ private static final int BH_CHECKSUM = 8;
+ private static final int BH_OFFSET = 12;
+ private static final int BH_LENGTH = 16;
+ private static final int BLOB_HEADER_SIZE = 20;
+
+ private RandomAccessFile mIndexFile;
+ private RandomAccessFile mDataFile0;
+ private RandomAccessFile mDataFile1;
+ private FileChannel mIndexChannel;
+ private MappedByteBuffer mIndexBuffer;
+
+ private int mMaxEntries;
+ private int mMaxBytes;
+ private int mActiveRegion;
+ private int mActiveEntries;
+ private int mActiveBytes;
+ private int mVersion;
+
+ private RandomAccessFile mActiveDataFile;
+ private RandomAccessFile mInactiveDataFile;
+ private int mActiveHashStart;
+ private int mInactiveHashStart;
+ private byte[] mIndexHeader = new byte[INDEX_HEADER_SIZE];
+ private byte[] mBlobHeader = new byte[BLOB_HEADER_SIZE];
+ private Adler32 mAdler32 = new Adler32();
+
+ // Creates the cache. Three files will be created:
+ // path + ".idx", path + ".0", and path + ".1"
+ // The ".0" file and the ".1" file each stores data for a region. Each of
+ // them can grow to the size specified by maxBytes. The maxEntries parameter
+ // specifies the maximum number of entries each region can have. If the
+ // "reset" parameter is true, the cache will be cleared before use.
+ public BlobCache(String path, int maxEntries, int maxBytes, boolean reset)
+ throws IOException {
+ this(path, maxEntries, maxBytes, reset, 0);
+ }
+
+ public BlobCache(String path, int maxEntries, int maxBytes, boolean reset,
+ int version) throws IOException {
+ mIndexFile = new RandomAccessFile(path + ".idx", "rw");
+ mDataFile0 = new RandomAccessFile(path + ".0", "rw");
+ mDataFile1 = new RandomAccessFile(path + ".1", "rw");
+ mVersion = version;
+
+ if (!reset && loadIndex()) {
+ return;
+ }
+
+ resetCache(maxEntries, maxBytes);
+
+ if (!loadIndex()) {
+ closeAll();
+ throw new IOException("unable to load index");
+ }
+ }
+
+ // Delete the files associated with the given path previously created
+ // by the BlobCache constructor.
+ public static void deleteFiles(String path) {
+ deleteFileSilently(path + ".idx");
+ deleteFileSilently(path + ".0");
+ deleteFileSilently(path + ".1");
+ }
+
+ private static void deleteFileSilently(String path) {
+ try {
+ new File(path).delete();
+ } catch (Throwable t) {
+ // ignore;
+ }
+ }
+
+ // Close the cache. All resources are released. No other method should be
+ // called after this is called.
+ @Override
+ public void close() {
+ syncAll();
+ closeAll();
+ }
+
+ private void closeAll() {
+ closeSilently(mIndexChannel);
+ closeSilently(mIndexFile);
+ closeSilently(mDataFile0);
+ closeSilently(mDataFile1);
+ }
+
+ // Returns true if loading index is successful. After this method is called,
+ // mIndexHeader and index header in file should be kept sync.
+ private boolean loadIndex() {
+ try {
+ mIndexFile.seek(0);
+ mDataFile0.seek(0);
+ mDataFile1.seek(0);
+
+ byte[] buf = mIndexHeader;
+ if (mIndexFile.read(buf) != INDEX_HEADER_SIZE) {
+ Log.w(TAG, "cannot read header");
+ return false;
+ }
+
+ if (readInt(buf, IH_MAGIC) != MAGIC_INDEX_FILE) {
+ Log.w(TAG, "cannot read header magic");
+ return false;
+ }
+
+ if (readInt(buf, IH_VERSION) != mVersion) {
+ Log.w(TAG, "version mismatch");
+ return false;
+ }
+
+ mMaxEntries = readInt(buf, IH_MAX_ENTRIES);
+ mMaxBytes = readInt(buf, IH_MAX_BYTES);
+ mActiveRegion = readInt(buf, IH_ACTIVE_REGION);
+ mActiveEntries = readInt(buf, IH_ACTIVE_ENTRIES);
+ mActiveBytes = readInt(buf, IH_ACTIVE_BYTES);
+
+ int sum = readInt(buf, IH_CHECKSUM);
+ if (checkSum(buf, 0, IH_CHECKSUM) != sum) {
+ Log.w(TAG, "header checksum does not match");
+ return false;
+ }
+
+ // Sanity check
+ if (mMaxEntries <= 0) {
+ Log.w(TAG, "invalid max entries");
+ return false;
+ }
+ if (mMaxBytes <= 0) {
+ Log.w(TAG, "invalid max bytes");
+ return false;
+ }
+ if (mActiveRegion != 0 && mActiveRegion != 1) {
+ Log.w(TAG, "invalid active region");
+ return false;
+ }
+ if (mActiveEntries < 0 || mActiveEntries > mMaxEntries) {
+ Log.w(TAG, "invalid active entries");
+ return false;
+ }
+ if (mActiveBytes < DATA_HEADER_SIZE || mActiveBytes > mMaxBytes) {
+ Log.w(TAG, "invalid active bytes");
+ return false;
+ }
+ if (mIndexFile.length() !=
+ INDEX_HEADER_SIZE + mMaxEntries * 12 * 2) {
+ Log.w(TAG, "invalid index file length");
+ return false;
+ }
+
+ // Make sure data file has magic
+ byte[] magic = new byte[4];
+ if (mDataFile0.read(magic) != 4) {
+ Log.w(TAG, "cannot read data file magic");
+ return false;
+ }
+ if (readInt(magic, 0) != MAGIC_DATA_FILE) {
+ Log.w(TAG, "invalid data file magic");
+ return false;
+ }
+ if (mDataFile1.read(magic) != 4) {
+ Log.w(TAG, "cannot read data file magic");
+ return false;
+ }
+ if (readInt(magic, 0) != MAGIC_DATA_FILE) {
+ Log.w(TAG, "invalid data file magic");
+ return false;
+ }
+
+ // Map index file to memory
+ mIndexChannel = mIndexFile.getChannel();
+ mIndexBuffer = mIndexChannel.map(FileChannel.MapMode.READ_WRITE,
+ 0, mIndexFile.length());
+ mIndexBuffer.order(ByteOrder.LITTLE_ENDIAN);
+
+ setActiveVariables();
+ return true;
+ } catch (IOException ex) {
+ Log.e(TAG, "loadIndex failed.", ex);
+ return false;
+ }
+ }
+
+ private void setActiveVariables() throws IOException {
+ mActiveDataFile = (mActiveRegion == 0) ? mDataFile0 : mDataFile1;
+ mInactiveDataFile = (mActiveRegion == 1) ? mDataFile0 : mDataFile1;
+ mActiveDataFile.setLength(mActiveBytes);
+ mActiveDataFile.seek(mActiveBytes);
+
+ mActiveHashStart = INDEX_HEADER_SIZE;
+ mInactiveHashStart = INDEX_HEADER_SIZE;
+
+ if (mActiveRegion == 0) {
+ mInactiveHashStart += mMaxEntries * 12;
+ } else {
+ mActiveHashStart += mMaxEntries * 12;
+ }
+ }
+
+ private void resetCache(int maxEntries, int maxBytes) throws IOException {
+ mIndexFile.setLength(0); // truncate to zero the index
+ mIndexFile.setLength(INDEX_HEADER_SIZE + maxEntries * 12 * 2);
+ mIndexFile.seek(0);
+ byte[] buf = mIndexHeader;
+ writeInt(buf, IH_MAGIC, MAGIC_INDEX_FILE);
+ writeInt(buf, IH_MAX_ENTRIES, maxEntries);
+ writeInt(buf, IH_MAX_BYTES, maxBytes);
+ writeInt(buf, IH_ACTIVE_REGION, 0);
+ writeInt(buf, IH_ACTIVE_ENTRIES, 0);
+ writeInt(buf, IH_ACTIVE_BYTES, DATA_HEADER_SIZE);
+ writeInt(buf, IH_VERSION, mVersion);
+ writeInt(buf, IH_CHECKSUM, checkSum(buf, 0, IH_CHECKSUM));
+ mIndexFile.write(buf);
+ // This is only needed if setLength does not zero the extended part.
+ // writeZero(mIndexFile, maxEntries * 12 * 2);
+
+ mDataFile0.setLength(0);
+ mDataFile1.setLength(0);
+ mDataFile0.seek(0);
+ mDataFile1.seek(0);
+ writeInt(buf, 0, MAGIC_DATA_FILE);
+ mDataFile0.write(buf, 0, 4);
+ mDataFile1.write(buf, 0, 4);
+ }
+
+ // Flip the active region and the inactive region.
+ private void flipRegion() throws IOException {
+ mActiveRegion = 1 - mActiveRegion;
+ mActiveEntries = 0;
+ mActiveBytes = DATA_HEADER_SIZE;
+
+ writeInt(mIndexHeader, IH_ACTIVE_REGION, mActiveRegion);
+ writeInt(mIndexHeader, IH_ACTIVE_ENTRIES, mActiveEntries);
+ writeInt(mIndexHeader, IH_ACTIVE_BYTES, mActiveBytes);
+ updateIndexHeader();
+
+ setActiveVariables();
+ clearHash(mActiveHashStart);
+ syncIndex();
+ }
+
+ // Sync mIndexHeader to the index file.
+ private void updateIndexHeader() {
+ writeInt(mIndexHeader, IH_CHECKSUM,
+ checkSum(mIndexHeader, 0, IH_CHECKSUM));
+ mIndexBuffer.position(0);
+ mIndexBuffer.put(mIndexHeader);
+ }
+
+ // Clear the hash table starting from the specified offset.
+ private void clearHash(int hashStart) {
+ byte[] zero = new byte[1024];
+ mIndexBuffer.position(hashStart);
+ for (int count = mMaxEntries * 12; count > 0;) {
+ int todo = Math.min(count, 1024);
+ mIndexBuffer.put(zero, 0, todo);
+ count -= todo;
+ }
+ }
+
+ // Inserts a (key, data) pair into the cache.
+ public void insert(long key, byte[] data) throws IOException {
+ if (DATA_HEADER_SIZE + BLOB_HEADER_SIZE + data.length > mMaxBytes) {
+ throw new RuntimeException("blob is too large!");
+ }
+
+ if (mActiveBytes + BLOB_HEADER_SIZE + data.length > mMaxBytes
+ || mActiveEntries * 2 >= mMaxEntries) {
+ flipRegion();
+ }
+
+ if (!lookupInternal(key, mActiveHashStart)) {
+ // If we don't have an existing entry with the same key, increase
+ // the entry count.
+ mActiveEntries++;
+ writeInt(mIndexHeader, IH_ACTIVE_ENTRIES, mActiveEntries);
+ }
+
+ insertInternal(key, data, data.length);
+ updateIndexHeader();
+ }
+
+ public void clearEntry(long key) throws IOException {
+ if (!lookupInternal(key, mActiveHashStart)) {
+ return; // Nothing to clear
+ }
+ byte[] header = mBlobHeader;
+ Arrays.fill(header, (byte) 0);
+ mActiveDataFile.seek(mFileOffset);
+ mActiveDataFile.write(header);
+ }
+
+ // Appends the data to the active file. It also updates the hash entry.
+ // The proper hash entry (suitable for insertion or replacement) must be
+ // pointed by mSlotOffset.
+ private void insertInternal(long key, byte[] data, int length)
+ throws IOException {
+ byte[] header = mBlobHeader;
+ int sum = checkSum(data);
+ writeLong(header, BH_KEY, key);
+ writeInt(header, BH_CHECKSUM, sum);
+ writeInt(header, BH_OFFSET, mActiveBytes);
+ writeInt(header, BH_LENGTH, length);
+ mActiveDataFile.write(header);
+ mActiveDataFile.write(data, 0, length);
+
+ mIndexBuffer.putLong(mSlotOffset, key);
+ mIndexBuffer.putInt(mSlotOffset + 8, mActiveBytes);
+ mActiveBytes += BLOB_HEADER_SIZE + length;
+ writeInt(mIndexHeader, IH_ACTIVE_BYTES, mActiveBytes);
+ }
+
+ public static class LookupRequest {
+ public long key; // input: the key to find
+ public byte[] buffer; // input/output: the buffer to store the blob
+ public int length; // output: the length of the blob
+ }
+
+ // This method is for one-off lookup. For repeated lookup, use the version
+ // accepting LookupRequest to avoid repeated memory allocation.
+ private LookupRequest mLookupRequest = new LookupRequest();
+ public byte[] lookup(long key) throws IOException {
+ mLookupRequest.key = key;
+ mLookupRequest.buffer = null;
+ if (lookup(mLookupRequest)) {
+ return mLookupRequest.buffer;
+ } else {
+ return null;
+ }
+ }
+
+ // Returns true if the associated blob for the given key is available.
+ // The blob is stored in the buffer pointed by req.buffer, and the length
+ // is in stored in the req.length variable.
+ //
+ // The user can input a non-null value in req.buffer, and this method will
+ // try to use that buffer. If that buffer is not large enough, this method
+ // will allocate a new buffer and assign it to req.buffer.
+ //
+ // This method tries not to throw IOException even if the data file is
+ // corrupted, but it can still throw IOException if things get strange.
+ public boolean lookup(LookupRequest req) throws IOException {
+ // Look up in the active region first.
+ if (lookupInternal(req.key, mActiveHashStart)) {
+ if (getBlob(mActiveDataFile, mFileOffset, req)) {
+ return true;
+ }
+ }
+
+ // We want to copy the data from the inactive file to the active file
+ // if it's available. So we keep the offset of the hash entry so we can
+ // avoid looking it up again.
+ int insertOffset = mSlotOffset;
+
+ // Look up in the inactive region.
+ if (lookupInternal(req.key, mInactiveHashStart)) {
+ if (getBlob(mInactiveDataFile, mFileOffset, req)) {
+ // If we don't have enough space to insert this blob into
+ // the active file, just return it.
+ if (mActiveBytes + BLOB_HEADER_SIZE + req.length > mMaxBytes
+ || mActiveEntries * 2 >= mMaxEntries) {
+ return true;
+ }
+ // Otherwise copy it over.
+ mSlotOffset = insertOffset;
+ try {
+ insertInternal(req.key, req.buffer, req.length);
+ mActiveEntries++;
+ writeInt(mIndexHeader, IH_ACTIVE_ENTRIES, mActiveEntries);
+ updateIndexHeader();
+ } catch (Throwable t) {
+ Log.e(TAG, "cannot copy over");
+ }
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+
+ // Copies the blob for the specified offset in the specified file to
+ // req.buffer. If req.buffer is null or too small, allocate a buffer and
+ // assign it to req.buffer.
+ // Returns false if the blob is not available (either the index file is
+ // not sync with the data file, or one of them is corrupted). The length
+ // of the blob is stored in the req.length variable.
+ private boolean getBlob(RandomAccessFile file, int offset,
+ LookupRequest req) throws IOException {
+ byte[] header = mBlobHeader;
+ long oldPosition = file.getFilePointer();
+ try {
+ file.seek(offset);
+ if (file.read(header) != BLOB_HEADER_SIZE) {
+ Log.w(TAG, "cannot read blob header");
+ return false;
+ }
+ long blobKey = readLong(header, BH_KEY);
+ if (blobKey == 0) {
+ return false; // This entry has been cleared.
+ }
+ if (blobKey != req.key) {
+ Log.w(TAG, "blob key does not match: " + blobKey);
+ return false;
+ }
+ int sum = readInt(header, BH_CHECKSUM);
+ int blobOffset = readInt(header, BH_OFFSET);
+ if (blobOffset != offset) {
+ Log.w(TAG, "blob offset does not match: " + blobOffset);
+ return false;
+ }
+ int length = readInt(header, BH_LENGTH);
+ if (length < 0 || length > mMaxBytes - offset - BLOB_HEADER_SIZE) {
+ Log.w(TAG, "invalid blob length: " + length);
+ return false;
+ }
+ if (req.buffer == null || req.buffer.length < length) {
+ req.buffer = new byte[length];
+ }
+
+ byte[] blob = req.buffer;
+ req.length = length;
+
+ if (file.read(blob, 0, length) != length) {
+ Log.w(TAG, "cannot read blob data");
+ return false;
+ }
+ if (checkSum(blob, 0, length) != sum) {
+ Log.w(TAG, "blob checksum does not match: " + sum);
+ return false;
+ }
+ return true;
+ } catch (Throwable t) {
+ Log.e(TAG, "getBlob failed.", t);
+ return false;
+ } finally {
+ file.seek(oldPosition);
+ }
+ }
+
+ // Tries to look up a key in the specified hash region.
+ // Returns true if the lookup is successful.
+ // The slot offset in the index file is saved in mSlotOffset. If the lookup
+ // is successful, it's the slot found. Otherwise it's the slot suitable for
+ // insertion.
+ // If the lookup is successful, the file offset is also saved in
+ // mFileOffset.
+ private int mSlotOffset;
+ private int mFileOffset;
+ private boolean lookupInternal(long key, int hashStart) {
+ int slot = (int) (key % mMaxEntries);
+ if (slot < 0) slot += mMaxEntries;
+ int slotBegin = slot;
+ while (true) {
+ int offset = hashStart + slot * 12;
+ long candidateKey = mIndexBuffer.getLong(offset);
+ int candidateOffset = mIndexBuffer.getInt(offset + 8);
+ if (candidateOffset == 0) {
+ mSlotOffset = offset;
+ return false;
+ } else if (candidateKey == key) {
+ mSlotOffset = offset;
+ mFileOffset = candidateOffset;
+ return true;
+ } else {
+ if (++slot >= mMaxEntries) {
+ slot = 0;
+ }
+ if (slot == slotBegin) {
+ Log.w(TAG, "corrupted index: clear the slot.");
+ mIndexBuffer.putInt(hashStart + slot * 12 + 8, 0);
+ }
+ }
+ }
+ }
+
+ public void syncIndex() {
+ try {
+ mIndexBuffer.force();
+ } catch (Throwable t) {
+ Log.w(TAG, "sync index failed", t);
+ }
+ }
+
+ public void syncAll() {
+ syncIndex();
+ try {
+ mDataFile0.getFD().sync();
+ } catch (Throwable t) {
+ Log.w(TAG, "sync data file 0 failed", t);
+ }
+ try {
+ mDataFile1.getFD().sync();
+ } catch (Throwable t) {
+ Log.w(TAG, "sync data file 1 failed", t);
+ }
+ }
+
+ // This is for testing only.
+ //
+ // Returns the active count (mActiveEntries). This also verifies that
+ // the active count matches matches what's inside the hash region.
+ int getActiveCount() {
+ int count = 0;
+ for (int i = 0; i < mMaxEntries; i++) {
+ int offset = mActiveHashStart + i * 12;
+ long candidateKey = mIndexBuffer.getLong(offset);
+ int candidateOffset = mIndexBuffer.getInt(offset + 8);
+ if (candidateOffset != 0) ++count;
+ }
+ if (count == mActiveEntries) {
+ return count;
+ } else {
+ Log.e(TAG, "wrong active count: " + mActiveEntries + " vs " + count);
+ return -1; // signal failure.
+ }
+ }
+
+ int checkSum(byte[] data) {
+ mAdler32.reset();
+ mAdler32.update(data);
+ return (int) mAdler32.getValue();
+ }
+
+ int checkSum(byte[] data, int offset, int nbytes) {
+ mAdler32.reset();
+ mAdler32.update(data, offset, nbytes);
+ return (int) mAdler32.getValue();
+ }
+
+ static void closeSilently(Closeable c) {
+ if (c == null) return;
+ try {
+ c.close();
+ } catch (Throwable t) {
+ // do nothing
+ }
+ }
+
+ static int readInt(byte[] buf, int offset) {
+ return (buf[offset] & 0xff)
+ | ((buf[offset + 1] & 0xff) << 8)
+ | ((buf[offset + 2] & 0xff) << 16)
+ | ((buf[offset + 3] & 0xff) << 24);
+ }
+
+ static long readLong(byte[] buf, int offset) {
+ long result = buf[offset + 7] & 0xff;
+ for (int i = 6; i >= 0; i--) {
+ result = (result << 8) | (buf[offset + i] & 0xff);
+ }
+ return result;
+ }
+
+ static void writeInt(byte[] buf, int offset, int value) {
+ for (int i = 0; i < 4; i++) {
+ buf[offset + i] = (byte) (value & 0xff);
+ value >>= 8;
+ }
+ }
+
+ static void writeLong(byte[] buf, int offset, long value) {
+ for (int i = 0; i < 8; i++) {
+ buf[offset + i] = (byte) (value & 0xff);
+ value >>= 8;
+ }
+ }
+}
diff --git a/gallerycommon/src/com/android/gallery3d/common/Entry.java b/gallerycommon/src/com/android/gallery3d/common/Entry.java
new file mode 100644
index 000000000..3f1644e65
--- /dev/null
+++ b/gallerycommon/src/com/android/gallery3d/common/Entry.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.gallery3d.common;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+public abstract class Entry {
+ public static final String[] ID_PROJECTION = { "_id" };
+
+ public static interface Columns {
+ public static final String ID = "_id";
+ }
+
+ // The primary key of the entry.
+ @Column("_id")
+ public long id = 0;
+
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target(ElementType.TYPE)
+ public @interface Table {
+ String value();
+ }
+
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target(ElementType.FIELD)
+ public @interface Column {
+ String value();
+
+ boolean indexed() default false;
+
+ boolean fullText() default false;
+
+ String defaultValue() default "";
+
+ boolean unique() default false;
+ }
+
+ public void clear() {
+ id = 0;
+ }
+}
diff --git a/gallerycommon/src/com/android/gallery3d/common/EntrySchema.java b/gallerycommon/src/com/android/gallery3d/common/EntrySchema.java
new file mode 100644
index 000000000..7bf7e431c
--- /dev/null
+++ b/gallerycommon/src/com/android/gallery3d/common/EntrySchema.java
@@ -0,0 +1,542 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.gallery3d.common;
+
+import android.content.ContentValues;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.text.TextUtils;
+
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+
+public final class EntrySchema {
+ @SuppressWarnings("unused")
+ private static final String TAG = "EntrySchema";
+
+ public static final int TYPE_STRING = 0;
+ public static final int TYPE_BOOLEAN = 1;
+ public static final int TYPE_SHORT = 2;
+ public static final int TYPE_INT = 3;
+ public static final int TYPE_LONG = 4;
+ public static final int TYPE_FLOAT = 5;
+ public static final int TYPE_DOUBLE = 6;
+ public static final int TYPE_BLOB = 7;
+ private static final String SQLITE_TYPES[] = {
+ "TEXT", "INTEGER", "INTEGER", "INTEGER", "INTEGER", "REAL", "REAL", "NONE" };
+
+ private static final String FULL_TEXT_INDEX_SUFFIX = "_fulltext";
+
+ private final String mTableName;
+ private final ColumnInfo[] mColumnInfo;
+ private final String[] mProjection;
+ private final boolean mHasFullTextIndex;
+
+ public EntrySchema(Class<? extends Entry> clazz) {
+ // Get table and column metadata from reflection.
+ ColumnInfo[] columns = parseColumnInfo(clazz);
+ mTableName = parseTableName(clazz);
+ mColumnInfo = columns;
+
+ // Cache the list of projection columns and check for full-text columns.
+ String[] projection = {};
+ boolean hasFullTextIndex = false;
+ if (columns != null) {
+ projection = new String[columns.length];
+ for (int i = 0; i != columns.length; ++i) {
+ ColumnInfo column = columns[i];
+ projection[i] = column.name;
+ if (column.fullText) {
+ hasFullTextIndex = true;
+ }
+ }
+ }
+ mProjection = projection;
+ mHasFullTextIndex = hasFullTextIndex;
+ }
+
+ public String getTableName() {
+ return mTableName;
+ }
+
+ public ColumnInfo[] getColumnInfo() {
+ return mColumnInfo;
+ }
+
+ public String[] getProjection() {
+ return mProjection;
+ }
+
+ public int getColumnIndex(String columnName) {
+ for (ColumnInfo column : mColumnInfo) {
+ if (column.name.equals(columnName)) {
+ return column.projectionIndex;
+ }
+ }
+ return -1;
+ }
+
+ public ColumnInfo getColumn(String columnName) {
+ int index = getColumnIndex(columnName);
+ return (index < 0) ? null : mColumnInfo[index];
+ }
+
+ private void logExecSql(SQLiteDatabase db, String sql) {
+ db.execSQL(sql);
+ }
+
+ public <T extends Entry> T cursorToObject(Cursor cursor, T object) {
+ try {
+ for (ColumnInfo column : mColumnInfo) {
+ int columnIndex = column.projectionIndex;
+ Field field = column.field;
+ switch (column.type) {
+ case TYPE_STRING:
+ field.set(object, cursor.isNull(columnIndex)
+ ? null
+ : cursor.getString(columnIndex));
+ break;
+ case TYPE_BOOLEAN:
+ field.setBoolean(object, cursor.getShort(columnIndex) == 1);
+ break;
+ case TYPE_SHORT:
+ field.setShort(object, cursor.getShort(columnIndex));
+ break;
+ case TYPE_INT:
+ field.setInt(object, cursor.getInt(columnIndex));
+ break;
+ case TYPE_LONG:
+ field.setLong(object, cursor.getLong(columnIndex));
+ break;
+ case TYPE_FLOAT:
+ field.setFloat(object, cursor.getFloat(columnIndex));
+ break;
+ case TYPE_DOUBLE:
+ field.setDouble(object, cursor.getDouble(columnIndex));
+ break;
+ case TYPE_BLOB:
+ field.set(object, cursor.isNull(columnIndex)
+ ? null
+ : cursor.getBlob(columnIndex));
+ break;
+ }
+ }
+ return object;
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void setIfNotNull(Field field, Object object, Object value)
+ throws IllegalAccessException {
+ if (value != null) field.set(object, value);
+ }
+
+ /**
+ * Converts the ContentValues to the object. The ContentValues may not
+ * contain values for all the fields in the object.
+ */
+ public <T extends Entry> T valuesToObject(ContentValues values, T object) {
+ try {
+ for (ColumnInfo column : mColumnInfo) {
+ String columnName = column.name;
+ Field field = column.field;
+ switch (column.type) {
+ case TYPE_STRING:
+ setIfNotNull(field, object, values.getAsString(columnName));
+ break;
+ case TYPE_BOOLEAN:
+ setIfNotNull(field, object, values.getAsBoolean(columnName));
+ break;
+ case TYPE_SHORT:
+ setIfNotNull(field, object, values.getAsShort(columnName));
+ break;
+ case TYPE_INT:
+ setIfNotNull(field, object, values.getAsInteger(columnName));
+ break;
+ case TYPE_LONG:
+ setIfNotNull(field, object, values.getAsLong(columnName));
+ break;
+ case TYPE_FLOAT:
+ setIfNotNull(field, object, values.getAsFloat(columnName));
+ break;
+ case TYPE_DOUBLE:
+ setIfNotNull(field, object, values.getAsDouble(columnName));
+ break;
+ case TYPE_BLOB:
+ setIfNotNull(field, object, values.getAsByteArray(columnName));
+ break;
+ }
+ }
+ return object;
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void objectToValues(Entry object, ContentValues values) {
+ try {
+ for (ColumnInfo column : mColumnInfo) {
+ String columnName = column.name;
+ Field field = column.field;
+ switch (column.type) {
+ case TYPE_STRING:
+ values.put(columnName, (String) field.get(object));
+ break;
+ case TYPE_BOOLEAN:
+ values.put(columnName, field.getBoolean(object));
+ break;
+ case TYPE_SHORT:
+ values.put(columnName, field.getShort(object));
+ break;
+ case TYPE_INT:
+ values.put(columnName, field.getInt(object));
+ break;
+ case TYPE_LONG:
+ values.put(columnName, field.getLong(object));
+ break;
+ case TYPE_FLOAT:
+ values.put(columnName, field.getFloat(object));
+ break;
+ case TYPE_DOUBLE:
+ values.put(columnName, field.getDouble(object));
+ break;
+ case TYPE_BLOB:
+ values.put(columnName, (byte[]) field.get(object));
+ break;
+ }
+ }
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public String toDebugString(Entry entry) {
+ try {
+ StringBuilder sb = new StringBuilder();
+ sb.append("ID=").append(entry.id);
+ for (ColumnInfo column : mColumnInfo) {
+ String columnName = column.name;
+ Field field = column.field;
+ Object value = field.get(entry);
+ sb.append(" ").append(columnName).append("=")
+ .append((value == null) ? "null" : value.toString());
+ }
+ return sb.toString();
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public String toDebugString(Entry entry, String... columnNames) {
+ try {
+ StringBuilder sb = new StringBuilder();
+ sb.append("ID=").append(entry.id);
+ for (String columnName : columnNames) {
+ ColumnInfo column = getColumn(columnName);
+ Field field = column.field;
+ Object value = field.get(entry);
+ sb.append(" ").append(columnName).append("=")
+ .append((value == null) ? "null" : value.toString());
+ }
+ return sb.toString();
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public Cursor queryAll(SQLiteDatabase db) {
+ return db.query(mTableName, mProjection, null, null, null, null, null);
+ }
+
+ public boolean queryWithId(SQLiteDatabase db, long id, Entry entry) {
+ Cursor cursor = db.query(mTableName, mProjection, "_id=?",
+ new String[] {Long.toString(id)}, null, null, null);
+ boolean success = false;
+ if (cursor.moveToFirst()) {
+ cursorToObject(cursor, entry);
+ success = true;
+ }
+ cursor.close();
+ return success;
+ }
+
+ public long insertOrReplace(SQLiteDatabase db, Entry entry) {
+ ContentValues values = new ContentValues();
+ objectToValues(entry, values);
+ if (entry.id == 0) {
+ values.remove("_id");
+ }
+ long id = db.replace(mTableName, "_id", values);
+ entry.id = id;
+ return id;
+ }
+
+ public boolean deleteWithId(SQLiteDatabase db, long id) {
+ return db.delete(mTableName, "_id=?", new String[] { Long.toString(id) }) == 1;
+ }
+
+ public void createTables(SQLiteDatabase db) {
+ // Wrapped class must have a @Table.Definition.
+ String tableName = mTableName;
+ Utils.assertTrue(tableName != null);
+
+ // Add the CREATE TABLE statement for the main table.
+ StringBuilder sql = new StringBuilder("CREATE TABLE ");
+ sql.append(tableName);
+ sql.append(" (_id INTEGER PRIMARY KEY AUTOINCREMENT");
+ StringBuilder unique = new StringBuilder();
+ for (ColumnInfo column : mColumnInfo) {
+ if (!column.isId()) {
+ sql.append(',');
+ sql.append(column.name);
+ sql.append(' ');
+ sql.append(SQLITE_TYPES[column.type]);
+ if (!TextUtils.isEmpty(column.defaultValue)) {
+ sql.append(" DEFAULT ");
+ sql.append(column.defaultValue);
+ }
+ if (column.unique) {
+ if (unique.length() == 0) {
+ unique.append(column.name);
+ } else {
+ unique.append(',').append(column.name);
+ }
+ }
+ }
+ }
+ if (unique.length() > 0) {
+ sql.append(",UNIQUE(").append(unique).append(')');
+ }
+ sql.append(");");
+ logExecSql(db, sql.toString());
+ sql.setLength(0);
+
+ // Create indexes for all indexed columns.
+ for (ColumnInfo column : mColumnInfo) {
+ // Create an index on the indexed columns.
+ if (column.indexed) {
+ sql.append("CREATE INDEX ");
+ sql.append(tableName);
+ sql.append("_index_");
+ sql.append(column.name);
+ sql.append(" ON ");
+ sql.append(tableName);
+ sql.append(" (");
+ sql.append(column.name);
+ sql.append(");");
+ logExecSql(db, sql.toString());
+ sql.setLength(0);
+ }
+ }
+
+ if (mHasFullTextIndex) {
+ // Add an FTS virtual table if using full-text search.
+ String ftsTableName = tableName + FULL_TEXT_INDEX_SUFFIX;
+ sql.append("CREATE VIRTUAL TABLE ");
+ sql.append(ftsTableName);
+ sql.append(" USING FTS3 (_id INTEGER PRIMARY KEY");
+ for (ColumnInfo column : mColumnInfo) {
+ if (column.fullText) {
+ // Add the column to the FTS table.
+ String columnName = column.name;
+ sql.append(',');
+ sql.append(columnName);
+ sql.append(" TEXT");
+ }
+ }
+ sql.append(");");
+ logExecSql(db, sql.toString());
+ sql.setLength(0);
+
+ // Build an insert statement that will automatically keep the FTS
+ // table in sync.
+ StringBuilder insertSql = new StringBuilder("INSERT OR REPLACE INTO ");
+ insertSql.append(ftsTableName);
+ insertSql.append(" (_id");
+ for (ColumnInfo column : mColumnInfo) {
+ if (column.fullText) {
+ insertSql.append(',');
+ insertSql.append(column.name);
+ }
+ }
+ insertSql.append(") VALUES (new._id");
+ for (ColumnInfo column : mColumnInfo) {
+ if (column.fullText) {
+ insertSql.append(",new.");
+ insertSql.append(column.name);
+ }
+ }
+ insertSql.append(");");
+ String insertSqlString = insertSql.toString();
+
+ // Add an insert trigger.
+ sql.append("CREATE TRIGGER ");
+ sql.append(tableName);
+ sql.append("_insert_trigger AFTER INSERT ON ");
+ sql.append(tableName);
+ sql.append(" FOR EACH ROW BEGIN ");
+ sql.append(insertSqlString);
+ sql.append("END;");
+ logExecSql(db, sql.toString());
+ sql.setLength(0);
+
+ // Add an update trigger.
+ sql.append("CREATE TRIGGER ");
+ sql.append(tableName);
+ sql.append("_update_trigger AFTER UPDATE ON ");
+ sql.append(tableName);
+ sql.append(" FOR EACH ROW BEGIN ");
+ sql.append(insertSqlString);
+ sql.append("END;");
+ logExecSql(db, sql.toString());
+ sql.setLength(0);
+
+ // Add a delete trigger.
+ sql.append("CREATE TRIGGER ");
+ sql.append(tableName);
+ sql.append("_delete_trigger AFTER DELETE ON ");
+ sql.append(tableName);
+ sql.append(" FOR EACH ROW BEGIN DELETE FROM ");
+ sql.append(ftsTableName);
+ sql.append(" WHERE _id = old._id; END;");
+ logExecSql(db, sql.toString());
+ sql.setLength(0);
+ }
+ }
+
+ public void dropTables(SQLiteDatabase db) {
+ String tableName = mTableName;
+ StringBuilder sql = new StringBuilder("DROP TABLE IF EXISTS ");
+ sql.append(tableName);
+ sql.append(';');
+ logExecSql(db, sql.toString());
+ sql.setLength(0);
+
+ if (mHasFullTextIndex) {
+ sql.append("DROP TABLE IF EXISTS ");
+ sql.append(tableName);
+ sql.append(FULL_TEXT_INDEX_SUFFIX);
+ sql.append(';');
+ logExecSql(db, sql.toString());
+ }
+
+ }
+
+ public void deleteAll(SQLiteDatabase db) {
+ StringBuilder sql = new StringBuilder("DELETE FROM ");
+ sql.append(mTableName);
+ sql.append(";");
+ logExecSql(db, sql.toString());
+ }
+
+ private String parseTableName(Class<? extends Object> clazz) {
+ // Check for a table annotation.
+ Entry.Table table = clazz.getAnnotation(Entry.Table.class);
+ if (table == null) {
+ return null;
+ }
+
+ // Return the table name.
+ return table.value();
+ }
+
+ private ColumnInfo[] parseColumnInfo(Class<? extends Object> clazz) {
+ ArrayList<ColumnInfo> columns = new ArrayList<ColumnInfo>();
+ while (clazz != null) {
+ parseColumnInfo(clazz, columns);
+ clazz = clazz.getSuperclass();
+ }
+
+ // Return a list.
+ ColumnInfo[] columnList = new ColumnInfo[columns.size()];
+ columns.toArray(columnList);
+ return columnList;
+ }
+
+ private void parseColumnInfo(Class<? extends Object> clazz, ArrayList<ColumnInfo> columns) {
+ // Gather metadata from each annotated field.
+ Field[] fields = clazz.getDeclaredFields(); // including non-public fields
+ for (int i = 0; i != fields.length; ++i) {
+ // Get column metadata from the annotation.
+ Field field = fields[i];
+ Entry.Column info = ((AnnotatedElement) field).getAnnotation(Entry.Column.class);
+ if (info == null) continue;
+
+ // Determine the field type.
+ int type;
+ Class<?> fieldType = field.getType();
+ if (fieldType == String.class) {
+ type = TYPE_STRING;
+ } else if (fieldType == boolean.class) {
+ type = TYPE_BOOLEAN;
+ } else if (fieldType == short.class) {
+ type = TYPE_SHORT;
+ } else if (fieldType == int.class) {
+ type = TYPE_INT;
+ } else if (fieldType == long.class) {
+ type = TYPE_LONG;
+ } else if (fieldType == float.class) {
+ type = TYPE_FLOAT;
+ } else if (fieldType == double.class) {
+ type = TYPE_DOUBLE;
+ } else if (fieldType == byte[].class) {
+ type = TYPE_BLOB;
+ } else {
+ throw new IllegalArgumentException(
+ "Unsupported field type for column: " + fieldType.getName());
+ }
+
+ // Add the column to the array.
+ int index = columns.size();
+ columns.add(new ColumnInfo(info.value(), type, info.indexed(), info.unique(),
+ info.fullText(), info.defaultValue(), field, index));
+ }
+ }
+
+ public static final class ColumnInfo {
+ private static final String ID_KEY = "_id";
+
+ public final String name;
+ public final int type;
+ public final boolean indexed;
+ public final boolean unique;
+ public final boolean fullText;
+ public final String defaultValue;
+ public final Field field;
+ public final int projectionIndex;
+
+ public ColumnInfo(String name, int type, boolean indexed, boolean unique,
+ boolean fullText, String defaultValue, Field field, int projectionIndex) {
+ this.name = name.toLowerCase();
+ this.type = type;
+ this.indexed = indexed;
+ this.unique = unique;
+ this.fullText = fullText;
+ this.defaultValue = defaultValue;
+ this.field = field;
+ this.projectionIndex = projectionIndex;
+
+ field.setAccessible(true); // in order to set non-public fields
+ }
+
+ public boolean isId() {
+ return ID_KEY.equals(name);
+ }
+ }
+}
diff --git a/gallerycommon/src/com/android/gallery3d/common/FileCache.java b/gallerycommon/src/com/android/gallery3d/common/FileCache.java
new file mode 100644
index 000000000..d7deda6fa
--- /dev/null
+++ b/gallerycommon/src/com/android/gallery3d/common/FileCache.java
@@ -0,0 +1,312 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.gallery3d.common;
+
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+import android.util.Log;
+
+import com.android.gallery3d.common.Entry.Table;
+
+import java.io.Closeable;
+import java.io.File;
+import java.io.IOException;
+
+public class FileCache implements Closeable {
+ private static final int LRU_CAPACITY = 4;
+ private static final int MAX_DELETE_COUNT = 16;
+
+ private static final String TAG = "FileCache";
+ private static final String TABLE_NAME = FileEntry.SCHEMA.getTableName();
+ private static final String FILE_PREFIX = "download";
+ private static final String FILE_POSTFIX = ".tmp";
+
+ private static final String QUERY_WHERE =
+ FileEntry.Columns.HASH_CODE + "=? AND " + FileEntry.Columns.CONTENT_URL + "=?";
+ private static final String ID_WHERE = FileEntry.Columns.ID + "=?";
+ private static final String[] PROJECTION_SIZE_SUM =
+ {String.format("sum(%s)", FileEntry.Columns.SIZE)};
+ private static final String FREESPACE_PROJECTION[] = {
+ FileEntry.Columns.ID, FileEntry.Columns.FILENAME,
+ FileEntry.Columns.CONTENT_URL, FileEntry.Columns.SIZE};
+ private static final String FREESPACE_ORDER_BY =
+ String.format("%s ASC", FileEntry.Columns.LAST_ACCESS);
+
+ private final LruCache<String, CacheEntry> mEntryMap =
+ new LruCache<String, CacheEntry>(LRU_CAPACITY);
+
+ private File mRootDir;
+ private long mCapacity;
+ private boolean mInitialized = false;
+ private long mTotalBytes;
+
+ private DatabaseHelper mDbHelper;
+
+ public static final class CacheEntry {
+ private long id;
+ public String contentUrl;
+ public File cacheFile;
+
+ private CacheEntry(long id, String contentUrl, File cacheFile) {
+ this.id = id;
+ this.contentUrl = contentUrl;
+ this.cacheFile = cacheFile;
+ }
+ }
+
+ public static void deleteFiles(Context context, File rootDir, String dbName) {
+ try {
+ context.getDatabasePath(dbName).delete();
+ File[] files = rootDir.listFiles();
+ if (files == null) return;
+ for (File file : rootDir.listFiles()) {
+ String name = file.getName();
+ if (file.isFile() && name.startsWith(FILE_PREFIX)
+ && name.endsWith(FILE_POSTFIX)) file.delete();
+ }
+ } catch (Throwable t) {
+ Log.w(TAG, "cannot reset database", t);
+ }
+ }
+
+ public FileCache(Context context, File rootDir, String dbName, long capacity) {
+ mRootDir = Utils.checkNotNull(rootDir);
+ mCapacity = capacity;
+ mDbHelper = new DatabaseHelper(context, dbName);
+ }
+
+ @Override
+ public void close() {
+ mDbHelper.close();
+ }
+
+ public void store(String downloadUrl, File file) {
+ if (!mInitialized) initialize();
+
+ Utils.assertTrue(file.getParentFile().equals(mRootDir));
+ FileEntry entry = new FileEntry();
+ entry.hashCode = Utils.crc64Long(downloadUrl);
+ entry.contentUrl = downloadUrl;
+ entry.filename = file.getName();
+ entry.size = file.length();
+ entry.lastAccess = System.currentTimeMillis();
+ if (entry.size >= mCapacity) {
+ file.delete();
+ throw new IllegalArgumentException("file too large: " + entry.size);
+ }
+ synchronized (this) {
+ FileEntry original = queryDatabase(downloadUrl);
+ if (original != null) {
+ file.delete();
+ entry.filename = original.filename;
+ entry.size = original.size;
+ } else {
+ mTotalBytes += entry.size;
+ }
+ FileEntry.SCHEMA.insertOrReplace(
+ mDbHelper.getWritableDatabase(), entry);
+ if (mTotalBytes > mCapacity) freeSomeSpaceIfNeed(MAX_DELETE_COUNT);
+ }
+ }
+
+ public CacheEntry lookup(String downloadUrl) {
+ if (!mInitialized) initialize();
+ CacheEntry entry;
+ synchronized (mEntryMap) {
+ entry = mEntryMap.get(downloadUrl);
+ }
+
+ if (entry != null) {
+ synchronized (this) {
+ updateLastAccess(entry.id);
+ }
+ return entry;
+ }
+
+ synchronized (this) {
+ FileEntry file = queryDatabase(downloadUrl);
+ if (file == null) return null;
+ entry = new CacheEntry(
+ file.id, downloadUrl, new File(mRootDir, file.filename));
+ if (!entry.cacheFile.isFile()) { // file has been removed
+ try {
+ mDbHelper.getWritableDatabase().delete(
+ TABLE_NAME, ID_WHERE, new String[] {String.valueOf(file.id)});
+ mTotalBytes -= file.size;
+ } catch (Throwable t) {
+ Log.w(TAG, "cannot delete entry: " + file.filename, t);
+ }
+ return null;
+ }
+ synchronized (mEntryMap) {
+ mEntryMap.put(downloadUrl, entry);
+ }
+ return entry;
+ }
+ }
+
+ private FileEntry queryDatabase(String downloadUrl) {
+ long hash = Utils.crc64Long(downloadUrl);
+ String whereArgs[] = new String[] {String.valueOf(hash), downloadUrl};
+ Cursor cursor = mDbHelper.getReadableDatabase().query(TABLE_NAME,
+ FileEntry.SCHEMA.getProjection(),
+ QUERY_WHERE, whereArgs, null, null, null);
+ try {
+ if (!cursor.moveToNext()) return null;
+ FileEntry entry = new FileEntry();
+ FileEntry.SCHEMA.cursorToObject(cursor, entry);
+ updateLastAccess(entry.id);
+ return entry;
+ } finally {
+ cursor.close();
+ }
+ }
+
+ private void updateLastAccess(long id) {
+ ContentValues values = new ContentValues();
+ values.put(FileEntry.Columns.LAST_ACCESS, System.currentTimeMillis());
+ mDbHelper.getWritableDatabase().update(TABLE_NAME,
+ values, ID_WHERE, new String[] {String.valueOf(id)});
+ }
+
+ public File createFile() throws IOException {
+ return File.createTempFile(FILE_PREFIX, FILE_POSTFIX, mRootDir);
+ }
+
+ private synchronized void initialize() {
+ if (mInitialized) return;
+
+ if (!mRootDir.isDirectory()) {
+ mRootDir.mkdirs();
+ if (!mRootDir.isDirectory()) {
+ throw new RuntimeException("cannot create: " + mRootDir.getAbsolutePath());
+ }
+ }
+
+ Cursor cursor = mDbHelper.getReadableDatabase().query(
+ TABLE_NAME, PROJECTION_SIZE_SUM,
+ null, null, null, null, null);
+ try {
+ if (cursor.moveToNext()) mTotalBytes = cursor.getLong(0);
+ } finally {
+ cursor.close();
+ }
+ if (mTotalBytes > mCapacity) freeSomeSpaceIfNeed(MAX_DELETE_COUNT);
+
+ // Mark initialized when everything above went through. If an exception was thrown,
+ // initialize() will be retried later.
+ mInitialized = true;
+ }
+
+ private void freeSomeSpaceIfNeed(int maxDeleteFileCount) {
+ Cursor cursor = mDbHelper.getReadableDatabase().query(
+ TABLE_NAME, FREESPACE_PROJECTION,
+ null, null, null, null, FREESPACE_ORDER_BY);
+ try {
+ while (maxDeleteFileCount > 0
+ && mTotalBytes > mCapacity && cursor.moveToNext()) {
+ long id = cursor.getLong(0);
+ String path = cursor.getString(1);
+ String url = cursor.getString(2);
+ long size = cursor.getLong(3);
+
+ synchronized (mEntryMap) {
+ // if some one still uses it
+ if (mEntryMap.containsKey(url)) continue;
+ }
+
+ --maxDeleteFileCount;
+ if (new File(mRootDir, path).delete()) {
+ mTotalBytes -= size;
+ mDbHelper.getWritableDatabase().delete(TABLE_NAME,
+ ID_WHERE, new String[]{String.valueOf(id)});
+ } else {
+ Log.w(TAG, "unable to delete file: " + path);
+ }
+ }
+ } finally {
+ cursor.close();
+ }
+ }
+
+ @Table("files")
+ private static class FileEntry extends Entry {
+ public static final EntrySchema SCHEMA = new EntrySchema(FileEntry.class);
+
+ public interface Columns extends Entry.Columns {
+ public static final String HASH_CODE = "hash_code";
+ public static final String CONTENT_URL = "content_url";
+ public static final String FILENAME = "filename";
+ public static final String SIZE = "size";
+ public static final String LAST_ACCESS = "last_access";
+ }
+
+ @Column(value = Columns.HASH_CODE, indexed = true)
+ public long hashCode;
+
+ @Column(Columns.CONTENT_URL)
+ public String contentUrl;
+
+ @Column(Columns.FILENAME)
+ public String filename;
+
+ @Column(Columns.SIZE)
+ public long size;
+
+ @Column(value = Columns.LAST_ACCESS, indexed = true)
+ public long lastAccess;
+
+ @Override
+ public String toString() {
+ return new StringBuilder()
+ .append("hash_code: ").append(hashCode).append(", ")
+ .append("content_url").append(contentUrl).append(", ")
+ .append("last_access").append(lastAccess).append(", ")
+ .append("filename").append(filename).toString();
+ }
+ }
+
+ private final class DatabaseHelper extends SQLiteOpenHelper {
+ public static final int DATABASE_VERSION = 1;
+
+ public DatabaseHelper(Context context, String dbName) {
+ super(context, dbName, null, DATABASE_VERSION);
+ }
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ FileEntry.SCHEMA.createTables(db);
+
+ // delete old files
+ for (File file : mRootDir.listFiles()) {
+ if (!file.delete()) {
+ Log.w(TAG, "fail to remove: " + file.getAbsolutePath());
+ }
+ }
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+ //reset everything
+ FileEntry.SCHEMA.dropTables(db);
+ onCreate(db);
+ }
+ }
+}
diff --git a/gallerycommon/src/com/android/gallery3d/common/Fingerprint.java b/gallerycommon/src/com/android/gallery3d/common/Fingerprint.java
new file mode 100644
index 000000000..2847e57ce
--- /dev/null
+++ b/gallerycommon/src/com/android/gallery3d/common/Fingerprint.java
@@ -0,0 +1,187 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.gallery3d.common;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.DigestInputStream;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * MD5-based digest Wrapper.
+ */
+public class Fingerprint {
+ // Instance of the MessageDigest using our specified digest algorithm.
+ private static final MessageDigest DIGESTER;
+
+ /**
+ * Name of the digest algorithm we use in {@link java.security.MessageDigest}
+ */
+ private static final String DIGEST_MD5 = "md5";
+
+ // Version 1 streamId prefix.
+ // Hard coded stream id length limit is 40-chars. Don't ask!
+ private static final String STREAM_ID_CS_PREFIX = "cs_01_";
+
+ // 16 bytes for 128-bit fingerprint
+ private static final int FINGERPRINT_BYTE_LENGTH;
+
+ // length of prefix + 32 hex chars for 128-bit fingerprint
+ private static final int STREAM_ID_CS_01_LENGTH;
+
+ static {
+ try {
+ DIGESTER = MessageDigest.getInstance(DIGEST_MD5);
+ FINGERPRINT_BYTE_LENGTH = DIGESTER.getDigestLength();
+ STREAM_ID_CS_01_LENGTH = STREAM_ID_CS_PREFIX.length()
+ + (FINGERPRINT_BYTE_LENGTH * 2);
+ } catch (NoSuchAlgorithmException e) {
+ // can't continue, but really shouldn't happen
+ throw new IllegalStateException(e);
+ }
+ }
+
+ // md5 digest bytes.
+ private final byte[] mMd5Digest;
+
+ /**
+ * Creates a new Fingerprint.
+ */
+ public Fingerprint(byte[] bytes) {
+ if ((bytes == null) || (bytes.length != FINGERPRINT_BYTE_LENGTH)) {
+ throw new IllegalArgumentException();
+ }
+ mMd5Digest = bytes;
+ }
+
+ /**
+ * Creates a Fingerprint based on the contents of a file.
+ *
+ * Note that this will close() stream after calculating the digest.
+ * @param byteCount length of original data will be stored at byteCount[0] as a side product
+ * of the fingerprint calculation
+ */
+ public static Fingerprint fromInputStream(InputStream stream, long[] byteCount)
+ throws IOException {
+ DigestInputStream in = null;
+ long count = 0;
+ try {
+ in = new DigestInputStream(stream, DIGESTER);
+ byte[] bytes = new byte[8192];
+ while (true) {
+ // scan through file to compute a fingerprint.
+ int n = in.read(bytes);
+ if (n < 0) break;
+ count += n;
+ }
+ } finally {
+ if (in != null) in.close();
+ }
+ if ((byteCount != null) && (byteCount.length > 0)) byteCount[0] = count;
+ return new Fingerprint(in.getMessageDigest().digest());
+ }
+
+ /**
+ * Decodes a string stream id to a 128-bit fingerprint.
+ */
+ public static Fingerprint fromStreamId(String streamId) {
+ if ((streamId == null)
+ || !streamId.startsWith(STREAM_ID_CS_PREFIX)
+ || (streamId.length() != STREAM_ID_CS_01_LENGTH)) {
+ throw new IllegalArgumentException("bad streamId: " + streamId);
+ }
+
+ // decode the hex bytes of the fingerprint portion
+ byte[] bytes = new byte[FINGERPRINT_BYTE_LENGTH];
+ int byteIdx = 0;
+ for (int idx = STREAM_ID_CS_PREFIX.length(); idx < STREAM_ID_CS_01_LENGTH;
+ idx += 2) {
+ int value = (toDigit(streamId, idx) << 4) | toDigit(streamId, idx + 1);
+ bytes[byteIdx++] = (byte) (value & 0xff);
+ }
+ return new Fingerprint(bytes);
+ }
+
+ /**
+ * Scans a list of strings for a valid streamId.
+ *
+ * @param streamIdList list of stream id's to be scanned
+ * @return valid fingerprint or null if it can't be found
+ */
+ public static Fingerprint extractFingerprint(List<String> streamIdList) {
+ for (String streamId : streamIdList) {
+ if (streamId.startsWith(STREAM_ID_CS_PREFIX)) {
+ return fromStreamId(streamId);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Encodes a 128-bit fingerprint as a string stream id.
+ *
+ * Stream id string is limited to 40 characters, which could be digits, lower case ASCII and
+ * underscores.
+ */
+ public String toStreamId() {
+ StringBuilder streamId = new StringBuilder(STREAM_ID_CS_PREFIX);
+ appendHexFingerprint(streamId, mMd5Digest);
+ return streamId.toString();
+ }
+
+ public byte[] getBytes() {
+ return mMd5Digest;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (!(obj instanceof Fingerprint)) return false;
+ Fingerprint other = (Fingerprint) obj;
+ return Arrays.equals(mMd5Digest, other.mMd5Digest);
+ }
+
+ public boolean equals(byte[] md5Digest) {
+ return Arrays.equals(mMd5Digest, md5Digest);
+ }
+
+ @Override
+ public int hashCode() {
+ return Arrays.hashCode(mMd5Digest);
+ }
+
+ // Utility methods.
+
+ private static int toDigit(String streamId, int index) {
+ int digit = Character.digit(streamId.charAt(index), 16);
+ if (digit < 0) {
+ throw new IllegalArgumentException("illegal hex digit in " + streamId);
+ }
+ return digit;
+ }
+
+ private static void appendHexFingerprint(StringBuilder sb, byte[] bytes) {
+ for (int idx = 0; idx < FINGERPRINT_BYTE_LENGTH; idx++) {
+ int value = bytes[idx];
+ sb.append(Integer.toHexString((value >> 4) & 0x0f));
+ sb.append(Integer.toHexString(value& 0x0f));
+ }
+ }
+}
diff --git a/gallerycommon/src/com/android/gallery3d/common/HttpClientFactory.java b/gallerycommon/src/com/android/gallery3d/common/HttpClientFactory.java
new file mode 100644
index 000000000..18b7a8875
--- /dev/null
+++ b/gallerycommon/src/com/android/gallery3d/common/HttpClientFactory.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.gallery3d.common;
+
+import android.content.Context;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.os.Build;
+
+import org.apache.http.HttpVersion;
+import org.apache.http.client.HttpClient;
+import org.apache.http.conn.params.ConnManagerParams;
+import org.apache.http.params.CoreProtocolPNames;
+import org.apache.http.params.HttpParams;
+</