Loading src/com/android/documentsui/BaseActivity.java +11 −0 Original line number Diff line number Diff line Loading @@ -438,6 +438,17 @@ public abstract class BaseActivity extends Activity return mState; } /* * Get the default directory to be presented after starting the activity. * Method can be overridden if the change of the behavior of the the child activity is needed. */ public Uri getDefaultRoot() { return Shared.isHomeRootHidden(this) ? DocumentsContract.buildRootUri("com.android.providers.downloads.documents", "downloads") : DocumentsContract.buildHomeUri(); } void setDisplayFileSize(boolean display) { LocalPreferences.setDisplayFileSize(this, display); mState.showSize = display; Loading src/com/android/documentsui/DocumentsActivity.java +1 −3 Original line number Diff line number Diff line Loading @@ -108,9 +108,7 @@ public class DocumentsActivity extends BaseActivity { // we restore the stack as last used from that app. if (mState.action == ACTION_PICK_COPY_DESTINATION) { if (DEBUG) Log.d(TAG, "Launching directly into Home directory."); Uri homeUri = DocumentsContract.buildHomeUri(); new LoadRootTask(this, homeUri).executeOnExecutor( ProviderExecutor.forAuthority(homeUri.getAuthority())); loadRoot(getDefaultRoot()); } else { if (DEBUG) Log.d(TAG, "Attempting to load last used stack for calling package."); new LoadLastUsedStackTask(this).execute(); Loading src/com/android/documentsui/FilesActivity.java +1 −3 Original line number Diff line number Diff line Loading @@ -109,9 +109,7 @@ public class FilesActivity extends BaseActivity { loadRoot(uri); } else { if (DEBUG) Log.d(TAG, "All other means skipped. Launching into default directory."); Uri defaultUri = DocumentsContract.buildRootUri( "com.android.providers.downloads.documents", "downloads"); loadRoot(defaultUri); loadRoot(getDefaultRoot()); } final @DialogType int dialogType = intent.getIntExtra( Loading src/com/android/documentsui/RootsFragment.java +2 −16 Original line number Diff line number Diff line Loading @@ -318,9 +318,9 @@ public class RootsFragment extends Fragment { for (final RootInfo root : roots) { final RootItem item = new RootItem(root); if (root.isHome() && isHomeRootHidden(context)) { if (root.isHome() && Shared.isHomeRootHidden(context)) { continue; } else if (root.isAdvanced() && areAdvancedRootsHidden(context)) { } else if (root.isAdvanced() && Shared.areAdvancedRootsHidden(context)) { continue; } else if (root.isLibrary()) { if (DEBUG) Log.d(TAG, "Adding " + root + " as library."); Loading Loading @@ -372,20 +372,6 @@ public class RootsFragment extends Fragment { } } /* * Indicates if the home directory should be hidden in the roots list. */ private boolean isHomeRootHidden(Context context) { return context.getResources().getBoolean(R.bool.home_root_hidden); } /* * Indicates if the advanced roots should be hidden. */ private boolean areAdvancedRootsHidden(Context context) { return context.getResources().getBoolean(R.bool.advanced_roots_hidden); } @Override public View getView(int position, View convertView, ViewGroup parent) { final Item item = getItem(position); Loading src/com/android/documentsui/Shared.java +14 −0 Original line number Diff line number Diff line Loading @@ -169,4 +169,18 @@ public final class Shared { } } /* * Indicates if the home directory should be hidden in the roots list. */ public static boolean isHomeRootHidden(Context context) { return context.getResources().getBoolean(R.bool.home_root_hidden); } /* * Indicates if the advanced roots should be hidden. */ public static boolean areAdvancedRootsHidden(Context context) { return context.getResources().getBoolean(R.bool.advanced_roots_hidden); } } Loading
src/com/android/documentsui/BaseActivity.java +11 −0 Original line number Diff line number Diff line Loading @@ -438,6 +438,17 @@ public abstract class BaseActivity extends Activity return mState; } /* * Get the default directory to be presented after starting the activity. * Method can be overridden if the change of the behavior of the the child activity is needed. */ public Uri getDefaultRoot() { return Shared.isHomeRootHidden(this) ? DocumentsContract.buildRootUri("com.android.providers.downloads.documents", "downloads") : DocumentsContract.buildHomeUri(); } void setDisplayFileSize(boolean display) { LocalPreferences.setDisplayFileSize(this, display); mState.showSize = display; Loading
src/com/android/documentsui/DocumentsActivity.java +1 −3 Original line number Diff line number Diff line Loading @@ -108,9 +108,7 @@ public class DocumentsActivity extends BaseActivity { // we restore the stack as last used from that app. if (mState.action == ACTION_PICK_COPY_DESTINATION) { if (DEBUG) Log.d(TAG, "Launching directly into Home directory."); Uri homeUri = DocumentsContract.buildHomeUri(); new LoadRootTask(this, homeUri).executeOnExecutor( ProviderExecutor.forAuthority(homeUri.getAuthority())); loadRoot(getDefaultRoot()); } else { if (DEBUG) Log.d(TAG, "Attempting to load last used stack for calling package."); new LoadLastUsedStackTask(this).execute(); Loading
src/com/android/documentsui/FilesActivity.java +1 −3 Original line number Diff line number Diff line Loading @@ -109,9 +109,7 @@ public class FilesActivity extends BaseActivity { loadRoot(uri); } else { if (DEBUG) Log.d(TAG, "All other means skipped. Launching into default directory."); Uri defaultUri = DocumentsContract.buildRootUri( "com.android.providers.downloads.documents", "downloads"); loadRoot(defaultUri); loadRoot(getDefaultRoot()); } final @DialogType int dialogType = intent.getIntExtra( Loading
src/com/android/documentsui/RootsFragment.java +2 −16 Original line number Diff line number Diff line Loading @@ -318,9 +318,9 @@ public class RootsFragment extends Fragment { for (final RootInfo root : roots) { final RootItem item = new RootItem(root); if (root.isHome() && isHomeRootHidden(context)) { if (root.isHome() && Shared.isHomeRootHidden(context)) { continue; } else if (root.isAdvanced() && areAdvancedRootsHidden(context)) { } else if (root.isAdvanced() && Shared.areAdvancedRootsHidden(context)) { continue; } else if (root.isLibrary()) { if (DEBUG) Log.d(TAG, "Adding " + root + " as library."); Loading Loading @@ -372,20 +372,6 @@ public class RootsFragment extends Fragment { } } /* * Indicates if the home directory should be hidden in the roots list. */ private boolean isHomeRootHidden(Context context) { return context.getResources().getBoolean(R.bool.home_root_hidden); } /* * Indicates if the advanced roots should be hidden. */ private boolean areAdvancedRootsHidden(Context context) { return context.getResources().getBoolean(R.bool.advanced_roots_hidden); } @Override public View getView(int position, View convertView, ViewGroup parent) { final Item item = getItem(position); Loading
src/com/android/documentsui/Shared.java +14 −0 Original line number Diff line number Diff line Loading @@ -169,4 +169,18 @@ public final class Shared { } } /* * Indicates if the home directory should be hidden in the roots list. */ public static boolean isHomeRootHidden(Context context) { return context.getResources().getBoolean(R.bool.home_root_hidden); } /* * Indicates if the advanced roots should be hidden. */ public static boolean areAdvancedRootsHidden(Context context) { return context.getResources().getBoolean(R.bool.advanced_roots_hidden); } }