]> hydra-www.ietfng.org Git - android-vcpass-oisafe/commitdiff
OI Safe: overhauled how listadapter is updated in CategoryList and
authorrmceoin <rmceoin@72b678ce-9140-0410-bee8-679b907dd61a>
Sun, 20 Sep 2009 22:00:37 +0000 (22:00 +0000)
committerrmceoin <rmceoin@72b678ce-9140-0410-bee8-679b907dd61a>
Sun, 20 Sep 2009 22:00:37 +0000 (22:00 +0000)
PassList.  fillData now checks to for existing thread.
Swiped build.xml from DroidSpray and updated accordingly.

git-svn-id: http://openintents.googlecode.com/svn/trunk/Safe@2306 72b678ce-9140-0410-bee8-679b907dd61a

build.xml
res/values/strings.xml
src/org/openintents/safe/AskPassword.java
src/org/openintents/safe/CategoryList.java
src/org/openintents/safe/FrontDoor.java
src/org/openintents/safe/IntentHandler.java
src/org/openintents/safe/PassList.java
src/org/openintents/safe/PassView.java
src/org/openintents/safe/Search.java

index 0b5b41ef0ecad6df49f317c5f39546decefd2ee5..103b63adc07b369786fd79b57302a257b1de2434 100644 (file)
--- a/build.xml
+++ b/build.xml
        developers must have there own copy with the following entries\r
 proguard.jar=d:\\extern\\proguard4.2\\proguard4.2\\lib\\proguard.jar\r
 storepass=*password of keystore*\r
--->\r
+-->     \r
        <property file="build-private.properties" />\r
 \r
        <!-- Read properties from OpenIntents property file -->\r
        <property file="build.properties" />\r
        <!-- <property file="${build.properties.dir}/build.properties" /> -->\r
+       \r
+<!-- 1.5 Changes START -->\r
+    <!-- Custom Android task to deal with the project target, and import the proper rules.\r
+         This requires ant 1.6.0 or above. -->\r
+    <path id="android.antlibs">\r
+        <pathelement path="${sdk-location}/tools/lib/anttasks.jar" />\r
+        <pathelement path="${sdk-location}/tools/lib/sdklib.jar" />\r
+        <pathelement path="${sdk-location}/tools/lib/androidprefs.jar" />\r
+        <pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" />\r
+        <pathelement path="${sdk-location}/tools/lib/jarutils.jar" />\r
+    </path>\r
+\r
+<!-- 1.5 Changes END -->\r
 \r
        <!-- Read manifest properties , e.g. manifest(android:versionName) or manifest.package -->\r
        <xmlproperty file="AndroidManifest.xml" />\r
 \r
        <!-- Path to Android SDK and tools -->\r
-       <property name="sdk-folder" value="${android.sdk}" />\r
-       <property name="android-tools" value="${sdk-folder}/tools" />\r
+       <property name="sdk-folder" value="${android.sdk}/platforms/${platform}" />\r
+       <property name="platform-tools" value="${sdk-folder}/tools" />\r
+       <property name="android-tools" value="${android.sdk}/tools" />\r
        <echo>Using Android SDK directory ${sdk-folder}</echo>\r
-\r
+       \r
        <!-- Application Package Name -->\r
        <property name="application-package" value="${manifest(package)}" />\r
        <property name="version" value="${manifest(android:versionName)}" />\r
 \r
-       <!-- The intermediates directory -->\r
-       <!-- Eclipse uses "bin" for its own output, so we do the same. -->\r
-       <property name="outdir" value="bin" />\r
-\r
+    <!-- The intermediates directory -->\r
+    <!-- Eclipse uses "bin" for its own output, so we do the same. -->\r
+    <property name="outdir" value="bin" />\r
+       \r
        <!-- OpenIntents library file -->\r
        <property name="openintents-lib-jar" value="lib/openintents-lib.jar" />\r
 \r
-       <!-- No user servicable parts below. -->\r
+    <!-- No user servicable parts below. -->\r
 \r
-       <property name="android-framework" value="${android-tools}/lib/framework.aidl" />\r
+       <property name="android-framework" value="${sdk-location}/platforms/${platform}/framework.aidl" />\r
 \r
        <!-- Input directories -->\r
-       <property name="resource-dir" value="res" />\r
-       <property name="asset-dir" value="assets" />\r
-       <property name="srcdir" value="src" />\r
-       <condition property="srcdir-ospath" value="${basedir}\${srcdir}" else="${basedir}/${srcdir}">\r
-               <os family="windows" />\r
+    <property name="resource-dir" value="res" />\r
+    <property name="asset-dir" value="assets" />\r
+    <property name="srcdir" value="src" />\r
+       <condition property="srcdir-ospath"\r
+               value="${basedir}\${srcdir}"\r
+               else="${basedir}/${srcdir}" >\r
+           <os family="windows"/>\r
        </condition>\r
 \r
        <property name="external-libs" value="lib" />\r
-       <condition property="external-libs-ospath" value="${basedir}\${external-libs}" else="${basedir}/${external-libs}">\r
-               <os family="windows" />\r
-       </condition>\r
-\r
-       <!-- Output directories -->\r
-       <property name="outdir-classes" value="${outdir}/classes" />\r
-       <condition property="outdir-classes-ospath" value="${basedir}\${outdir-classes}" else="${basedir}/${outdir-classes}">\r
-               <os family="windows" />\r
+       <condition property="external-libs-ospath"\r
+               value="${basedir}\${external-libs}"\r
+               else="${basedir}/${external-libs}" >\r
+           <os family="windows"/>\r
+       </condition>
+       <property name="googlemaps" value="${sdk-location}/add-ons/google_apis-3/libs" />\r
+       \r
+    <!-- Output directories -->\r
+    <property name="outdir-classes" value="${outdir}/classes" />\r
+       <condition property="outdir-classes-ospath"\r
+               value="${basedir}\${outdir-classes}"\r
+               else="${basedir}/${outdir-classes}" >\r
+           <os family="windows"/>\r
        </condition>\r
