diff options
author | Chih-Chung Chang <chihchung@google.com> | 2009-08-06 14:33:30 +0800 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2009-08-10 17:07:34 +0800 |
commit | 382b384ec2cd948a82fe42294b18e4ec630bbdf6 (patch) | |
tree | 7b46e9b728be5dfcef00d94f16953c3c5487b9f4 /src | |
parent | 1d5ec3cba971ecb2d49fef0640a221a30c707e49 (diff) | |
download | packages_apps_LegacyCamera-382b384ec2cd948a82fe42294b18e4ec630bbdf6.zip packages_apps_LegacyCamera-382b384ec2cd948a82fe42294b18e4ec630bbdf6.tar.gz packages_apps_LegacyCamera-382b384ec2cd948a82fe42294b18e4ec630bbdf6.tar.bz2 |
Removed unused resources and code. See 2036961: build size too large.
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/BitmapManager.java | 20 | ||||
-rw-r--r-- | src/com/android/camera/Camera.java | 21 | ||||
-rw-r--r-- | src/com/android/camera/HighlightView.java | 4 | ||||
-rw-r--r-- | src/com/android/camera/ImageManager.java | 4 | ||||
-rw-r--r-- | src/com/android/camera/OnScreenHint.java | 63 | ||||
-rw-r--r-- | src/com/android/camera/TimeCounter.java | 84 | ||||
-rw-r--r-- | src/com/android/camera/Util.java | 14 | ||||
-rw-r--r-- | src/com/android/camera/VideoPreview.java | 10 | ||||
-rw-r--r-- | src/com/android/camera/gallery/BaseCancelable.java | 13 | ||||
-rw-r--r-- | src/com/android/camera/gallery/Image.java | 57 | ||||
-rw-r--r-- | src/com/android/camera/gallery/UriImage.java | 4 |
11 files changed, 0 insertions, 294 deletions
diff --git a/src/com/android/camera/BitmapManager.java b/src/com/android/camera/BitmapManager.java index dbbad17..eb05d3e 100644 --- a/src/com/android/camera/BitmapManager.java +++ b/src/com/android/camera/BitmapManager.java @@ -105,11 +105,6 @@ public class BitmapManager { getOrCreateThreadStatus(t).mOptions = options; } - synchronized BitmapFactory.Options getDecodingOptions(Thread t) { - ThreadStatus status = mThreadStatus.get(t); - return status != null ? status.mOptions : null; - } - synchronized void removeDecodingOptions(Thread t) { ThreadStatus status = mThreadStatus.get(t); status.mOptions = null; @@ -161,21 +156,6 @@ public class BitmapManager { notifyAll(); } - /** - * A debugging routine. - */ - public synchronized void dump() { - Iterator<Map.Entry<Thread, ThreadStatus>> i = - mThreadStatus.entrySet().iterator(); - - while (i.hasNext()) { - Map.Entry<Thread, ThreadStatus> entry = i.next(); - Log.v(TAG, "[Dump] Thread " + entry.getKey() + " (" - + entry.getKey().getId() - + ")'s status is " + entry.getValue()); - } - } - public static synchronized BitmapManager instance() { if (sManager == null) { sManager = new BitmapManager(); diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index fe6b1c7..727b7d3 100644 --- a/src/com/android/camera/Camera.java +++ b/src/com/android/camera/Camera.java @@ -703,27 +703,6 @@ public class Camera extends Activity implements View.OnClickListener, return DateFormat.format("yyyy-MM-dd kk.mm.ss", dateTaken).toString(); } - public static Matrix getDisplayMatrix(Bitmap b, ImageView v) { - Matrix m = new Matrix(); - float bw = b.getWidth(); - float bh = b.getHeight(); - float vw = v.getWidth(); - float vh = v.getHeight(); - float scale, x, y; - if (bw * vh > vw * bh) { - scale = vh / bh; - x = (vw - scale * bw) * 0.5F; - y = 0; - } else { - scale = vw / bw; - x = 0; - y = (vh - scale * bh) * 0.5F; - } - m.setScale(scale, scale, 0.5F, 0.5F); - m.postTranslate(x, y); - return m; - } - @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); diff --git a/src/com/android/camera/HighlightView.java b/src/com/android/camera/HighlightView.java index ee2e129..c05a4b2 100644 --- a/src/com/android/camera/HighlightView.java +++ b/src/com/android/camera/HighlightView.java @@ -166,10 +166,6 @@ class HighlightView { } } - public ModifyMode getMode() { - return mMode; - } - public void setMode(ModifyMode mode) { if (mode != mMode) { mMode = mode; diff --git a/src/com/android/camera/ImageManager.java b/src/com/android/camera/ImageManager.java index 3fdc0ab..fbcca6f 100644 --- a/src/com/android/camera/ImageManager.java +++ b/src/com/android/camera/ImageManager.java @@ -110,10 +110,6 @@ public class ImageManager { } } - public static DataLocation getDefaultDataLocation() { - return DataLocation.EXTERNAL; - } - public static int roundOrientation(int orientationInput) { int orientation = orientationInput; if (orientation == -1) { diff --git a/src/com/android/camera/OnScreenHint.java b/src/com/android/camera/OnScreenHint.java index 792631c..e0a0eb1 100644 --- a/src/com/android/camera/OnScreenHint.java +++ b/src/com/android/camera/OnScreenHint.java @@ -113,69 +113,6 @@ public class OnScreenHint { } /** - * Set the margins of the view. - * - * @param horizontalMargin The horizontal margin, in percentage of the - * container width, between the container's edges and the - * notification - * @param verticalMargin The vertical margin, in percentage of the - * container height, between the container's edges and the - * notification - */ - public void setMargin(float horizontalMargin, float verticalMargin) { - mHorizontalMargin = horizontalMargin; - mVerticalMargin = verticalMargin; - } - - /** - * Return the horizontal margin. - */ - public float getHorizontalMargin() { - return mHorizontalMargin; - } - - /** - * Return the vertical margin. - */ - public float getVerticalMargin() { - return mVerticalMargin; - } - - /** - * Set the location at which the notification should appear on the screen. - * @see android.view.Gravity - * @see #getGravity - */ - public void setGravity(int gravity, int xOffset, int yOffset) { - mGravity = gravity; - mX = xOffset; - mY = yOffset; - } - - /** - * Get the location at which the notification should appear on the screen. - * @see android.view.Gravity - * @see #getGravity - */ - public int getGravity() { - return mGravity; - } - - /** - * Return the X offset in pixels to apply to the gravity's location. - */ - public int getXOffset() { - return mX; - } - - /** - * Return the Y offset in pixels to apply to the gravity's location. - */ - public int getYOffset() { - return mY; - } - - /** * Make a standard hint that just contains a text view. * * @param context The context to use. Usually your diff --git a/src/com/android/camera/TimeCounter.java b/src/com/android/camera/TimeCounter.java deleted file mode 100644 index d21df0f..0000000 --- a/src/com/android/camera/TimeCounter.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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.camera; - -import android.util.Log; - -// A simple counter to measure the time to run a code fragment. Example: -// -// TimeCounter mDrawCounter = TimeCounter("Draw", 128); -// ... -// mDrawCounter.begin() -// // drawing code -// mDrawCounter.end() -// -// In this example, the counter will report (using Log.d) average time -// between begin() and end() every 128 times. -public class TimeCounter { - private static final String TAG = "TimeCounter"; - private final String mName; - private int mSamples; - private final int mPeriod; - - // To avoid overflow, these values are in microseconds. - private long mSum; - private long mSumSquare; - private long mBeginTime; - private long mMax; - private long mMin; - - public TimeCounter(String name, int period) { - mName = name; - mPeriod = period; - reset(); - } - - public void reset() { - mSamples = 0; - mSum = 0; - mSumSquare = 0; - mMax = Long.MIN_VALUE; - mMin = Long.MAX_VALUE; - } - - public void begin() { - mBeginTime = System.nanoTime(); - } - - public void end() { - long delta = (System.nanoTime() - mBeginTime) / 1000; - mSum += delta; - mSumSquare += delta * delta; - if (delta > mMax) mMax = delta; - if (delta < mMin) mMin = delta; - mSamples++; - if (mSamples == mPeriod) { - report(); - reset(); - } - } - - public void report() { - double avg = mSum / (double) mSamples; - double stddev = Math.sqrt(mSumSquare / (double) mSamples - avg * avg); - Log.d(TAG, "Counter " + mName - + ": Avg = " + avg - + ", StdDev = " + stddev - + ", Max = " + mMax - + ", Min = " + mMin); - } -} diff --git a/src/com/android/camera/Util.java b/src/com/android/camera/Util.java index 7c4420b..9e5c74e 100644 --- a/src/com/android/camera/Util.java +++ b/src/com/android/camera/Util.java @@ -384,20 +384,6 @@ public class Util { } } - public static void debugWhere(String tag, String msg) { - Log.d(tag, msg + " --- stack trace begins: "); - StackTraceElement elements[] = Thread.currentThread().getStackTrace(); - // skip first 3 element, they are not related to the caller - for (int i = 3, n = elements.length; i < n; ++i) { - StackTraceElement st = elements[i]; - String message = String.format(" at %s.%s(%s:%s)", - st.getClassName(), st.getMethodName(), st.getFileName(), - st.getLineNumber()); - Log.d(tag, message); - } - Log.d(tag, msg + " --- stack trace ends."); - } - public static synchronized OnClickListener getNullOnClickListener() { if (sNullOnClickListener == null) { sNullOnClickListener = new OnClickListener() { diff --git a/src/com/android/camera/VideoPreview.java b/src/com/android/camera/VideoPreview.java index 50409e6..c51a265 100644 --- a/src/com/android/camera/VideoPreview.java +++ b/src/com/android/camera/VideoPreview.java @@ -46,16 +46,6 @@ class VideoPreview extends SurfaceView { super(context, attrs, defStyle); } - public void setTileSize(int horizontalTileSize, int verticalTileSize) { - if ((mHorizontalTileSize != horizontalTileSize) - || (mVerticalTileSize != verticalTileSize)) { - mHorizontalTileSize = horizontalTileSize; - mVerticalTileSize = verticalTileSize; - requestLayout(); - invalidate(); - } - } - public void setAspectRatio(int width, int height) { setAspectRatio(((float) width) / ((float) height)); } diff --git a/src/com/android/camera/gallery/BaseCancelable.java b/src/com/android/camera/gallery/BaseCancelable.java index fd9779f..4fde291 100644 --- a/src/com/android/camera/gallery/BaseCancelable.java +++ b/src/com/android/camera/gallery/BaseCancelable.java @@ -52,12 +52,6 @@ public abstract class BaseCancelable<T> implements Cancelable<T> { protected abstract T execute() throws Exception; - protected synchronized void interruptNow() { - if (isInStates(STATE_CANCELING | STATE_EXECUTING)) { - mThread.interrupt(); - } - } - /** * Frees the result (which is not null) when the task has been canceled. */ @@ -142,13 +136,6 @@ public abstract class BaseCancelable<T> implements Cancelable<T> { } /** - * Whether the task's has been requested for cancel. - */ - protected synchronized boolean isCanceling() { - return mState == STATE_CANCELING; - } - - /** * Runs a <code>Cancelable</code> subtask. This method is helpful, if the * task can be composed of several cancelable tasks. By using this function, * it will pass <code>requestCancel</code> message to those subtasks. diff --git a/src/com/android/camera/gallery/Image.java b/src/com/android/camera/gallery/Image.java index 437c741..aab9545 100644 --- a/src/com/android/camera/gallery/Image.java +++ b/src/com/android/camera/gallery/Image.java @@ -84,52 +84,6 @@ public class Image extends BaseImage implements IImage { return Bitmap.CompressFormat.JPEG; } - /** - * Does not replace the tag if already there. Otherwise, adds to the EXIF - * tags. - * - * @param tag - * @param value - */ - public void addExifTag(String tag, String value) { - if (mExifData == null) { - loadExifData(); - } - // If the key is already there, ignore it. - if (!mExifData.containsKey(tag)) { - mExifData.put(tag, value); - } - } - - /** - * Returns the value of the EXIF tag as an integer. - * - * @param tag - */ - public int getExifTagInt(String tag, int defaultValue) { - String tagValue = getExifTag(tag); - try { - if (tagValue != null) { - return Integer.parseInt(tagValue); - } - } catch (NumberFormatException ex) { - // Simply return defaultValue if exception is thrown. - Log.v(TAG, ex.toString()); - } - return defaultValue; - } - - /** - * Return the value of the EXIF tag as a String. It's caller's - * responsibility to check nullity. - */ - public String getExifTag(String tag) { - if (mExifData == null) { - loadExifData(); - } - return mExifData.get(tag); - } - public boolean isReadonly() { String mimeType = getMimeType(); return !"image/jpeg".equals(mimeType) && !"image/png".equals(mimeType); @@ -140,17 +94,6 @@ public class Image extends BaseImage implements IImage { } /** - * Remove tag if already there. Otherwise, does nothing. - * @param tag - */ - public void removeExifTag(String tag) { - if (mExifData == null) { - loadExifData(); - } - mExifData.remove(tag); - } - - /** * Replaces the tag if already there. Otherwise, adds to the exif tags. * @param tag * @param value diff --git a/src/com/android/camera/gallery/UriImage.java b/src/com/android/camera/gallery/UriImage.java index eb61e8e..a53dd79 100644 --- a/src/com/android/camera/gallery/UriImage.java +++ b/src/com/android/camera/gallery/UriImage.java @@ -169,10 +169,6 @@ class UriImage implements IImage { return 0; } - public int getRow() { - return 0; - } - public boolean isReadonly() { return true; } |