Move vCard related codes to com.android.contacts.vcard.
Bug: 2733143
Change-Id: I35ddb7473a78131b21311e16583390f5f799c195
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 76512fe..62543d0 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -513,7 +513,8 @@
</intent-filter>
</activity>
- <activity android:name=".ImportVCardActivity"
+ <!-- vCard related -->
+ <activity android:name=".vcard.ImportVCardActivity"
android:theme="@style/BackgroundOnly">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
@@ -523,14 +524,14 @@
</intent-filter>
</activity>
- <activity android:name=".SelectAccountActivity"
+ <activity android:name=".vcard.SelectAccountActivity"
android:theme="@style/BackgroundOnly" />
<service
- android:name=".ImportVCardService"
+ android:name=".vcard.ImportVCardService"
android:exported="false" />
- <activity android:name=".ExportVCardActivity"
+ <activity android:name=".vcard.ExportVCardActivity"
android:theme="@style/BackgroundOnly" />
<!-- Pinned header list demo -->
diff --git a/src/com/android/contacts/ContactsListActivity.java b/src/com/android/contacts/ContactsListActivity.java
index 4c7364a..683fea4 100644
--- a/src/com/android/contacts/ContactsListActivity.java
+++ b/src/com/android/contacts/ContactsListActivity.java
@@ -34,6 +34,7 @@
import com.android.contacts.model.Sources;
import com.android.contacts.ui.ContactsPreferencesActivity;
import com.android.contacts.util.AccountSelectionUtil;
+import com.android.contacts.vcard.ExportVCardActivity;
import com.android.contacts.widget.ContextMenuAdapter;
import com.android.contacts.widget.SearchEditText;
import com.android.contacts.widget.SearchEditText.OnFilterTextListener;
diff --git a/src/com/android/contacts/util/AccountSelectionUtil.java b/src/com/android/contacts/util/AccountSelectionUtil.java
index 6f1d851..19e21bc 100644
--- a/src/com/android/contacts/util/AccountSelectionUtil.java
+++ b/src/com/android/contacts/util/AccountSelectionUtil.java
@@ -16,18 +16,13 @@
package com.android.contacts.util;
-import com.android.contacts.ImportVCardActivity;
-import com.android.contacts.R;
-import com.android.contacts.model.ContactsSource;
-import com.android.contacts.model.GoogleSource;
-import com.android.contacts.model.Sources;
-
import android.accounts.Account;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
+import android.net.Uri;
import android.util.Log;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
@@ -35,7 +30,10 @@
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
-import android.net.Uri;
+
+import com.android.contacts.R;
+import com.android.contacts.model.ContactsSource;
+import com.android.contacts.model.Sources;
import java.util.List;
@@ -174,7 +172,8 @@
}
public static void doImportFromSdCard(Context context, Account account) {
- Intent importIntent = new Intent(context, ImportVCardActivity.class);
+ Intent importIntent = new Intent(context,
+ com.android.contacts.vcard.ImportVCardActivity.class);
if (account != null) {
importIntent.putExtra("account_name", account.name);
importIntent.putExtra("account_type", account.type);
diff --git a/src/com/android/contacts/ExportVCardActivity.java b/src/com/android/contacts/vcard/ExportVCardActivity.java
similarity index 99%
rename from src/com/android/contacts/ExportVCardActivity.java
rename to src/com/android/contacts/vcard/ExportVCardActivity.java
index 981f144..509702b 100644
--- a/src/com/android/contacts/ExportVCardActivity.java
+++ b/src/com/android/contacts/vcard/ExportVCardActivity.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.contacts;
+package com.android.contacts.vcard;
import android.app.Activity;
import android.app.AlertDialog;
@@ -28,6 +28,7 @@
import android.text.TextUtils;
import android.util.Log;
+import com.android.contacts.R;
import com.android.vcard.VCardComposer;
import com.android.vcard.VCardConfig;
diff --git a/src/com/android/contacts/ImportProgressNotifier.java b/src/com/android/contacts/vcard/ImportProgressNotifier.java
similarity index 96%
rename from src/com/android/contacts/ImportProgressNotifier.java
rename to src/com/android/contacts/vcard/ImportProgressNotifier.java
index e24b307..42d101b 100644
--- a/src/com/android/contacts/ImportProgressNotifier.java
+++ b/src/com/android/contacts/vcard/ImportProgressNotifier.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.contacts;
+package com.android.contacts.vcard;
import android.app.Notification;
import android.app.NotificationManager;
@@ -22,6 +22,8 @@
import android.content.Intent;
import android.widget.RemoteViews;
+import com.android.contacts.ContactsListActivity;
+import com.android.contacts.R;
import com.android.vcard.VCardEntry;
import com.android.vcard.VCardEntryHandler;
diff --git a/src/com/android/contacts/ImportRequest.java b/src/com/android/contacts/vcard/ImportRequest.java
similarity index 98%
rename from src/com/android/contacts/ImportRequest.java
rename to src/com/android/contacts/vcard/ImportRequest.java
index 56a33b1..841a09c 100644
--- a/src/com/android/contacts/ImportRequest.java
+++ b/src/com/android/contacts/vcard/ImportRequest.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.contacts;
+package com.android.contacts.vcard;
import android.accounts.Account;
import android.net.Uri;
diff --git a/src/com/android/contacts/ImportRequestProcessor.java b/src/com/android/contacts/vcard/ImportRequestProcessor.java
similarity index 99%
rename from src/com/android/contacts/ImportRequestProcessor.java
rename to src/com/android/contacts/vcard/ImportRequestProcessor.java
index d19680b..b4158b6 100644
--- a/src/com/android/contacts/ImportRequestProcessor.java
+++ b/src/com/android/contacts/vcard/ImportRequestProcessor.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.contacts;
+package com.android.contacts.vcard;
import android.accounts.Account;
import android.app.Notification;
@@ -28,6 +28,7 @@
import android.provider.ContactsContract.RawContacts;
import android.util.Log;
+import com.android.contacts.R;
import com.android.vcard.VCardEntryCommitter;
import com.android.vcard.VCardEntryConstructor;
import com.android.vcard.VCardInterpreter;
diff --git a/src/com/android/contacts/ImportVCardActivity.java b/src/com/android/contacts/vcard/ImportVCardActivity.java
similarity index 98%
rename from src/com/android/contacts/ImportVCardActivity.java
rename to src/com/android/contacts/vcard/ImportVCardActivity.java
index 84d481b..c7606eb 100644
--- a/src/com/android/contacts/ImportVCardActivity.java
+++ b/src/com/android/contacts/vcard/ImportVCardActivity.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.contacts;
+package com.android.contacts.vcard;
import android.accounts.Account;
import android.app.Activity;
@@ -44,6 +44,7 @@
import android.text.style.RelativeSizeSpan;
import android.util.Log;
+import com.android.contacts.R;
import com.android.contacts.model.Sources;
import com.android.contacts.util.AccountSelectionUtil;
import com.android.vcard.VCardEntryCounter;
@@ -131,7 +132,6 @@
private boolean mNeedFinish = false;
public void doBindService() {
- // Log.d("@@@", "doBindService");
bindService(new Intent(ImportVCardActivity.this,
ImportVCardService.class), this, Context.BIND_AUTO_CREATE);
}
@@ -147,8 +147,6 @@
}
public synchronized void requestSend(final ImportRequest parameter) {
- // Log.d("@@@", "requestSend(): " + (mMessenger != null) + ", "
- // + mPendingRequests.size());
if (mMessenger != null) {
sendMessage(parameter);
} else {
@@ -157,7 +155,6 @@
}
private void sendMessage(final ImportRequest parameter) {
- // Log.d("@@@", "sendMessage()");
try {
mMessenger.send(Message.obtain(null,
ImportVCardService.MSG_IMPORT_REQUEST,
@@ -190,7 +187,6 @@
}
public void onServiceDisconnected(ComponentName name) {
- // Log.d("@@@", "onServiceDisconnected()");
synchronized (this) {
if (!mPendingRequests.isEmpty()) {
Log.w(LOG_TAG, "Some request(s) are dropped.");
@@ -318,7 +314,6 @@
for (int i = 0; i < length; i++) {
final Uri sourceUri = mSourceUris[i];
final Uri localDataUri = copyToLocal(sourceUri, i);
- // Log.d("@@@", "source: " + sourceUri);
if (mCanceled) {
break;
}
@@ -350,7 +345,6 @@
} finally {
mWakeLock.release();
mProgressDialogForCacheVCard.dismiss();
- // Log.d("@@@", "before setNeedFinish: " + needFinish);
if (needFinish) {
mConnection.setNeedFinish();
}
diff --git a/src/com/android/contacts/ImportVCardService.java b/src/com/android/contacts/vcard/ImportVCardService.java
similarity index 97%
rename from src/com/android/contacts/ImportVCardService.java
rename to src/com/android/contacts/vcard/ImportVCardService.java
index f576d4b..76f597c 100644
--- a/src/com/android/contacts/ImportVCardService.java
+++ b/src/com/android/contacts/vcard/ImportVCardService.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.contacts;
+package com.android.contacts.vcard;
import android.app.Service;
import android.content.Intent;
@@ -24,6 +24,8 @@
import android.util.Log;
import android.widget.Toast;
+import com.android.contacts.R;
+
/**
* The class responsible for importing vCard from one ore multiple Uris.
*/
diff --git a/src/com/android/contacts/SelectAccountActivity.java b/src/com/android/contacts/vcard/SelectAccountActivity.java
similarity index 95%
rename from src/com/android/contacts/SelectAccountActivity.java
rename to src/com/android/contacts/vcard/SelectAccountActivity.java
index cef00e0..dfd5196 100644
--- a/src/com/android/contacts/SelectAccountActivity.java
+++ b/src/com/android/contacts/vcard/SelectAccountActivity.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.contacts;
+package com.android.contacts.vcard;
import android.accounts.Account;
import android.app.Activity;
@@ -23,6 +23,7 @@
import android.os.Bundle;
import android.util.Log;
+import com.android.contacts.R;
import com.android.contacts.model.Sources;
import com.android.contacts.util.AccountSelectionUtil;
@@ -31,8 +32,8 @@
public class SelectAccountActivity extends Activity {
private static final String LOG_TAG = "SelectAccountActivity";
- /* package */ static final String ACCOUNT_NAME = "account_name";
- /* package */ static final String ACCOUNT_TYPE = "account_type";
+ public static final String ACCOUNT_NAME = "account_name";
+ public static final String ACCOUNT_TYPE = "account_type";
private class CancelListener
implements DialogInterface.OnClickListener, DialogInterface.OnCancelListener {