-\r
+               \r
        <property name="docdir" value="doc" />\r
        <property name="releasedir" value="release" />\r
-\r
-       <!-- Create R.java in the source directory -->\r
-       <property name="outdir-r" value="src" />\r
-\r
-       <!-- Intermediate files -->\r
-       <property name="dex-file" value="classes.dex" />\r
-       <property name="intermediate-dex" value="${outdir}/${dex-file}" />\r
-       <condition property="intermediate-dex-ospath" value="${basedir}\${intermediate-dex}" else="${basedir}/${intermediate-dex}">\r
-               <os family="windows" />\r
-       </condition>\r
-\r
-       <!-- The final package file to generate -->\r
-       <property name="resources-package" value="${outdir}/${ant.project.name}.ap_" />\r
-       <condition property="resources-package-ospath" value="${basedir}\${resources-package}" else="${basedir}/${resources-package}">\r
-               <os family="windows" />\r
-       </condition>\r
-\r
-       <property name="out-debug-package" value="${outdir}/${ant.project.name}.apk" />\r
-       <condition property="out-debug-package-ospath" value="${basedir}\${out-debug-package}" else="${basedir}/${out-debug-package}">\r
-               <os family="windows" />\r
-       </condition>\r
-\r
-       <property name="out-unsigned-package" value="${outdir}/${ant.project.name}-unsigned.apk" />\r
-       <condition property="out-unsigned-package-ospath" value="${basedir}\${out-unsigned-package}" else="${basedir}/${out-unsigned-package}">\r
-               <os family="windows" />\r
-       </condition>\r
-\r
+    \r
+    <!-- Create R.java in the source directory -->\r
+    <property name="outdir-r" value="gen" />\r
+\r
+    <!-- Intermediate files -->\r
+    <property name="dex-file" value="classes.dex" />\r
+    <property name="intermediate-dex" value="${outdir}/${dex-file}" />\r
+    <condition property="intermediate-dex-ospath"\r
+            value="${basedir}\${intermediate-dex}"\r
+            else="${basedir}/${intermediate-dex}" >\r
+        <os family="windows"/>\r
+    </condition>\r
+\r
+    <!-- The final package file to generate -->\r
+    <property name="resources-package" value="${outdir}/${ant.project.name}.ap_" />\r
+    <condition property="resources-package-ospath"\r
+            value="${basedir}\${resources-package}"\r
+            else="${basedir}/${resources-package}" >\r
+        <os family="windows"/>\r
+    </condition>\r
+\r
+    <property name="out-debug-package" value="${outdir}/${ant.project.name}.apk" />\r
+    <condition property="out-debug-package-ospath"\r
+            value="${basedir}\${out-debug-package}"\r
+            else="${basedir}/${out-debug-package}" >\r
+        <os family="windows"/>\r
+    </condition>\r
+\r
+    <property name="out-unsigned-package" value="${outdir}/${ant.project.name}-unsigned.apk" />\r
+    <condition property="out-unsigned-package-ospath"\r
+            value="${basedir}\${out-unsigned-package}"\r
+            else="${basedir}/${out-unsigned-package}" >\r
+        <os family="windows"/>\r
+    </condition>\r
+       \r
        <property name="out-signed-package" value="${outdir}/${ant.project.name}-${version}.apk" />\r
-       <condition property="out-signed-package-ospath" value="${basedir}\${out-signed-package}" else="${basedir}/${out-signed-package}">\r
-               <os family="windows" />\r
+       <condition property="out-signed-package-ospath"\r
+                   value="${basedir}\${out-signed-package}"\r
+                   else="${basedir}/${out-signed-package}" >\r
+               <os family="windows"/>\r
        </condition>\r
 \r
        <property name="out-release-source" value="${releasedir}/${ant.project.name}-source-${version}" />\r
@@ -94,248 +125,282 @@ storepass=*password of keystore*
                    else="${basedir}/${out-release-source}" >\r
                <os family="windows"/>\r
        </condition>\r
-\r
-       <!-- Tools -->\r
-       <condition property="aapt" value="${android-tools}/aapt.exe" else="${android-tools}/aapt">\r
-               <os family="windows" />\r
-       </condition>\r
-       <condition property="aidl" value="${android-tools}/aidl.exe" else="${android-tools}/aidl">\r
-               <os family="windows" />\r
-       </condition>\r
-       <condition property="adb" value="${android-tools}/adb.exe" else="${android-tools}/adb">\r
-               <os family="windows" />\r
-       </condition>\r
-       <condition property="dx" value="${android-tools}/dx.bat" else="${android-tools}/dx">\r
-               <os family="windows" />\r
-       </condition>\r
-       <condition property="apk-builder" value="${android-tools}/apkbuilder.bat" else="${android-tools}/apkbuilder">\r
-               <os family="windows" />\r
+       \r
+    <!-- Tools -->\r
+    <condition property="aapt" value="${platform-tools}/aapt.exe" else="${platform-tools}/aapt" >\r
+        <os family="windows"/>\r
+    </condition>\r
+    <condition property="aidl" value="${platform-tools}/aidl.exe" else="${platform-tools}/aidl" >\r
+        <os family="windows"/>\r
+    </condition>\r
+    <condition property="adb" value="${android-tools}/adb.exe" else="${android-tools}/adb" >\r
+        <os family="windows"/>\r
+    </condition>\r
+    <condition property="dx" value="${platform-tools}/dx.bat" else="${platform-tools}/dx" >\r
+        <os family="windows"/>\r
+    </condition>\r
+    <condition property="apk-builder" value="${android-tools}/apkbuilder.bat" else="${android-tools}/apkbuilder" >\r
+        <os family="windows"/>\r
+    </condition>\r
+       \r
+       <condition property="apk-builder" value="${android-tools}/apkbuilder.bat" else="${android-tools}/apkbuilder" >\r
+              <os family="windows"/>\r
        </condition>\r
 \r
