Loading res/drawable/ic_root_bugreport.xml 0 → 100644 +25 −0 Original line number Diff line number Diff line <!-- ~ Copyright (C) 2019 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. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24.0" android:viewportHeight="24.0"> <path android:fillColor="#5F6368" android:pathData="M20 10V8h-2.81c-.45-.78-1.07-1.46-1.82-1.96L17 4.41 15.59 3l-2.17 2.17c-.03-.01-.05-.01-.08-.01-.16-.04-.32-.06-.49-.09l-.17-.03C12.46 5.02 12.23 5 12 5c-.49 0-.97.07-1.42.18l.02-.01L8.41 3 7 4.41l1.62 1.63h.01c-.75.5-1.37 1.18-1.82 1.96H4v2h2.09c-.06.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20zm-4 5c0 2.21-1.79 4-4 4s-4-1.79-4-4v-4c0-2.21 1.79-4 4-4s4 1.79 4 4v4zm-6-1h4v2h-4zm0-4h4v2h-4z" /> </vector> src/com/android/documentsui/base/Providers.java +1 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ public final class Providers { public static final String ROOT_ID_AUDIO = "audio_root"; public static final String AUTHORITY_MTP = "com.android.mtp.documents"; public static final String AUTHORITY_BUGREPORT = "com.android.shell.documents"; private static final String DOCSUI_PACKAGE = "com.android.documentsui"; private static final Set<String> SYSTEM_AUTHORITIES = new HashSet<String>() {{ Loading src/com/android/documentsui/base/RootInfo.java +10 −3 Original line number Diff line number Diff line Loading @@ -21,10 +21,8 @@ import static android.provider.DocumentsContract.QUERY_ARG_MIME_TYPES; import static com.android.documentsui.base.DocumentInfo.getCursorInt; import static com.android.documentsui.base.DocumentInfo.getCursorLong; import static com.android.documentsui.base.DocumentInfo.getCursorString; import static com.android.documentsui.base.SharedMinimal.VERBOSE; import static com.android.documentsui.base.Shared.compareToIgnoreCaseNullable; import androidx.annotation.IntDef; import static com.android.documentsui.base.SharedMinimal.VERBOSE; import android.content.Context; import android.database.Cursor; Loading @@ -37,6 +35,8 @@ import android.provider.DocumentsContract.Root; import android.text.TextUtils; import android.util.Log; import androidx.annotation.IntDef; import com.android.documentsui.IconUtils; import com.android.documentsui.R; Loading Loading @@ -237,6 +237,9 @@ public class RootInfo implements Durable, Parcelable, Comparable<RootInfo> { derivedIcon = LOAD_FROM_CONTENT_RESOLVER; } else if (isRecents()) { derivedType = TYPE_RECENTS; } else if (isBugReport()) { derivedType = TYPE_OTHER; derivedIcon = R.drawable.ic_root_bugreport; } else { derivedType = TYPE_OTHER; } Loading @@ -248,6 +251,10 @@ public class RootInfo implements Durable, Parcelable, Comparable<RootInfo> { return DocumentsContract.buildRootUri(authority, rootId); } public boolean isBugReport() { return Providers.AUTHORITY_BUGREPORT.equals(authority); } public boolean isRecents() { return authority == null && rootId == null; } Loading Loading
res/drawable/ic_root_bugreport.xml 0 → 100644 +25 −0 Original line number Diff line number Diff line <!-- ~ Copyright (C) 2019 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. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24.0" android:viewportHeight="24.0"> <path android:fillColor="#5F6368" android:pathData="M20 10V8h-2.81c-.45-.78-1.07-1.46-1.82-1.96L17 4.41 15.59 3l-2.17 2.17c-.03-.01-.05-.01-.08-.01-.16-.04-.32-.06-.49-.09l-.17-.03C12.46 5.02 12.23 5 12 5c-.49 0-.97.07-1.42.18l.02-.01L8.41 3 7 4.41l1.62 1.63h.01c-.75.5-1.37 1.18-1.82 1.96H4v2h2.09c-.06.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20zm-4 5c0 2.21-1.79 4-4 4s-4-1.79-4-4v-4c0-2.21 1.79-4 4-4s4 1.79 4 4v4zm-6-1h4v2h-4zm0-4h4v2h-4z" /> </vector>
src/com/android/documentsui/base/Providers.java +1 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ public final class Providers { public static final String ROOT_ID_AUDIO = "audio_root"; public static final String AUTHORITY_MTP = "com.android.mtp.documents"; public static final String AUTHORITY_BUGREPORT = "com.android.shell.documents"; private static final String DOCSUI_PACKAGE = "com.android.documentsui"; private static final Set<String> SYSTEM_AUTHORITIES = new HashSet<String>() {{ Loading
src/com/android/documentsui/base/RootInfo.java +10 −3 Original line number Diff line number Diff line Loading @@ -21,10 +21,8 @@ import static android.provider.DocumentsContract.QUERY_ARG_MIME_TYPES; import static com.android.documentsui.base.DocumentInfo.getCursorInt; import static com.android.documentsui.base.DocumentInfo.getCursorLong; import static com.android.documentsui.base.DocumentInfo.getCursorString; import static com.android.documentsui.base.SharedMinimal.VERBOSE; import static com.android.documentsui.base.Shared.compareToIgnoreCaseNullable; import androidx.annotation.IntDef; import static com.android.documentsui.base.SharedMinimal.VERBOSE; import android.content.Context; import android.database.Cursor; Loading @@ -37,6 +35,8 @@ import android.provider.DocumentsContract.Root; import android.text.TextUtils; import android.util.Log; import androidx.annotation.IntDef; import com.android.documentsui.IconUtils; import com.android.documentsui.R; Loading Loading @@ -237,6 +237,9 @@ public class RootInfo implements Durable, Parcelable, Comparable<RootInfo> { derivedIcon = LOAD_FROM_CONTENT_RESOLVER; } else if (isRecents()) { derivedType = TYPE_RECENTS; } else if (isBugReport()) { derivedType = TYPE_OTHER; derivedIcon = R.drawable.ic_root_bugreport; } else { derivedType = TYPE_OTHER; } Loading @@ -248,6 +251,10 @@ public class RootInfo implements Durable, Parcelable, Comparable<RootInfo> { return DocumentsContract.buildRootUri(authority, rootId); } public boolean isBugReport() { return Providers.AUTHORITY_BUGREPORT.equals(authority); } public boolean isRecents() { return authority == null && rootId == null; } Loading