DocumentsUI: Move intent related constants to BaseActivity.DocumentsIntent.
BUG=None
Change-Id: I81d367d5f8d727a5fa76bc22b2fe871ae441dbcf
diff --git a/packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java b/packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java
index 842d9fc..66792da 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java
@@ -33,16 +33,6 @@
import com.google.common.collect.Maps;
abstract class BaseActivity extends Activity {
- /** Intent action name to open copy destination. */
- public static String ACTION_OPEN_COPY_DESTINATION_STRING =
- "com.android.documentsui.OPEN_COPY_DESTINATION";
-
- /**
- * Extra boolean flag for ACTION_OPEN_COPY_DESTINATION_STRING, which
- * specifies if the destination directory needs to create new directory or not.
- */
- public static String EXTRA_DIRECTORY_COPY = "com.android.documentsui.DIRECTORY_COPY";
-
public abstract State getDisplayState();
public abstract RootInfo getCurrentRoot();
public abstract void onStateChanged();
@@ -62,6 +52,18 @@
return (BaseActivity) fragment.getActivity();
}
+ public static abstract class DocumentsIntent {
+ /** Intent action name to open copy destination. */
+ public static String ACTION_OPEN_COPY_DESTINATION =
+ "com.android.documentsui.OPEN_COPY_DESTINATION";
+
+ /**
+ * Extra boolean flag for ACTION_OPEN_COPY_DESTINATION_STRING, which
+ * specifies if the destination directory needs to create new directory or not.
+ */
+ public static String EXTRA_DIRECTORY_COPY = "com.android.documentsui.DIRECTORY_COPY";
+ }
+
public static class State implements android.os.Parcelable {
public int action;
public String[] acceptMimes;
diff --git a/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java b/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java
index 909e2e5..e2e9807 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java
@@ -683,7 +683,7 @@
// Pop up a dialog to pick a destination. This is inadequate but works for now.
// TODO: Implement a picker that is to spec.
final Intent intent = new Intent(
- BaseActivity.ACTION_OPEN_COPY_DESTINATION_STRING,
+ BaseActivity.DocumentsIntent.ACTION_OPEN_COPY_DESTINATION,
Uri.EMPTY,
getActivity(),
DocumentsActivity.class);
@@ -694,7 +694,7 @@
break;
}
}
- intent.putExtra(BaseActivity.EXTRA_DIRECTORY_COPY, directoryCopy);
+ intent.putExtra(BaseActivity.DocumentsIntent.EXTRA_DIRECTORY_COPY, directoryCopy);
startActivityForResult(intent, REQUEST_COPY_DESTINATION);
}
diff --git a/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java b/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
index 71ed17e..a2a789f 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
@@ -237,7 +237,7 @@
mState.action = ACTION_MANAGE;
} else if (DocumentsContract.ACTION_BROWSE_DOCUMENT_ROOT.equals(action)) {
mState.action = ACTION_BROWSE;
- } else if (ACTION_OPEN_COPY_DESTINATION_STRING.equals(action)) {
+ } else if (DocumentsIntent.ACTION_OPEN_COPY_DESTINATION.equals(action)) {
mState.action = ACTION_OPEN_COPY_DESTINATION;
}
@@ -267,7 +267,7 @@
}
if (mState.action == ACTION_OPEN_COPY_DESTINATION) {
mState.directoryCopy = intent.getBooleanExtra(
- BaseActivity.EXTRA_DIRECTORY_COPY, false);
+ BaseActivity.DocumentsIntent.EXTRA_DIRECTORY_COPY, false);
}
}