-       <condition property="apk-builder" value="${android-tools}/apkbuilder.bat" else="${android-tools}/apkbuilder">\r
-               <os family="windows" />\r
-       </condition>\r
 \r
-       <condition property="android-jar" value="${sdk-folder}\android.jar" else="${sdk-folder}/android.jar">\r
-               <os family="windows" />\r
+       <condition property="android-jar" \r
+               value="${sdk-folder}\android.jar" \r
+               else="${sdk-folder}/android.jar" >\r
+               <os family="windows"/>\r
        </condition>\r
 \r
-       <!-- Rules -->\r
-\r
-       <!-- Create the output directories if they don't exist yet. -->\r
-       <target name="dirs">\r
-               <mkdir dir="${outdir}" />\r
-               <delete dir="${outdir-classes}" />\r
-               <mkdir dir="${outdir-classes}" />\r
-       </target>\r
+    <!-- Rules -->\r
+    <!-- Custom tasks -->\r
+<!-- 1.5 Changes START -->\r
+<!--    <taskdef name="setup"\r
+        classname="com.android.ant.SetupTask"\r
+        classpathref="android.antlibs"/>\r
+       <setup import="false" />\r
+-->\r
+    <taskdef name="aaptexec"\r
+        classname="com.android.ant.AaptExecLoopTask"\r
+        classpathref="android.antlibs"/>\r
+\r
+    <taskdef name="apkbuilder"\r
+        classname="com.android.ant.ApkBuilderTask"\r
+        classpathref="android.antlibs"/>\r
+               \r
+<!-- 1.5 Changes END -->\r
+\r
+\r
+               <!-- Create the output directories if they don't exist yet. -->\r
+    <target name="dirs">\r
+        <mkdir dir="${outdir}" />\r
+       <delete dir="${outdir-classes}"/>\r
+        <mkdir dir="${outdir-classes}" />\r
+    </target>\r
 \r
        <target name="clear_layout">\r
                <echo>purging .bak files </echo>\r
                <delete>\r
-                       <fileset dir="." includes="**/*.bak" />\r
+                       <fileset dir="." includes="**/*.bak"/>\r
                </delete>\r
        </target>\r
+       \r
+    <!-- Generate the R.java file for this project's resources. -->\r
+    <target name="resource-src" depends="dirs">\r
+        <echo>Generating R.java / Manifest.java from the resources...</echo>\r
+        <exec executable="${aapt}" failonerror="true">\r
+            <arg value="package" />\r
+            <arg value="-m" />\r
+            <arg value="-J" />\r
+            <arg value="${outdir-r}" />\r
+            <arg value="-M" />\r
+            <arg value="AndroidManifest.xml" />\r
+            <arg value="-S" />\r
+            <arg value="${resource-dir}" />\r
+            <arg value="-I" />\r
+            <arg value="${android-jar}" />\r
+        </exec>\r
+    </target>\r
 \r
-       <!-- Generate the R.java file for this project's resources. -->\r
-       <target name="resource-src" depends="dirs">\r
-               <echo>Generating R.java / Manifest.java from the resources...</echo>\r
-               <exec executable="${aapt}" failonerror="true">\r
-                       <arg value="package" />\r
-                       <arg value="-m" />\r
-                       <arg value="-J" />\r
-                       <arg value="${outdir-r}" />\r
-                       <arg value="-M" />\r
-                       <arg value="AndroidManifest.xml" />\r
-                       <arg value="-S" />\r
-                       <arg value="${resource-dir}" />\r
-                       <arg value="-I" />\r
-                       <arg value="${android-jar}" />\r
-               </exec>\r
-       </target>\r
-\r
-       <!-- Generate java classes from .aidl files. -->\r
-       <target name="aidl" depends="dirs">\r
-               <echo>Compiling aidl files into Java classes...</echo>\r
-               <apply executable="${aidl}" failonerror="true">\r
-                       <arg value="-p${android-framework}" />\r
-                       <arg value="-I${srcdir}" />\r
-                       <fileset dir="${srcdir}">\r
-                               <include name="**/*.aidl" />\r
-                       </fileset>\r
-               </apply>\r
-       </target>\r
-\r
-       <!-- Compile this project's .java files into .class files. -->\r
-       <target name="compile" depends="dirs, resource-src, aidl">\r
-               <javac encoding="ascii" target="1.5" debug="true" extdirs="" srcdir="." destdir="${outdir-classes}" bootclasspath="${android-jar}">\r
-               <exclude name="gen/**" /> <!-- SDK 1.5: backward compatibility with SDK 1.1 -->\r
-                       <classpath>\r
-                               <fileset dir="${external-libs}" includes="*.jar" />\r
-                       </classpath>\r
-               </javac>\r
-       </target>\r
+    <!-- Generate java classes from .aidl files. -->\r
+    <target name="aidl" depends="dirs">\r
+        <echo>Compiling aidl files into Java classes...</echo>\r
+        <apply executable="${aidl}" failonerror="true">\r
+            <arg value="-p${android-framework}" />
+           <arg value="-I${srcdir}" />\r
+            <arg value="-o${outdir-r}" />\r
+            <fileset dir="${srcdir}">\r
+                <include name="**/*.aidl"/>\r
+            </fileset>\r
+        </apply>\r
+    </target>\r
 \r
+    <!-- Compile this project's .java files into .class files. -->\r
+    <target name="compile" depends="dirs,clear_layout, resource-src, aidl">\r
+               <echo>using sdk --|${android-jar}|--</echo>\r
+               \r
+        <javac encoding="ascii" target="1.5" debug="true" extdirs=""\r
+                \r
+                destdir="${outdir-classes}"\r
+                bootclasspath="${android-jar}">\r
+               <src path="."/>\r
+               <src path="./gen"/>\r
+            <classpath>\r
+                <fileset dir="${external-libs}" includes="*.jar"/>
+               <fileset dir="${googlemaps}" includes="*.jar"/>\r
+            </classpath>\r
+         </javac>\r
+    </target>\r
+       \r
 \r
