feat: add menu option for Documents UI

* On Pixel (and possibly Android One) devices, the default Documents UI
  is hidden behind Google Files, making it hard to use File Shuttle
  because the Google one does not work well with Shelter as a custom
  FileProvider.
* Let's offer an option in menu to open the original AOSP one.
This commit is contained in:
Peter Cai 2020-09-14 19:42:54 +08:00
parent 3852bd83b5
commit a121eec480
No known key found for this signature in database
GPG key ID: 71F5FB4E4F3FD54F
4 changed files with 11 additions and 0 deletions

View file

@ -424,6 +424,11 @@ public class MainActivity extends AppCompatActivity {
update.run();
}
return true;
case R.id.main_menu_documents_ui:
Intent documentsUiIntent = new Intent(Intent.ACTION_VIEW);
documentsUiIntent.setDataAndType(null, "vnd.android.document/root");
startActivity(documentsUiIntent);
return true;
}
return super.onOptionsItemSelected(item);
}

View file

@ -28,6 +28,10 @@
android:id="@+id/main_menu_install_app_to_profile"
android:title="@string/install_app_to_profile" />
<item
android:id="@+id/main_menu_documents_ui"
android:title="@string/documents_ui" />
<item
android:id="@+id/main_menu_show_all"
android:title="@string/show_all"

View file

@ -43,6 +43,7 @@
<string name="install_app_to_profile_success">已成功在工作用户内安装 APK</string>
<string name="show_all">显示全部应用</string>
<string name="show_all_warning">对列表中默认隐藏的应用执行操作可能导致崩溃以及其他各种无法预料的行为。但是当您的手机厂商没有正确在工作用户中开启所有必要的系统组件应用的时候这个功能可以帮助您解决问题。如果您选择继续您确保您了解您在做什么Shelter 无法提供任何保证。</string>
<string name="documents_ui">打开文件管理器</string>
<!-- Settings Options -->
<string name="settings">设置</string>

View file

@ -46,6 +46,7 @@
<string name="install_app_to_profile_success">Application installation finished in work profile.</string>
<string name="show_all">Show All Apps</string>
<string name="show_all_warning">Manipulating apps that are hidden from the list could cause crashes and all sorts of unexpected behavior. However, this feature can be useful when faulty vendor-customized ROMs does not enable all necessary system apps in work profile by default. If you continue, you are on your own.</string>
<string name="documents_ui">Open Documents UI</string>
<!-- Settings Options -->
<string name="settings">Settings</string>