]> hydra-www.ietfng.org Git - android-vcpass-oisafe/commitdiff
OI Safe: Revert modification for now (could be used later after 1.1.0 is released).
authorpeli0101 <peli0101@72b678ce-9140-0410-bee8-679b907dd61a>
Sun, 15 Mar 2009 03:39:07 +0000 (03:39 +0000)
committerpeli0101 <peli0101@72b678ce-9140-0410-bee8-679b907dd61a>
Sun, 15 Mar 2009 03:39:07 +0000 (03:39 +0000)
git-svn-id: http://openintents.googlecode.com/svn/trunk/Safe@1994 72b678ce-9140-0410-bee8-679b907dd61a

AndroidManifest.xml
src/org/openintents/safe/CategoryList.java
src/org/openintents/safe/IntentHandler.java
src/org/openintents/safe/Passwords.java

index 8797381a1d173143d0506c9ccc2d40b23338662b..7262ba23a262e9616c43d0aca4c35ad025a4027c 100644 (file)
@@ -36,7 +36,7 @@
                        android:theme="@android:style/Theme.Translucent.NoTitleBar">
                <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
-                       <!-- <category android:name="android.intent.category.LAUNCHER" />  -->\r
+                       <category android:name="android.intent.category.LAUNCHER" />\r
             </intent-filter>           
         </activity>
         
         <activity class=".PassView" android:name="PassView" android:label="@string/app_name" />
         <activity class=".PassList" android:name="PassList" android:label="@string/app_name" />
         <activity class=".PassEdit" android:name="PassEdit" android:label="@string/app_name" />
-        <activity class=".CategoryList" android:name="CategoryList" android:label="@string/app_name" >\r
-               <intent-filter>\r
-                <action android:name="android.intent.action.MAIN" />\r
-                       <category android:name="android.intent.category.LAUNCHER" />\r
-            </intent-filter>\r
-        </activity>
+        <activity class=".CategoryList" android:name="CategoryList" android:label="@string/app_name" />
         <activity class=".AskPassword" android:name="AskPassword" android:label="@string/app_name"/>\r
         <activity class=".Help" android:name="Help" android:label="@string/app_name" />
         <activity class=".ChangePass" android:name="ChangePass" android:label="@string/app_name" />
index f6c0f862cd9605a3aebb45f60a944cfc7c31d642..6150113450f76f650b5f20bb8361f0237197fd7e 100644 (file)
@@ -90,7 +90,6 @@ public class CategoryList extends ListActivity {
     public static final int REQUEST_ADD_CATEGORY = 2;
     public static final int REQUEST_OPEN_CATEGORY = 3;
     public static final int REQUEST_RESTORE = 4;
-    public static final int REQUEST_ASK_PASSWORD = 5;
     
     protected static final int MSG_IMPORT = 0x101; 
     protected static final int MSG_FILLDATA = MSG_IMPORT + 1; 
@@ -134,7 +133,6 @@ public class CategoryList extends ListActivity {
             }
         }
     };
-    boolean mIntentReceiverRegistered = false;
 
     public Handler myViewUpdateHandler = new Handler(){
        // @Override
@@ -198,9 +196,9 @@ public class CategoryList extends ListActivity {
                
                if (isSignedIn()==false) {
                        Intent frontdoor = new Intent(this, FrontDoor.class);
-                       startActivityForResult(frontdoor, REQUEST_ASK_PASSWORD);                
-                       //finish();
-                       //return;
+                       startActivity(frontdoor);               
+                       finish();
+                       return;
        }
                
                try {
@@ -226,7 +224,6 @@ public class CategoryList extends ListActivity {
         filter.addAction(Intent.ACTION_SCREEN_OFF);
         filter.addAction (CryptoIntents.ACTION_CRYPTO_LOGGED_OUT);
         registerReceiver(mIntentReceiver, filter);
-        mIntentReceiverRegistered = true;
 
                fillData();
 
@@ -244,13 +241,12 @@ public class CategoryList extends ListActivity {
 
                if (isSignedIn()==false) {
                        Intent frontdoor = new Intent(this, FrontDoor.class);
-                       startActivityForResult(frontdoor, REQUEST_ASK_PASSWORD);                
-                       //finish();
-                       //return;
-       } else {
-
-               showFirstTimeWarningDialog();
+                       startActivity(frontdoor);               
+                       finish();
+                       return;
        }
+
+        showFirstTimeWarningDialog();
     }
 
        /**
@@ -302,10 +298,7 @@ public class CategoryList extends ListActivity {
     @Override
     public void onDestroy() {
                super.onDestroy();
-               if (mIntentReceiverRegistered) {
-                       unregisterReceiver(mIntentReceiver);
-                       mIntentReceiverRegistered = false;
-               }
+               unregisterReceiver(mIntentReceiver);
                if (debug) Log.d(TAG,"onDestroy()");
     }
     @Override
@@ -585,8 +578,8 @@ public class CategoryList extends ListActivity {
                masterKey=null;
            Intent frontdoor = new Intent(this, FrontDoor.class);
            frontdoor.setAction(Intent.ACTION_MAIN);
-           startActivityForResult(frontdoor, REQUEST_ASK_PASSWORD);
-           //finish();
+           startActivity(frontdoor);
+           finish();
     }
     
        /**
@@ -633,34 +626,12 @@ public class CategoryList extends ListActivity {
     protected void onActivityResult(int requestCode, int resultCode, Intent i) {
        super.onActivityResult(requestCode, resultCode, i);
 
-       switch (requestCode) {
-       case REQUEST_ADD_CATEGORY:
-       case REQUEST_OPEN_CATEGORY:
-       case REQUEST_RESTORE:
-               if (resultCode == RESULT_OK) {
-                       fillData();
-               }
-               break;
-       case REQUEST_EDIT_CATEGORY:
-               if (resultCode == RESULT_OK) {
-                       fillData();
-                       setSelection(lastPosition);
-               }
-               break;
-       case REQUEST_ASK_PASSWORD:
-               if (isSignedIn()==false) {              
-                       finish();
-               }
-               break;
-       }
-       /*
        if (resultCode == RESULT_OK) {
                fillData();
                if (requestCode==REQUEST_EDIT_CATEGORY) {
                        setSelection(lastPosition);
                }
        }
-       */
     }
 
     private void prePopulate() {
index 7f8a2a92d3c96cd6c09bafd642ca6a9a5bf5a54f..529e2307caa9107e98c3b8a89d9e5e57f9d4b0ac 100644 (file)
@@ -419,7 +419,7 @@ public class IntentHandler extends Activity {
 \r
        @Override\r
        protected void onResume() {\r
-               super.onResume();\r
+               super.onPause();\r
 \r
                if (debug)\r
                        Log.d(TAG, "onResume()");\r
index a70829d0d8c8b59254acd09a92e16f1a1a9bf89b..231317e0de748bf8089232266bbd41f3f3296f3e 100644 (file)
@@ -104,11 +104,7 @@ public class Passwords {
        }
        
        public static boolean getPrePopulate() {
-               if (dbHelper != null) {
-                       return dbHelper.getPrePopulate();
-               } else {
-                       return false;
-               }
+               return dbHelper.getPrePopulate();
        }
        
        public static void clearPrePopulate() {