-       <target name="optimize" depends="compile">\r
-               <!-- unless="debug" -->\r
-               <jar basedir="${outdir-classes}" destfile="temp.jar" />\r
-               <java jar="${proguard.jar}" fork="true" failonerror="true">\r
-                       <!-- <jvmarg value="-Dmaximum.inlined.code.length=32"/> -->\r
-                       <arg value="-injars temp.jar" />\r
-                       <arg value="-outjars optimized.jar" />\r
-                       <arg value="-libraryjars '${android-jar}'" />\r
-                       <!-- <arg value="-dontpreverify"/> -->\r
-                       <!-- <arg value="-dontobfuscate"/> -->\r
-                       <arg value="-printmapping obfuscated.txt" />\r
-                       <arg value="-printusage obfuscated_deadcode.txt" />\r
-                       <arg value="-dontusemixedcaseclassnames" />\r
-                       <arg value="-dontoptimize" />\r
-                       <arg value="-dontshrink" />\r
-                       <arg value="-keep public class org.openintents.news.channels.SearchSuggestionProvider" />\r
-                       <arg value="-keep public class org.openintents.news.NewsProvider" />\r
-                       <arg value="-keep public class org.openintents.news.reader.Newsreader" />\r
-                       <arg value="-keep public class org.openintents.news.reader.EulaActivity" />\r
-                       <arg value="-keep public class org.openintents.news.help.PreselectedChannelsActivity" />\r
-                       <arg value="-keep public class org.openintents.news.channels.ChannelSettings" />\r
-                       <arg value="-keep public class org.openintents.news.services.NewsServiceSettings" />\r
-                       <arg value="-keep public class org.openintents.news.messages.AFeedMessages" />\r
-                       <arg value="-keep public class org.openintents.news.channels.ChannelSettings" />\r
-                       <arg value="-keep public class org.openintents.news.channels.ActionSpinner" />\r
-                       <arg value="-keep public class org.openintents.news.categories.AddCategoryActivity" />\r
-                       <arg value="-keep public class org.openintents.news.categories.CategoriesListActivity" />\r
-                       <arg value="-keep public class org.openintents.news.channels.ChannelListView" />\r
-                       <arg value="-keep public class org.openintents.news.About" />\r
-                       <arg value="-keep public class org.openintents.lib.ConfirmDialogPreference" />\r
-                       <arg value="-keep public class org.openintents.news.services.AutostartService" />\r
-                       <arg value="-keep public class org.openintents.news.services.RoamingWatcher" />\r
-                       <arg value="-keep public class org.openintents.news.services.NewsreaderService" />\r
-\r
-                       <!-- <arg value="-optimizationpasses 7"/> -->\r
-                       <!-- <arg value="-overloadaggressively"/> -->\r
-                       <arg value="-verbose" />\r
-               </java>\r
-               <delete file="temp.jar" />\r
-               <delete dir="${outdir-classes}" />\r
-               <mkdir dir="${outdir-classes}" />\r
-               <unzip src="optimized.jar" dest="${outdir-classes}" />\r
-               <!-- <delete file="optimized.jar"/> -->\r
-       </target>\r
 \r
+         <target name="optimize" depends="compile"> <!-- unless="debug" -->\r
+               <mkdir dir="tmp" />\r
+               <jar basedir="${outdir-classes}" destfile="tmp/temp.jar"/>\r
+           <java jar="${proguard.jar}" fork="true" failonerror="true">\r
+            <!-- <jvmarg value="-Dmaximum.inlined.code.length=32"/> -->\r
+            <arg value="-injars tmp/temp.jar"/>\r
+            <arg value="-outjars tmp/optimized.jar"/>\r
+            <arg value="-libraryjars '${android-jar}'"/>\r
+            <!-- <arg value="-dontpreverify"/> -->\r
+            <!-- <arg value="-dontobfuscate"/> -->\r
+            <arg value="-printmapping tmp/obfuscated.txt"/>\r
+            <arg value="-printusage tmp/obfuscated_deadcode.txt"/>\r
+            <arg value="-dontusemixedcaseclassnames"/>\r
+            <arg value="-dontoptimize"/>\r
+            <arg value="-dontshrink"/>\r
+            <arg value="-keep public class org.openintents.flashlight.ColorPickerActivity"/>\r
+            <arg value="-keep public class org.openintents.flashlight.Flashlight"/>\r
+            <arg value="-keep public class android.content.BroadcastReceiver"/>\r
+            <arg value="-keep public class org.openintents.widget.ColorCircle"/>\r
+            <arg value="-keep public class org.openintents.widget.ColorSlider"/>\r
+                <arg value="-keep public class org.openintents.distribution.EulaActivity"/>\r
+                <arg value="-keep public class org.openintents.distribution.AboutActivity"/>\r
+                <!-- <arg value="-keep public class org.openintents.splashplay.widget.LazyLinearLayout {\r
+                       public LazyLinearLayout(android.content.Context,android.util.AttributeSet);\r
+                        public LazyLinearLayout(android.content.Context);\r
+                        }" /> -->\r
+                       \r
+            <!-- <arg value="-optimizationpasses 7"/> -->\r
+            <!-- <arg value="-overloadaggressively"/> -->\r
+            <arg value="-verbose"/>\r
+          </java>\r
+          <delete file="tmp/temp.jar"/>\r
+          <delete dir="${outdir-classes}"/>\r
+          <mkdir dir="${outdir-classes}"/>\r
+          <unzip src="tmp/optimized.jar" dest="${outdir-classes}"/>\r
+          <delete file="tmp/optimized.jar"/>\r
+         </target>\r
+\r
+\r
+    <!-- Convert this project's .class files into .dex files. currently no optimization add >>,optimize<< to depends attr -->\r
+    <target name="dex" depends="compile">\r
+        <echo>Converting compiled files and external libraries into ${outdir}/${dex-file}...</echo>\r
+        <apply executable="${dx}" failonerror="true" parallel="true">\r
+            <arg value="--dex" />\r
+            <arg value="--output=${intermediate-dex-ospath}" />\r
+            <arg path="${outdir-classes-ospath}" />\r
+            <fileset dir="${external-libs}" includes="*.jar"/>\r
+        </apply>\r
+    </target>\r
 \r
