Loading res/menu/activity.xml +5 −0 Original line number Diff line number Diff line Loading @@ -77,5 +77,10 @@ android:title="@string/menu_settings" android:showAsAction="never" android:visible="false" /> <item android:id="@+id/option_menu_inspector" android:title="@string/menu_inspector" android:showAsAction="never" android:visible="false" /> </group> </menu> src/com/android/documentsui/BaseActivity.java +3 −5 Original line number Diff line number Diff line Loading @@ -425,12 +425,10 @@ public abstract class BaseActivity } mNavigator.update(); // Causes talkback to announce the activity's new title if (mState.stack.isRecents()) { setTitle(mProviders.getRecentsRoot().title); } else { setTitle(mState.stack.getTitle()); } invalidateOptionsMenu(); } Loading src/com/android/documentsui/MenuManager.java +14 −3 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ public abstract class MenuManager { menu.findItem(R.id.option_menu_list)); updateAdvanced(menu.findItem(R.id.option_menu_advanced)); updateDebug(menu.findItem(R.id.option_menu_debug)); updateInspector(menu.findItem(R.id.option_menu_inspector)); Menus.disableHiddenItems(menu); } Loading Loading @@ -273,8 +273,19 @@ public abstract class MenuManager { rename.setVisible(false); } protected void updateInspector(MenuItem properties, SelectionDetails selectionDetails) { properties.setVisible(false); /** * This method is called for standard activity option menu as opposed * to when there is a selection. */ protected void updateInspector(MenuItem inspector) { inspector.setVisible(false); } /** * This method is called for action mode, when a selection exists. */ protected void updateInspector(MenuItem inspector, SelectionDetails selectionDetails) { inspector.setVisible(false); } protected void updateViewInOwner(MenuItem view, SelectionDetails selectionDetails) { Loading src/com/android/documentsui/base/Features.java +5 −4 Original line number Diff line number Diff line Loading @@ -106,6 +106,10 @@ public interface Features { return isEnabled(R.bool.feature_content_refresh); } private boolean isFunPolicyEnabled() { return !mUserMgr.hasUserRestriction(UserManager.DISALLOW_FUN); } private boolean isDebugPolicyEnabled() { return !mUserMgr.hasUserRestriction(UserManager.DISALLOW_DEBUGGING_FEATURES); } Loading @@ -120,15 +124,12 @@ public interface Features { return isEnabled(R.bool.feature_folders_in_search_results); } private boolean isFunPolicyEnabled() { return !mUserMgr.hasUserRestriction(UserManager.DISALLOW_FUN); } @Override public boolean isGestureScaleEnabled() { return isEnabled(R.bool.feature_gesture_scale); } @Override public boolean isInspectorEnabled() { return isEnabled(R.bool.feature_inspector); } Loading src/com/android/documentsui/files/ActionHandler.java +17 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.content.Intent; import android.net.Uri; import android.os.Build; import android.provider.DocumentsContract; import android.text.TextUtils; import android.util.Log; import android.view.DragEvent; Loading Loading @@ -679,11 +680,26 @@ public class ActionHandler<T extends Activity & Addons> extends AbstractActionHa public void showInspector(DocumentInfo doc) { Metrics.logUserAction(mActivity, Metrics.USER_ACTION_INSPECTOR); Intent intent = new Intent(mActivity, InspectorActivity.class); intent.setData(doc.derivedUri); // permit the display of debug info about the file. intent.putExtra( Shared.EXTRA_SHOW_DEBUG, mFeatures.isDebugSupportEnabled() && (Build.IS_DEBUGGABLE || DebugFlags.getDocumentDetailsEnabled())); intent.setData(doc.derivedUri); // The "root document" (top level folder in a root) don't usually have a // human friendly display name. That's because we've never shown the root // folder's name to anyone. // For that reason when the doc being inspected is the root folder, // we override the displayName of the doc w/ the Root's name instead. // The Root's name is shown to the user in the sidebar. if (doc.isDirectory() && mState.stack.size() == 1 && mState.stack.get(0).equals(doc)) { RootInfo root = mActivity.getCurrentRoot(); // Recents root title isn't defined, but inspector is disabled for recents root folder. assert !TextUtils.isEmpty(root.title); intent.putExtra(Intent.EXTRA_TITLE, root.title); } mActivity.startActivity(intent); } Loading Loading
res/menu/activity.xml +5 −0 Original line number Diff line number Diff line Loading @@ -77,5 +77,10 @@ android:title="@string/menu_settings" android:showAsAction="never" android:visible="false" /> <item android:id="@+id/option_menu_inspector" android:title="@string/menu_inspector" android:showAsAction="never" android:visible="false" /> </group> </menu>
src/com/android/documentsui/BaseActivity.java +3 −5 Original line number Diff line number Diff line Loading @@ -425,12 +425,10 @@ public abstract class BaseActivity } mNavigator.update(); // Causes talkback to announce the activity's new title if (mState.stack.isRecents()) { setTitle(mProviders.getRecentsRoot().title); } else { setTitle(mState.stack.getTitle()); } invalidateOptionsMenu(); } Loading
src/com/android/documentsui/MenuManager.java +14 −3 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ public abstract class MenuManager { menu.findItem(R.id.option_menu_list)); updateAdvanced(menu.findItem(R.id.option_menu_advanced)); updateDebug(menu.findItem(R.id.option_menu_debug)); updateInspector(menu.findItem(R.id.option_menu_inspector)); Menus.disableHiddenItems(menu); } Loading Loading @@ -273,8 +273,19 @@ public abstract class MenuManager { rename.setVisible(false); } protected void updateInspector(MenuItem properties, SelectionDetails selectionDetails) { properties.setVisible(false); /** * This method is called for standard activity option menu as opposed * to when there is a selection. */ protected void updateInspector(MenuItem inspector) { inspector.setVisible(false); } /** * This method is called for action mode, when a selection exists. */ protected void updateInspector(MenuItem inspector, SelectionDetails selectionDetails) { inspector.setVisible(false); } protected void updateViewInOwner(MenuItem view, SelectionDetails selectionDetails) { Loading
src/com/android/documentsui/base/Features.java +5 −4 Original line number Diff line number Diff line Loading @@ -106,6 +106,10 @@ public interface Features { return isEnabled(R.bool.feature_content_refresh); } private boolean isFunPolicyEnabled() { return !mUserMgr.hasUserRestriction(UserManager.DISALLOW_FUN); } private boolean isDebugPolicyEnabled() { return !mUserMgr.hasUserRestriction(UserManager.DISALLOW_DEBUGGING_FEATURES); } Loading @@ -120,15 +124,12 @@ public interface Features { return isEnabled(R.bool.feature_folders_in_search_results); } private boolean isFunPolicyEnabled() { return !mUserMgr.hasUserRestriction(UserManager.DISALLOW_FUN); } @Override public boolean isGestureScaleEnabled() { return isEnabled(R.bool.feature_gesture_scale); } @Override public boolean isInspectorEnabled() { return isEnabled(R.bool.feature_inspector); } Loading
src/com/android/documentsui/files/ActionHandler.java +17 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.content.Intent; import android.net.Uri; import android.os.Build; import android.provider.DocumentsContract; import android.text.TextUtils; import android.util.Log; import android.view.DragEvent; Loading Loading @@ -679,11 +680,26 @@ public class ActionHandler<T extends Activity & Addons> extends AbstractActionHa public void showInspector(DocumentInfo doc) { Metrics.logUserAction(mActivity, Metrics.USER_ACTION_INSPECTOR); Intent intent = new Intent(mActivity, InspectorActivity.class); intent.setData(doc.derivedUri); // permit the display of debug info about the file. intent.putExtra( Shared.EXTRA_SHOW_DEBUG, mFeatures.isDebugSupportEnabled() && (Build.IS_DEBUGGABLE || DebugFlags.getDocumentDetailsEnabled())); intent.setData(doc.derivedUri); // The "root document" (top level folder in a root) don't usually have a // human friendly display name. That's because we've never shown the root // folder's name to anyone. // For that reason when the doc being inspected is the root folder, // we override the displayName of the doc w/ the Root's name instead. // The Root's name is shown to the user in the sidebar. if (doc.isDirectory() && mState.stack.size() == 1 && mState.stack.get(0).equals(doc)) { RootInfo root = mActivity.getCurrentRoot(); // Recents root title isn't defined, but inspector is disabled for recents root folder. assert !TextUtils.isEmpty(root.title); intent.putExtra(Intent.EXTRA_TITLE, root.title); } mActivity.startActivity(intent); } Loading