Loading core/java/android/app/slice/SliceProvider.java +18 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ */ package android.app.slice; import static android.app.slice.Slice.SUBTYPE_COLOR; import android.annotation.NonNull; import android.app.PendingIntent; import android.content.ComponentName; Loading @@ -29,6 +31,7 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.ProviderInfo; import android.database.ContentObserver; import android.database.Cursor; import android.graphics.drawable.Icon; import android.net.Uri; import android.os.Binder; import android.os.Bundle; Loading @@ -39,6 +42,8 @@ import android.os.StrictMode; import android.os.StrictMode.ThreadPolicy; import android.util.ArraySet; import android.util.Log; import android.util.TypedValue; import android.view.ContextThemeWrapper; import java.util.ArrayList; import java.util.Arrays; Loading Loading @@ -472,12 +477,25 @@ public abstract class SliceProvider extends ContentProvider { } Slice.Builder parent = new Slice.Builder(sliceUri); Slice.Builder childAction = new Slice.Builder(parent) .addIcon(Icon.createWithResource(context, com.android.internal.R.drawable.ic_permission), null, Collections.emptyList()) .addHints(Arrays.asList(Slice.HINT_TITLE, Slice.HINT_SHORTCUT)) .addAction(action, new Slice.Builder(parent).build(), null); TypedValue tv = new TypedValue(); new ContextThemeWrapper(context, android.R.style.Theme_DeviceDefault_Light) .getTheme().resolveAttribute(android.R.attr.colorAccent, tv, true); int deviceDefaultAccent = tv.data; parent.addSubSlice(new Slice.Builder(sliceUri.buildUpon().appendPath("permission").build()) .addIcon(Icon.createWithResource(context, com.android.internal.R.drawable.ic_arrow_forward), null, Collections.emptyList()) .addText(getPermissionString(context, callingPackage), null, Collections.emptyList()) .addInt(deviceDefaultAccent, SUBTYPE_COLOR, Collections.emptyList()) .addSubSlice(childAction.build(), null) .build(), null); return parent.addHints(Arrays.asList(Slice.HINT_PERMISSION_REQUEST)).build(); Loading core/res/res/drawable/ic_arrow_forward.xml 0 → 100644 +24 −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. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24.0dp" android:height="24.0dp" android:viewportWidth="24.0" android:viewportHeight="24.0"> <path android:fillColor="#FF000000" android:pathData="M12.0,4.0l-1.41,1.41L16.17,11.0L4.0,11.0l0.0,2.0l12.17,0.0l-5.58,5.59L12.0,20.0l8.0,-8.0z"/> </vector> core/res/res/drawable/ic_permission.xml 0 → 100644 +26 −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. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24.0dp" android:height="24.0dp" android:viewportWidth="16.0" android:viewportHeight="16.0"> <path android:fillColor="#FF000000" android:pathData=" M9.0,12l-2.0,0.0l0.0,-2.0l2.0,0.0l0.0,2.0z m0.0,-4.0l-2.0,0.0l0.0,-4.0l2.0,0.0l0.0,4.0z"/> </vector> core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -3389,4 +3389,6 @@ <java-symbol type="attr" name="opticalInsetBottom" /> <java-symbol type="drawable" name="ic_lock_lockdown" /> <java-symbol type="drawable" name="ic_arrow_forward" /> <java-symbol type="drawable" name="ic_permission" /> </resources> packages/SystemUI/AndroidManifest.xml +2 −0 Original line number Diff line number Diff line Loading @@ -211,6 +211,8 @@ <!-- Permission necessary to change car audio volume through CarAudioManager --> <uses-permission android:name="android.car.permission.CAR_CONTROL_AUDIO_VOLUME" /> <uses-permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS" /> <application android:name=".SystemUIApplication" android:persistent="true" Loading Loading
core/java/android/app/slice/SliceProvider.java +18 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ */ package android.app.slice; import static android.app.slice.Slice.SUBTYPE_COLOR; import android.annotation.NonNull; import android.app.PendingIntent; import android.content.ComponentName; Loading @@ -29,6 +31,7 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.ProviderInfo; import android.database.ContentObserver; import android.database.Cursor; import android.graphics.drawable.Icon; import android.net.Uri; import android.os.Binder; import android.os.Bundle; Loading @@ -39,6 +42,8 @@ import android.os.StrictMode; import android.os.StrictMode.ThreadPolicy; import android.util.ArraySet; import android.util.Log; import android.util.TypedValue; import android.view.ContextThemeWrapper; import java.util.ArrayList; import java.util.Arrays; Loading Loading @@ -472,12 +477,25 @@ public abstract class SliceProvider extends ContentProvider { } Slice.Builder parent = new Slice.Builder(sliceUri); Slice.Builder childAction = new Slice.Builder(parent) .addIcon(Icon.createWithResource(context, com.android.internal.R.drawable.ic_permission), null, Collections.emptyList()) .addHints(Arrays.asList(Slice.HINT_TITLE, Slice.HINT_SHORTCUT)) .addAction(action, new Slice.Builder(parent).build(), null); TypedValue tv = new TypedValue(); new ContextThemeWrapper(context, android.R.style.Theme_DeviceDefault_Light) .getTheme().resolveAttribute(android.R.attr.colorAccent, tv, true); int deviceDefaultAccent = tv.data; parent.addSubSlice(new Slice.Builder(sliceUri.buildUpon().appendPath("permission").build()) .addIcon(Icon.createWithResource(context, com.android.internal.R.drawable.ic_arrow_forward), null, Collections.emptyList()) .addText(getPermissionString(context, callingPackage), null, Collections.emptyList()) .addInt(deviceDefaultAccent, SUBTYPE_COLOR, Collections.emptyList()) .addSubSlice(childAction.build(), null) .build(), null); return parent.addHints(Arrays.asList(Slice.HINT_PERMISSION_REQUEST)).build(); Loading
core/res/res/drawable/ic_arrow_forward.xml 0 → 100644 +24 −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. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24.0dp" android:height="24.0dp" android:viewportWidth="24.0" android:viewportHeight="24.0"> <path android:fillColor="#FF000000" android:pathData="M12.0,4.0l-1.41,1.41L16.17,11.0L4.0,11.0l0.0,2.0l12.17,0.0l-5.58,5.59L12.0,20.0l8.0,-8.0z"/> </vector>
core/res/res/drawable/ic_permission.xml 0 → 100644 +26 −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. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24.0dp" android:height="24.0dp" android:viewportWidth="16.0" android:viewportHeight="16.0"> <path android:fillColor="#FF000000" android:pathData=" M9.0,12l-2.0,0.0l0.0,-2.0l2.0,0.0l0.0,2.0z m0.0,-4.0l-2.0,0.0l0.0,-4.0l2.0,0.0l0.0,4.0z"/> </vector>
core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -3389,4 +3389,6 @@ <java-symbol type="attr" name="opticalInsetBottom" /> <java-symbol type="drawable" name="ic_lock_lockdown" /> <java-symbol type="drawable" name="ic_arrow_forward" /> <java-symbol type="drawable" name="ic_permission" /> </resources>
packages/SystemUI/AndroidManifest.xml +2 −0 Original line number Diff line number Diff line Loading @@ -211,6 +211,8 @@ <!-- Permission necessary to change car audio volume through CarAudioManager --> <uses-permission android:name="android.car.permission.CAR_CONTROL_AUDIO_VOLUME" /> <uses-permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS" /> <application android:name=".SystemUIApplication" android:persistent="true" Loading