-       <!-- Convert this project's .class files into .dex files. -->\r
-       <target name="dex" depends="compile">\r
-               <echo>Converting compiled files and external libraries into ${outdir}/${dex-file}...</echo>\r
-               <apply executable="${dx}" failonerror="true" parallel="true">\r
-                       <arg value="--dex" />\r
-                       <arg value="--output=${intermediate-dex-ospath}" />\r
-                       <arg path="${outdir-classes-ospath}" />\r
-                       <fileset dir="${external-libs}" includes="*.jar" />\r
-               </apply>\r
-       </target>\r
+    <!-- Convert this project's .class files into .dex files. -->\r
+    <target name="dex-debug" depends="compile">\r
+        <echo>Converting compiled files and external libraries into ${outdir}/${dex-file}...</echo>\r
+        <apply executable="${dx}" failonerror="true" parallel="true">\r
+            <arg value="--dex" />\r
+            <arg value="--output=${intermediate-dex-ospath}" />\r
+            <arg path="${outdir-classes-ospath}" />\r
+            <fileset dir="${external-libs}" includes="*.jar"/>\r
+        </apply>\r
+    </target>\r
 \r
-       <!-- Put the project's resources into the output package file. -->\r
-       <target name="package-res-and-assets">\r
-               <echo>Packaging resources and assets...</echo>\r
-               <exec executable="${aapt}" failonerror="true">\r
-                       <arg value="package" />\r
-                       <arg value="-f" />\r
-                       <arg value="-M" />\r
-                       <arg value="AndroidManifest.xml" />\r
-                       <arg value="-S" />\r
-                       <arg value="${resource-dir}" />\r
-                       <arg value="-A" />\r
-                       <arg value="${asset-dir}" />\r
-                       <arg value="-I" />\r
-                       <arg value="${android-jar}" />\r
-                       <arg value="-F" />\r
-                       <arg value="${resources-package}" />\r
-               </exec>\r
-       </target>\r
+    <!-- Put the project's resources into the output package file. -->\r
+    <target name="package-res-and-assets">\r
+        <echo>Packaging resources and assets...</echo>\r
+        <exec executable="${aapt}" failonerror="true">\r
+            <arg value="package" />\r
+            <arg value="-f" />\r
+            <arg value="-M" />\r
+            <arg value="AndroidManifest.xml" />\r
+            <arg value="-S" />\r
+            <arg value="${resource-dir}" />\r
+            <arg value="-A" />\r
+            <arg value="${asset-dir}" />\r
+            <arg value="-I" />\r
+            <arg value="${android-jar}" />\r
+            <arg value="-F" />\r
+            <arg value="${resources-package}" />\r
+        </exec>\r
+    </target>\r
 \r
-       <!-- Same as package-res-and-assets, but without "-A ${asset-dir}" -->\r
-       <target name="package-res-no-assets">\r
-               <echo>Packaging resources...</echo>\r
-               <exec executable="${aapt}" failonerror="true">\r
-                       <arg value="package" />\r
-                       <arg value="-f" />\r
-                       <arg value="-M" />\r
-                       <arg value="AndroidManifest.xml" />\r
-                       <arg value="-S" />\r
-                       <arg value="${resource-dir}" />\r
-                       <!-- No assets directory -->\r
-                       <arg value="-I" />\r
-                       <arg value="${android-jar}" />\r
-                       <arg value="-F" />\r
-                       <arg value="${resources-package}" />\r
-               </exec>\r
-       </target>\r
+    <!-- Same as package-res-and-assets, but without "-A ${asset-dir}" -->\r
+    <target name="package-res-no-assets">\r
+        <echo>Packaging resources...</echo>\r
+        <exec executable="${aapt}" failonerror="true">\r
+            <arg value="package" />\r
+            <arg value="-f" />\r
+            <arg value="-M" />\r
+            <arg value="AndroidManifest.xml" />\r
+            <arg value="-S" />\r
+            <arg value="${resource-dir}" />\r
+            <!-- No assets directory -->\r
+            <arg value="-I" />\r
+            <arg value="${android-jar}" />\r
+            <arg value="-F" />\r
+            <arg value="${resources-package}" />\r
+        </exec>\r
+    </target>\r
 \r
-       <!-- Invoke the proper target depending on whether or not\r
+    <!-- Invoke the proper target depending on whether or not\r
          an assets directory is present. -->\r
-       <!-- TODO: find a nicer way to include the "-A ${asset-dir}" argument\r
+    <!-- TODO: find a nicer way to include the "-A ${asset-dir}" argument\r
          only when the assets dir exists. -->\r
-       <target name="package-res">\r
-               <available file="${asset-dir}" type="dir" property="res-target" value="and-assets" />\r
-               <property name="res-target" value="no-assets" />\r
-               <antcall target="package-res-${res-target}" />\r
-       </target>\r
+    <target name="package-res">\r
+        <available file="${asset-dir}" type="dir"\r
+                property="res-target" value="and-assets" />\r
+        <property name="res-target" value="no-assets" />\r
+        <antcall target="package-res-${res-target}" />\r
+    </target>\r
 \r
-       <!-- Package the application and sign it with a debug key.\r
+    <!-- Package the application and sign it with a debug key.\r
                 This is the default target when building. It is used for debug. -->\r
