Loading Android.mk +2 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,8 @@ LOCAL_SRC_FILES := \ src/com/android/documentsui/archives/WriteableArchive.java \ src/com/android/documentsui/base/Providers.java \ src/com/android/documentsui/base/SharedMinimal.java \ src/com/android/documentsui/prefs/ScopedAccessLocalPreferences.java src/com/android/documentsui/prefs/ScopedAccessLocalPreferences.java \ minimal/src/com/android/documentsui/picker/DummyPickActivity.java LOCAL_PACKAGE_NAME := DocumentsUIMinimal LOCAL_PRIVATE_PLATFORM_APIS := true Loading minimal/AndroidManifest.xml +12 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,18 @@ android:allowBackup="false" android:fullBackupOnly="false"> <activity android:name=".picker.DummyPickActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:visibleToInstantApps="true"> <intent-filter> <action android:name="android.intent.action.OPEN_DOCUMENT" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.OPENABLE" /> <data android:mimeType="*/*" /> </intent-filter> </activity> <activity android:name=".ScopedAccessActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"> Loading minimal/res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -44,4 +44,6 @@ <!-- Error message shown when an archive fails to load --> <string name="archive_loading_failed">Unable to open archive for browsing. File is either corrupt, or an unsupported format.</string> <!-- Error messaged displayed to user if she is trying to pick a document, which is not supported on some platforms. --> <string name="toast_not_supported">This feature is not supported on this device.</string> </resources> minimal/src/com/android/documentsui/picker/DummyPickActivity.java 0 → 100644 +37 −0 Original line number Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.documentsui.picker; import android.app.Activity; import android.os.Bundle; import android.widget.Toast; import com.android.documentsui.R; /** * A dummy activity that shows a toast to the user indicating that picking a document * is not supported on this device. */ public class DummyPickActivity extends Activity { @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Toast.makeText(this, R.string.toast_not_supported, Toast.LENGTH_LONG).show(); finish(); } } Loading
Android.mk +2 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,8 @@ LOCAL_SRC_FILES := \ src/com/android/documentsui/archives/WriteableArchive.java \ src/com/android/documentsui/base/Providers.java \ src/com/android/documentsui/base/SharedMinimal.java \ src/com/android/documentsui/prefs/ScopedAccessLocalPreferences.java src/com/android/documentsui/prefs/ScopedAccessLocalPreferences.java \ minimal/src/com/android/documentsui/picker/DummyPickActivity.java LOCAL_PACKAGE_NAME := DocumentsUIMinimal LOCAL_PRIVATE_PLATFORM_APIS := true Loading
minimal/AndroidManifest.xml +12 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,18 @@ android:allowBackup="false" android:fullBackupOnly="false"> <activity android:name=".picker.DummyPickActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:visibleToInstantApps="true"> <intent-filter> <action android:name="android.intent.action.OPEN_DOCUMENT" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.OPENABLE" /> <data android:mimeType="*/*" /> </intent-filter> </activity> <activity android:name=".ScopedAccessActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"> Loading
minimal/res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -44,4 +44,6 @@ <!-- Error message shown when an archive fails to load --> <string name="archive_loading_failed">Unable to open archive for browsing. File is either corrupt, or an unsupported format.</string> <!-- Error messaged displayed to user if she is trying to pick a document, which is not supported on some platforms. --> <string name="toast_not_supported">This feature is not supported on this device.</string> </resources>
minimal/src/com/android/documentsui/picker/DummyPickActivity.java 0 → 100644 +37 −0 Original line number Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.documentsui.picker; import android.app.Activity; import android.os.Bundle; import android.widget.Toast; import com.android.documentsui.R; /** * A dummy activity that shows a toast to the user indicating that picking a document * is not supported on this device. */ public class DummyPickActivity extends Activity { @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Toast.makeText(this, R.string.toast_not_supported, Toast.LENGTH_LONG).show(); finish(); } }