Loading core/java/android/os/storage/VolumeInfo.java +1 −0 Original line number Diff line number Diff line Loading @@ -442,6 +442,7 @@ public class VolumeInfo implements Parcelable { // note that docsui treats this as *force* show advanced. So sending // false permits advanced to be shown based on user preferences. intent.putExtra(DocumentsContract.EXTRA_SHOW_ADVANCED, isPrimary()); intent.putExtra(DocumentsContract.EXTRA_FANCY_FEATURES, true); intent.putExtra(DocumentsContract.EXTRA_SHOW_FILESIZE, true); return intent; } Loading core/java/android/provider/DocumentsContract.java +3 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,9 @@ public final class DocumentsContract { /** {@hide} */ public static final String EXTRA_SHOW_FILESIZE = "android.content.extra.SHOW_FILESIZE"; /** {@hide} */ public static final String EXTRA_FANCY_FEATURES = "android.content.extra.FANCY"; /** {@hide} */ public static final String EXTRA_TARGET_URI = "android.content.extra.TARGET_URI"; Loading packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java +6 −11 Original line number Diff line number Diff line Loading @@ -218,23 +218,18 @@ public abstract class BaseActivity extends Activity state.showAdvanced = Shared.shouldShowDeviceRoot(this, intent); // Menu option is shown for whitelisted intents if advanced roots are not shown by default. state.showAdvancedOption = !state.showAdvanced && ( !directLaunch(intent) || state.action == ACTION_OPEN || state.action == ACTION_CREATE || state.action == ACTION_OPEN_TREE || state.action == ACTION_PICK_COPY_DESTINATION || state.action == ACTION_GET_CONTENT); Shared.shouldShowFancyFeatures(this) || state.action == ACTION_OPEN || state.action == ACTION_CREATE || state.action == ACTION_OPEN_TREE || state.action == ACTION_PICK_COPY_DESTINATION || state.action == ACTION_GET_CONTENT); if (DEBUG) Log.d(mTag, "Created new state object: " + state); return state; } private static boolean directLaunch(Intent intent) { return LauncherActivity.isLaunchUri(intent.getData()) && intent.hasExtra(Shared.EXTRA_STACK); } public void setRootsDrawerOpen(boolean open) { mNavigator.revealRootsDrawer(open); } Loading packages/DocumentsUI/src/com/android/documentsui/FilesActivity.java +1 −1 Original line number Diff line number Diff line Loading @@ -201,7 +201,7 @@ public class FilesActivity extends BaseActivity { createDir.setEnabled(canCreateDirectory()); pasteFromCb.setEnabled(mClipper.hasItemsToPaste()); settings.setVisible(root.hasSettings()); newWindow.setVisible(true); newWindow.setVisible(Shared.shouldShowFancyFeatures(this)); Menus.disableHiddenItems(menu, pasteFromCb); // It hides icon if searching in progress Loading packages/DocumentsUI/src/com/android/documentsui/LauncherActivity.java +19 −5 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.provider.DocumentsContract; import android.support.annotation.Nullable; import android.util.Log; Loading @@ -44,6 +45,15 @@ public class LauncherActivity extends Activity { private static final String LAUNCH_CONTROL_AUTHORITY = "com.android.documentsui.launchControl"; private static final String TAG = "LauncherActivity"; // Array of boolean extras that should be copied when creating new launch intents. // Missing intents will be ignored. private static final String[] PERSISTENT_BOOLEAN_EXTRAS = { DocumentsContract.EXTRA_SHOW_FILESIZE, DocumentsContract.EXTRA_SHOW_ADVANCED, DocumentsContract.EXTRA_FANCY_FEATURES, Shared.EXTRA_PRODUCTIVITY_MODE }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Loading Loading @@ -94,11 +104,7 @@ public class LauncherActivity extends Activity { // Relay any config overrides bits present in the original intent. Intent original = activity.getIntent(); if (original != null) { if (original.hasExtra(Shared.EXTRA_PRODUCTIVITY_MODE)) { intent.putExtra( Shared.EXTRA_PRODUCTIVITY_MODE, original.getBooleanExtra(Shared.EXTRA_PRODUCTIVITY_MODE, false)); } copyExtras(original, intent); if (original.hasExtra(Intent.EXTRA_TITLE)) { intent.putExtra( Intent.EXTRA_TITLE, Loading @@ -108,6 +114,14 @@ public class LauncherActivity extends Activity { return intent; } private static void copyExtras(Intent src, Intent dest) { for (String extra : PERSISTENT_BOOLEAN_EXTRAS) { if (src.hasExtra(extra)) { dest.putExtra(extra, src.getBooleanExtra(extra, false)); } } } private static Uri buildLaunchUri() { return new Uri.Builder() .authority(LAUNCH_CONTROL_AUTHORITY) Loading Loading
core/java/android/os/storage/VolumeInfo.java +1 −0 Original line number Diff line number Diff line Loading @@ -442,6 +442,7 @@ public class VolumeInfo implements Parcelable { // note that docsui treats this as *force* show advanced. So sending // false permits advanced to be shown based on user preferences. intent.putExtra(DocumentsContract.EXTRA_SHOW_ADVANCED, isPrimary()); intent.putExtra(DocumentsContract.EXTRA_FANCY_FEATURES, true); intent.putExtra(DocumentsContract.EXTRA_SHOW_FILESIZE, true); return intent; } Loading
core/java/android/provider/DocumentsContract.java +3 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,9 @@ public final class DocumentsContract { /** {@hide} */ public static final String EXTRA_SHOW_FILESIZE = "android.content.extra.SHOW_FILESIZE"; /** {@hide} */ public static final String EXTRA_FANCY_FEATURES = "android.content.extra.FANCY"; /** {@hide} */ public static final String EXTRA_TARGET_URI = "android.content.extra.TARGET_URI"; Loading
packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java +6 −11 Original line number Diff line number Diff line Loading @@ -218,23 +218,18 @@ public abstract class BaseActivity extends Activity state.showAdvanced = Shared.shouldShowDeviceRoot(this, intent); // Menu option is shown for whitelisted intents if advanced roots are not shown by default. state.showAdvancedOption = !state.showAdvanced && ( !directLaunch(intent) || state.action == ACTION_OPEN || state.action == ACTION_CREATE || state.action == ACTION_OPEN_TREE || state.action == ACTION_PICK_COPY_DESTINATION || state.action == ACTION_GET_CONTENT); Shared.shouldShowFancyFeatures(this) || state.action == ACTION_OPEN || state.action == ACTION_CREATE || state.action == ACTION_OPEN_TREE || state.action == ACTION_PICK_COPY_DESTINATION || state.action == ACTION_GET_CONTENT); if (DEBUG) Log.d(mTag, "Created new state object: " + state); return state; } private static boolean directLaunch(Intent intent) { return LauncherActivity.isLaunchUri(intent.getData()) && intent.hasExtra(Shared.EXTRA_STACK); } public void setRootsDrawerOpen(boolean open) { mNavigator.revealRootsDrawer(open); } Loading
packages/DocumentsUI/src/com/android/documentsui/FilesActivity.java +1 −1 Original line number Diff line number Diff line Loading @@ -201,7 +201,7 @@ public class FilesActivity extends BaseActivity { createDir.setEnabled(canCreateDirectory()); pasteFromCb.setEnabled(mClipper.hasItemsToPaste()); settings.setVisible(root.hasSettings()); newWindow.setVisible(true); newWindow.setVisible(Shared.shouldShowFancyFeatures(this)); Menus.disableHiddenItems(menu, pasteFromCb); // It hides icon if searching in progress Loading
packages/DocumentsUI/src/com/android/documentsui/LauncherActivity.java +19 −5 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.provider.DocumentsContract; import android.support.annotation.Nullable; import android.util.Log; Loading @@ -44,6 +45,15 @@ public class LauncherActivity extends Activity { private static final String LAUNCH_CONTROL_AUTHORITY = "com.android.documentsui.launchControl"; private static final String TAG = "LauncherActivity"; // Array of boolean extras that should be copied when creating new launch intents. // Missing intents will be ignored. private static final String[] PERSISTENT_BOOLEAN_EXTRAS = { DocumentsContract.EXTRA_SHOW_FILESIZE, DocumentsContract.EXTRA_SHOW_ADVANCED, DocumentsContract.EXTRA_FANCY_FEATURES, Shared.EXTRA_PRODUCTIVITY_MODE }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Loading Loading @@ -94,11 +104,7 @@ public class LauncherActivity extends Activity { // Relay any config overrides bits present in the original intent. Intent original = activity.getIntent(); if (original != null) { if (original.hasExtra(Shared.EXTRA_PRODUCTIVITY_MODE)) { intent.putExtra( Shared.EXTRA_PRODUCTIVITY_MODE, original.getBooleanExtra(Shared.EXTRA_PRODUCTIVITY_MODE, false)); } copyExtras(original, intent); if (original.hasExtra(Intent.EXTRA_TITLE)) { intent.putExtra( Intent.EXTRA_TITLE, Loading @@ -108,6 +114,14 @@ public class LauncherActivity extends Activity { return intent; } private static void copyExtras(Intent src, Intent dest) { for (String extra : PERSISTENT_BOOLEAN_EXTRAS) { if (src.hasExtra(extra)) { dest.putExtra(extra, src.getBooleanExtra(extra, false)); } } } private static Uri buildLaunchUri() { return new Uri.Builder() .authority(LAUNCH_CONTROL_AUTHORITY) Loading