-       <target name="debug" depends="dex, package-res">\r
-               <echo>Packaging ${out-debug-package}, and signing it with a debug key...</echo>\r
-               <exec executable="${apk-builder}" failonerror="true">\r
-                       <arg value="${out-debug-package-ospath}" />\r
-                       <arg value="-z" />\r
-                       <arg value="${resources-package-ospath}" />\r
-                       <arg value="-f" />\r
-                       <arg value="${intermediate-dex-ospath}" />\r
-                       <arg value="-rf" />\r
-                       <arg value="${srcdir-ospath}" />\r
-                       <arg value="-rj" />\r
-                       <arg value="${external-libs-ospath}" />\r
-               </exec>\r
-       </target>\r
+    <target name="debug" depends="dex-debug, package-res">\r
+        <echo>Packaging ${out-debug-package}, and signing it with a debug key...</echo>\r
+        <exec executable="${apk-builder}" failonerror="true">\r
+            <arg value="${out-debug-package-ospath}" />\r
+            <arg value="-z" />\r
+            <arg value="${resources-package-ospath}" />\r
+            <arg value="-f" />\r
+            <arg value="${intermediate-dex-ospath}" />\r
+            <arg value="-rf" />\r
+            <arg value="${srcdir-ospath}" />\r
+            <arg value="-rj" />\r
+            <arg value="${external-libs-ospath}" />\r
+        </exec>\r
+    </target>\r
 \r
-       <!-- Package the application without signing it.\r
+    <!-- Package the application without signing it.\r
         This allows for the application to be signed later with an official publishing key. -->\r
-       <target name="release" depends="dex, package-res">\r
-               <echo>Packaging ${out-unsigned-package} for release...</echo>\r
-               <exec executable="${apk-builder}" failonerror="true">\r
-                       <arg value="${out-unsigned-package-ospath}" />\r
-                       <arg value="-u" />\r
-                       <arg value="-z" />\r
-                       <arg value="${resources-package-ospath}" />\r
-                       <arg value="-f" />\r
-                       <arg value="${intermediate-dex-ospath}" />\r
-                       <arg value="-rf" />\r
-                       <arg value="${srcdir-ospath}" />\r
-                       <arg value="-rj" />\r
-                       <arg value="${external-libs-ospath}" />\r
-               </exec>\r
-               <signjar jar="${out-unsigned-package-ospath}" alias="${cert-alias}" keystore="${keystore}" storepass="${storepass}" signedjar="${out-signed-package-ospath}" />\r
-       </target>\r
-\r
-       <!-- Install the package on the default emulator -->\r
-       <target name="install" depends="debug">\r
-               <echo>Installing ${out-debug-package} onto default emulator...</echo>\r
-               <exec executable="${adb}" failonerror="true">\r
-                       <arg value="install" />\r
-                       <arg value="${out-debug-package}" />\r
-               </exec>\r
-       </target>\r
-\r
-       <target name="reinstall" depends="debug">\r
-               <echo>Installing ${out-debug-package} onto default emulator...</echo>\r
-               <exec executable="${adb}" failonerror="true">\r
-                       <arg value="install" />\r
-                       <arg value="-r" />\r
-                       <arg value="${out-debug-package}" />\r
-               </exec>\r
-       </target>\r
+    <target name="release" depends="dex-debug, package-res">\r
+        <echo>Packaging ${out-unsigned-package} for release...</echo>\r
+        <exec executable="${apk-builder}" failonerror="true">\r
+            <arg value="${out-unsigned-package-ospath}" />\r
+            <arg value="-u" />\r
+            <arg value="-z" />\r
+            <arg value="${resources-package-ospath}" />\r
+            <arg value="-f" />\r
+            <arg value="${intermediate-dex-ospath}" />\r
+            <arg value="-rf" />\r
+            <arg value="${srcdir-ospath}" />\r
+            <arg value="-rj" />\r
+            <arg value="${external-libs-ospath}" />\r
+        </exec>\r
+       <signjar jar="${out-unsigned-package-ospath}" alias="${cert-alias}" keystore="${keystore}" storepass="${storepass}" keypass="${keypass}" signedjar="${out-signed-package-ospath}"/>\r
+       \r
+    </target>\r
 \r
+    <!-- Install the package on the default emulator -->\r
+    <target name="install" depends="debug">\r
+        <echo>Installing ${out-debug-package} onto default emulator...</echo>\r
+        <exec executable="${adb}" failonerror="true">\r
+            <arg value="install" />\r
+            <arg value="${out-debug-package}" />\r
+        </exec>\r
+    </target>\r
 \r
-       <!-- Install the package on the default emulator -->\r
+    <target name="reinstall" depends="debug">\r
+        <echo>Installing ${out-debug-package} onto default emulator...</echo>\r
+        <exec executable="${adb}" failonerror="true">\r
+            <arg value="install" />\r
+            <arg value="-r" />\r
+            <arg value="${out-debug-package}" />\r
+        </exec>\r
+    </target>\r
+       \r
+       <!-- Install the signed package on the default emulator -->\r
        <target name="install-signed" depends="release">\r
                <echo>Installing ${out-signed-package} onto default emulator...</echo>\r
                <exec executable="${adb}" failonerror="true">\r
@@ -352,26 +417,26 @@ storepass=*password of keystore*
                        <arg value="${out-signed-package}" />\r
                </exec>\r
        </target>\r
-                       \r
-       <!-- Uinstall the package from the default emulator -->\r
-       <target name="uninstall">\r
-               <echo>Uninstalling ${application-package} from the default emulator...</echo>\r
-               <exec executable="${adb}" failonerror="true">\r
-                       <arg value="uninstall" />\r
-                       <arg value="${application-package}" />\r
-               </exec>\r
-       </target>\r
-\r
-\r
 \r
+    <!-- Uinstall the package from the default emulator -->\r
+    <target name="uninstall">\r
+        <echo>Uninstalling ${application-package} from the default emulator...</echo>\r
+        <exec executable="${adb}" failonerror="true">\r
+            <arg value="uninstall" />\r
+            <arg value="${application-package}" />\r
+        </exec>\r
+    </target>\r
+       \r
 \r
        <!-- ############### JavaDoc ####################### -->\r
        <!-- Create JavaDoc -->\r
        <target name="javadoc">\r
                <delete dir="${docdir}" />\r
-               <javadoc access="public" author="true" destdir="${docdir}" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" source="1.6" sourcepath="${srcdir}" splitindex="true" use="true" version="true">\r
-               </javadoc>\r
-       </target>\r
+               <javadoc access="public" author="true" destdir="${docdir}" \r
+               nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" \r
+               source="1.6" sourcepath="${srcdir}" splitindex="true" use="true" version="true">\r
+        </javadoc>\r
+    </target>\r
 \r
        <!-- ############### Release source ####################### -->\r
        <!-- Copy to source release -->\r
@@ -395,6 +460,7 @@ storepass=*password of keystore*
     </target>\r
        \r
        <!-- ############ Convencience target ############## -->\r
-       <target name="all" depends="debug, javadoc" />\r
-\r
+       <target name="all" \r
+               depends="debug, javadoc" />\r
+       \r
 </project>\r
index 9ef6f0cea815b34d72a9fb9a91bc5c362b8270b1..6b9817fb78297deec74d7443ed643b4b8a0c9dab 100644 (file)
        <string name="search">Search</string>\r
        <string name="search_progress">Searching...</string>\r
        <string name="search_hint">Type search criteria</string>\r
+       <string name="search_nothing_found">Nothing found</string>\r
        \r
        \r
        <!-- ***************************\r
index 436404553f1e32c18943493f4aee901760e5c013..ec8ac77e21a62e5dfd0712dedf88b4f79507c982 100644 (file)
@@ -53,7 +53,7 @@ import android.widget.Toast;
  */
 public class AskPassword extends Activity {
 
-       private boolean debug = true;
+       private boolean debug = false;
        private static String TAG = "AskPassword";
        public static String EXTRA_IS_LOCAL = "org.openintents.safe.bundle.EXTRA_IS_REMOTE";
 
index ba92df8292499e482ffd9b98ee461471a34c1d3f..bb6ebffb8807402cf77db50e77d94cd6d617ba5c 100644 (file)
@@ -55,6 +55,7 @@ import android.view.View;
 import android.view.ContextMenu.ContextMenuInfo;
 import android.widget.AdapterView;
 import android.widget.ArrayAdapter;
+import android.widget.ListAdapter;
 import android.widget.ListView;
 import android.widget.Toast;
 import android.widget.AdapterView.AdapterContextMenuInfo;
@@ -119,7 +120,7 @@ public class CategoryList extends ListActivity {
        private static String salt;
     private static String masterKey;                   
 
-    private List<CategoryEntry> rows;
+    private List<CategoryEntry> rows=null;
     private Intent restartTimerIntent=null;
     private int lastPosition=0;
     
@@ -231,7 +232,7 @@ public class CategoryList extends ListActivity {
         filter.addAction (CryptoIntents.ACTION_CRYPTO_LOGGED_OUT);
         registerReceiver(mIntentReceiver, filter);
 
-               fillData();
+//             fillData();
 
                final ListView list = getListView();
                list.setFocusable(true);
@@ -257,6 +258,14 @@ public class CategoryList extends ListActivity {
         showFirstTimeWarningDialog();
                SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
                lockOnScreenLock = sp.getBoolean(Preferences.PREFERENCE_LOCK_ON_SCREEN_LOCK, true);
+
+               ListAdapter la=getListAdapter();
+        if (la!=null) {
+               if (debug) Log.d(TAG,"onResume: count="+la.getCount());
+        } else {
+               if (debug) Log.d(TAG,"onResume: no list");
+               fillData();
+        }
     }
 
        /**
@@ -398,6 +407,7 @@ public class CategoryList extends ListActivity {
                List<String> categoryNames=Passwords.getCategoryNames();
                
                rows=Passwords.getCategoryEntries();
+               if (debug) Log.d(TAG,"fillData: rows="+rows.size());
                
                ArrayAdapter<String> entries = 
                    new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,
index 9be50b8b4bd945a668e9230bcd2a2d6afb7330ad..cf5822a7dde2c118639e1f5fcd67a61bd35be5ac 100644 (file)
@@ -35,7 +35,7 @@ import android.util.Log;
 public class FrontDoor extends Activity {\r
 \r
     private static final String TAG = "FrontDoor";\r
-       private static final boolean debug = true;\r
+       private static final boolean debug = false;\r
 \r
 //     public static final String KEY_AUTOLOCK = "autolock";\r
        \r
index a49f1a06b09d24de085b9de07f8481c3f1dadb69..c0f2fe284a3ca03ec2eab973cdefd6dabf491c8b 100644 (file)
@@ -49,7 +49,7 @@ import android.widget.Toast;
  */\r
 public class IntentHandler extends Activity {\r
 \r
-       private static final boolean debug = true;\r
+       private static final boolean debug = false;\r
        private static String TAG = "IntentHandler";\r
        \r
        private static final int REQUEST_CODE_ASK_PASSWORD = 1;\r
index 8b513f1f46e28d0a73c7dbf723e1fa5bf4d28d08..f4b9956e3f6f9a84c28d50bc6f9dcc352f1cf306 100644 (file)
@@ -45,6 +45,7 @@ import android.view.MenuItem;
 import android.view.ContextMenu.ContextMenuInfo;
 import android.widget.AdapterView;
 import android.widget.ArrayAdapter;
+import android.widget.ListAdapter;
 import android.widget.ListView;
 import android.widget.Toast;
 import android.widget.AdapterView.AdapterContextMenuInfo;
@@ -60,7 +61,7 @@ import android.widget.AdapterView.AdapterContextMenuInfo;
  */
 public class PassList extends ListActivity {
 
-       private static final boolean debug = true;
+       private static final boolean debug = false;
     private static final String TAG = "PassList";
 
     // Menu Item order
@@ -92,7 +93,7 @@ public class PassList extends ListActivity {
     
        private Thread fillerThread=null;
 
-    private List<PassEntry> rows;
+    private List<PassEntry> rows=null;
     private int lastPosition=0;
        List<String> passDescriptions=new ArrayList<String>();
 
@@ -101,11 +102,11 @@ public class PassList extends ListActivity {
                public void handleMessage(Message msg) {
                        switch (msg.what) {
                                case PassList.MSG_UPDATE_LIST:
-                                       ArrayAdapter<String> entries = 
-                                           new ArrayAdapter<String>(PassList.this, android.R.layout.simple_list_item_1,
-                                                       passDescriptions);
-                                       setListAdapter(entries);
-
+                                       fillerThread=null;
+                               ArrayAdapter<String> entries = 
+                                       new ArrayAdapter<String>(PassList.this, android.R.layout.simple_list_item_1,
+                                                       passDescriptions);
+                               setListAdapter(entries);
                                        if (debug) Log.d(TAG,"lastPosition="+lastPosition);
                                        if (lastPosition>2) {
                                                setSelection(lastPosition-1);
@@ -160,7 +161,7 @@ public class PassList extends ListActivity {
                        categoryName;
                setTitle(title);
 
-               fillData();
+//             fillData();
 
                final ListView list = getListView();
                list.setFocusable(true);
@@ -213,6 +214,14 @@ public class PassList extends ListActivity {
                }
         IntentFilter filter = new IntentFilter(CryptoIntents.ACTION_CRYPTO_LOGGED_OUT);
         registerReceiver(mIntentReceiver, filter);
+
+        ListAdapter la=getListAdapter();
+        if (la!=null) {
+               if (debug) Log.d(TAG,"onResume: count="+la.getCount());
+        } else {
+               if (debug) Log.d(TAG,"onResume: no list");
+               fillData();
+        }
     }
     
     @Override
@@ -266,6 +275,15 @@ public class PassList extends ListActivity {
      * Populates the password ListView
      */
        private void fillData() {
+               if (fillerThread!=null) {
+                       if (fillerThread.isAlive()) {
+                               // there's already a thread running
+                       } else {
+                               showDialog(DECRYPT_PROGRESS_KEY);
+                               fillerThread.run();
+                       }
+                       return;
+               }
                showDialog(DECRYPT_PROGRESS_KEY);
 
                fillerThread = new Thread(new Runnable() {
@@ -287,7 +305,7 @@ public class PassList extends ListActivity {
                                mu.what = PassList.MSG_UPDATE_LIST;
                                PassList.this.myViewUpdateHandler.sendMessage(mu); 
                        }
-               });
+               },"PassList fillData");
                fillerThread.start();
        }
 
index 0c75a0fba83cb1c813b38f58f996623b3be6179c..51e86c80b8ddf855012a1e7028ecda9a286ae1b1 100644 (file)
@@ -52,7 +52,7 @@ import android.widget.Toast;
  */
 public class PassView extends Activity implements View.OnClickListener {
 
-       private static boolean debug = true;
+       private static boolean debug = false;
        private static String TAG = "PassView";
 
        public static final int EDIT_PASSWORD_INDEX = Menu.FIRST;
index 71a916d0715c7bd5f38e42ca813304ef0f7932e9..e1066754b5a7ab578eddd555e637c4b878098024 100644 (file)
@@ -37,6 +37,7 @@ import android.widget.ArrayAdapter;
 import android.widget.Button;
 import android.widget.EditText;
 import android.widget.ListView;
+import android.widget.Toast;
 
 public class Search extends ListActivity {
        
@@ -65,6 +66,10 @@ public class Search extends ListActivity {
                switch (msg.what) {
                case MSG_SEARCH_COMPLETE:
                        setListAdapter(entries);
+                       if ((entries!=null) && (entries.isEmpty())) {
+                               Toast.makeText(Search.this, R.string.search_nothing_found,
+                                               Toast.LENGTH_LONG).show();
+                       }
                        break;
                }
                super.handleMessage(msg);
@@ -177,7 +182,7 @@ public class Search extends ListActivity {
                        ProgressDialog dialog = new ProgressDialog(this);
                        dialog.setMessage(getString(R.string.search_progress));
                        dialog.setIndeterminate(false);
-                       dialog.setCancelable(false);
+                       dialog.setCancelable(true);
                        return dialog;
                }
                }
@@ -190,6 +195,16 @@ public class Search extends ListActivity {
         * and permit the updating of the progress dialog.
         */
        private void searchThreadStart(){
+               if (searchThread!=null) {
+                       if (searchThread.isAlive()) {
+                               // it's already searching
+                       } else {
+                               // just rerun
+                               showDialog(SEARCH_PROGRESS_KEY);
+                               searchThread.run();
+                       }
+                       return;
+               }
                showDialog(SEARCH_PROGRESS_KEY);
                searchThread = new Thread(new Runnable() {
                        public void run() {
@@ -203,7 +218,7 @@ public class Search extends ListActivity {
 
                                if (debug) Log.d(TAG,"thread end");
                                }
-                       });
+                       },"Search");
                searchThread.start();
        }
 
@@ -214,7 +229,6 @@ public class Search extends ListActivity {
                        // don't bother searching for nothing
                        return;
                }
-
                
                List<CategoryEntry> categories=Passwords.getCategoryEntries();
                for (CategoryEntry catRow : categories) {
@@ -260,7 +274,8 @@ public class Search extends ListActivity {
        }
        
        private void updateListFromResults() {
-               if ((results==null) || (results.size()==0)) {
+               if (results==null) {
+//             if ((results==null) || (results.size()==0)) {
                        return;
                }