Loading res/drawable/ic_info_outline.xml +25 −19 Original line number Diff line number Diff line <!-- Copyright (C) 2015 The Android Open Source Project <?xml version="1.0" encoding="utf-8"?> 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 <!-- ~ 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. --> http://www.apache.org/licenses/LICENSE-2.0 <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24" android:tint="?android:attr/colorControlNormal"> 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="?android:attr/colorAccent" android:pathData="M11.0,17.0l2.0,0.0l0.0,-6.0l-2.0,0.0l0.0,6.0zm1.0,-15.0C6.48,2.0 2.0,6.48 2.0,12.0s4.48,10.0 10.0,10.0 10.0,-4.48 10.0,-10.0S17.52,2.0 12.0,2.0zm0.0,18.0c-4.41,0.0 -8.0,-3.59 -8.0,-8.0s3.59,-8.0 8.0,-8.0 8.0,3.59 8.0,8.0 -3.59,8.0 -8.0,8.0zM11.0,9.0l2.0,0.0L13.0,7.0l-2.0,0.0l0.0,2.0z"/> android:fillColor="#FF000000" android:pathData="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z"/> </vector> res/drawable/ic_info_outline_accent.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <!-- Copyright (C) 2015 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="?android:attr/colorAccent" android:pathData="M11.0,17.0l2.0,0.0l0.0,-6.0l-2.0,0.0l0.0,6.0zm1.0,-15.0C6.48,2.0 2.0,6.48 2.0,12.0s4.48,10.0 10.0,10.0 10.0,-4.48 10.0,-10.0S17.52,2.0 12.0,2.0zm0.0,18.0c-4.41,0.0 -8.0,-3.59 -8.0,-8.0s3.59,-8.0 8.0,-8.0 8.0,3.59 8.0,8.0 -3.59,8.0 -8.0,8.0zM11.0,9.0l2.0,0.0L13.0,7.0l-2.0,0.0l0.0,2.0z"/> </vector> res/layout/header.xml +1 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ android:minHeight="0dp" android:minWidth="0dp" android:scaleType="center" android:src="@drawable/ic_info_outline" android:src="@drawable/ic_info_outline_accent" android:contentDescription="@string/app_permissions_info_button_label" style="?android:attr/borderlessButtonStyle" /> Loading res/xml/roles.xml +12 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ <role name="android.app.role.ASSISTANT" behavior="AssistantRoleBehavior" description="@string/role_assistant_description" exclusive="true" showNone="true" label="@string/role_assistant_label" Loading Loading @@ -129,6 +130,7 @@ <role name="android.app.role.BROWSER" behavior="BrowserRoleBehavior" description="@string/role_browser_description" exclusive="true" label="@string/role_browser_label" requestDescription="@string/role_browser_request_description" Loading Loading @@ -166,6 +168,7 @@ <role name="android.app.role.DIALER" behavior="DialerRoleBehavior" description="@string/role_dialer_description" exclusive="true" label="@string/role_dialer_label" requestDescription="@string/role_dialer_request_description" Loading Loading @@ -225,6 +228,7 @@ <role name="android.app.role.SMS" behavior="SmsRoleBehavior" description="@string/role_sms_description" exclusive="true" label="@string/role_sms_label" requestDescription="@string/role_sms_request_description" Loading Loading @@ -310,6 +314,7 @@ <role name="android.app.role.EMERGENCY" behavior="EmergencyRoleBehavior" description="@string/role_emergency_description" exclusive="true" label="@string/role_emergency_label" requestDescription="@string/role_emergency_request_description" Loading @@ -333,6 +338,7 @@ <role name="android.app.role.HOME" behavior="HomeRoleBehavior" description="@string/role_home_description" exclusive="true" label="@string/role_home_label" requestDescription="@string/role_home_request_description" Loading Loading @@ -366,6 +372,7 @@ <role name="android.app.role.MUSIC" behavior="MusicRoleBehavior" description="@string/role_music_description" exclusive="true" label="@string/role_music_label" requestDescription="@string/role_music_request_description" Loading Loading @@ -404,6 +411,7 @@ <role name="android.app.role.GALLERY" behavior="GalleryRoleBehavior" description="@string/role_gallery_description" exclusive="true" label="@string/role_gallery_label" requestDescription="@string/role_gallery_request_description" Loading Loading @@ -443,6 +451,7 @@ <!--- @see android.telecom.InCallService --> <role name="android.app.role.CAR_MODE_DIALER" description="@string/role_car_mode_dialer_description" exclusive="true" label="@string/role_car_mode_dialer_label" requestDescription="@string/role_car_mode_dialer_request_description" Loading @@ -465,6 +474,7 @@ <!--- @see android.telecom.CallRedirectionService --> <role name="android.app.role.CALL_REDIRECTION" description="@string/role_call_redirection_description" exclusive="true" label="@string/role_call_redirection_label" requestDescription="@string/role_call_redirection_request_description" Loading @@ -482,6 +492,7 @@ <!--- @see android.telecom.CallScreeningService --> <role name="android.app.role.CALL_SCREENING" description="@string/role_call_screening_description" exclusive="true" label="@string/role_call_screening_label" requestDescription="@string/role_call_screening_request_description" Loading @@ -499,6 +510,7 @@ <!--- @see android.telecom.InCallService --> <role name="android.app.role.CALL_COMPANION" description="@string/role_call_companion_description" exclusive="false" label="@string/role_call_companion_label" requestDescription="@string/role_call_companion_request_description" Loading src/com/android/packageinstaller/role/model/Role.java +16 −4 Original line number Diff line number Diff line Loading @@ -79,6 +79,12 @@ public class Role { @Nullable private final RoleBehavior mBehavior; /** * The string resource for the description of this role. */ @StringRes private final int mDescriptionResource; /** * Whether this role is exclusive, i.e. allows at most one holder. */ Loading Loading @@ -146,14 +152,15 @@ public class Role { @NonNull private final List<PreferredActivity> mPreferredActivities; public Role(@NonNull String name, @Nullable RoleBehavior behavior, boolean exclusive, @StringRes int labelResource, @StringRes int requestDescriptionResource, @StringRes int requestTitleResource, @StringRes int shortLabelResource, boolean showNone, boolean systemOnly, public Role(@NonNull String name, @Nullable RoleBehavior behavior, @StringRes int descriptionResource, boolean exclusive, @StringRes int labelResource, @StringRes int requestDescriptionResource, @StringRes int requestTitleResource, @StringRes int shortLabelResource, boolean showNone, boolean systemOnly, @NonNull List<RequiredComponent> requiredComponents, @NonNull List<String> permissions, @NonNull List<AppOp> appOps, @NonNull List<PreferredActivity> preferredActivities) { mName = name; mBehavior = behavior; mDescriptionResource = descriptionResource; mExclusive = exclusive; mLabelResource = labelResource; mRequestDescriptionResource = requestDescriptionResource; Loading @@ -177,6 +184,11 @@ public class Role { return mBehavior; } @StringRes public int getDescriptionResource() { return mDescriptionResource; } public boolean isExclusive() { return mExclusive; } Loading Loading
res/drawable/ic_info_outline.xml +25 −19 Original line number Diff line number Diff line <!-- Copyright (C) 2015 The Android Open Source Project <?xml version="1.0" encoding="utf-8"?> 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 <!-- ~ 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. --> http://www.apache.org/licenses/LICENSE-2.0 <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24" android:tint="?android:attr/colorControlNormal"> 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="?android:attr/colorAccent" android:pathData="M11.0,17.0l2.0,0.0l0.0,-6.0l-2.0,0.0l0.0,6.0zm1.0,-15.0C6.48,2.0 2.0,6.48 2.0,12.0s4.48,10.0 10.0,10.0 10.0,-4.48 10.0,-10.0S17.52,2.0 12.0,2.0zm0.0,18.0c-4.41,0.0 -8.0,-3.59 -8.0,-8.0s3.59,-8.0 8.0,-8.0 8.0,3.59 8.0,8.0 -3.59,8.0 -8.0,8.0zM11.0,9.0l2.0,0.0L13.0,7.0l-2.0,0.0l0.0,2.0z"/> android:fillColor="#FF000000" android:pathData="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z"/> </vector>
res/drawable/ic_info_outline_accent.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <!-- Copyright (C) 2015 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="?android:attr/colorAccent" android:pathData="M11.0,17.0l2.0,0.0l0.0,-6.0l-2.0,0.0l0.0,6.0zm1.0,-15.0C6.48,2.0 2.0,6.48 2.0,12.0s4.48,10.0 10.0,10.0 10.0,-4.48 10.0,-10.0S17.52,2.0 12.0,2.0zm0.0,18.0c-4.41,0.0 -8.0,-3.59 -8.0,-8.0s3.59,-8.0 8.0,-8.0 8.0,3.59 8.0,8.0 -3.59,8.0 -8.0,8.0zM11.0,9.0l2.0,0.0L13.0,7.0l-2.0,0.0l0.0,2.0z"/> </vector>
res/layout/header.xml +1 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ android:minHeight="0dp" android:minWidth="0dp" android:scaleType="center" android:src="@drawable/ic_info_outline" android:src="@drawable/ic_info_outline_accent" android:contentDescription="@string/app_permissions_info_button_label" style="?android:attr/borderlessButtonStyle" /> Loading
res/xml/roles.xml +12 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ <role name="android.app.role.ASSISTANT" behavior="AssistantRoleBehavior" description="@string/role_assistant_description" exclusive="true" showNone="true" label="@string/role_assistant_label" Loading Loading @@ -129,6 +130,7 @@ <role name="android.app.role.BROWSER" behavior="BrowserRoleBehavior" description="@string/role_browser_description" exclusive="true" label="@string/role_browser_label" requestDescription="@string/role_browser_request_description" Loading Loading @@ -166,6 +168,7 @@ <role name="android.app.role.DIALER" behavior="DialerRoleBehavior" description="@string/role_dialer_description" exclusive="true" label="@string/role_dialer_label" requestDescription="@string/role_dialer_request_description" Loading Loading @@ -225,6 +228,7 @@ <role name="android.app.role.SMS" behavior="SmsRoleBehavior" description="@string/role_sms_description" exclusive="true" label="@string/role_sms_label" requestDescription="@string/role_sms_request_description" Loading Loading @@ -310,6 +314,7 @@ <role name="android.app.role.EMERGENCY" behavior="EmergencyRoleBehavior" description="@string/role_emergency_description" exclusive="true" label="@string/role_emergency_label" requestDescription="@string/role_emergency_request_description" Loading @@ -333,6 +338,7 @@ <role name="android.app.role.HOME" behavior="HomeRoleBehavior" description="@string/role_home_description" exclusive="true" label="@string/role_home_label" requestDescription="@string/role_home_request_description" Loading Loading @@ -366,6 +372,7 @@ <role name="android.app.role.MUSIC" behavior="MusicRoleBehavior" description="@string/role_music_description" exclusive="true" label="@string/role_music_label" requestDescription="@string/role_music_request_description" Loading Loading @@ -404,6 +411,7 @@ <role name="android.app.role.GALLERY" behavior="GalleryRoleBehavior" description="@string/role_gallery_description" exclusive="true" label="@string/role_gallery_label" requestDescription="@string/role_gallery_request_description" Loading Loading @@ -443,6 +451,7 @@ <!--- @see android.telecom.InCallService --> <role name="android.app.role.CAR_MODE_DIALER" description="@string/role_car_mode_dialer_description" exclusive="true" label="@string/role_car_mode_dialer_label" requestDescription="@string/role_car_mode_dialer_request_description" Loading @@ -465,6 +474,7 @@ <!--- @see android.telecom.CallRedirectionService --> <role name="android.app.role.CALL_REDIRECTION" description="@string/role_call_redirection_description" exclusive="true" label="@string/role_call_redirection_label" requestDescription="@string/role_call_redirection_request_description" Loading @@ -482,6 +492,7 @@ <!--- @see android.telecom.CallScreeningService --> <role name="android.app.role.CALL_SCREENING" description="@string/role_call_screening_description" exclusive="true" label="@string/role_call_screening_label" requestDescription="@string/role_call_screening_request_description" Loading @@ -499,6 +510,7 @@ <!--- @see android.telecom.InCallService --> <role name="android.app.role.CALL_COMPANION" description="@string/role_call_companion_description" exclusive="false" label="@string/role_call_companion_label" requestDescription="@string/role_call_companion_request_description" Loading
src/com/android/packageinstaller/role/model/Role.java +16 −4 Original line number Diff line number Diff line Loading @@ -79,6 +79,12 @@ public class Role { @Nullable private final RoleBehavior mBehavior; /** * The string resource for the description of this role. */ @StringRes private final int mDescriptionResource; /** * Whether this role is exclusive, i.e. allows at most one holder. */ Loading Loading @@ -146,14 +152,15 @@ public class Role { @NonNull private final List<PreferredActivity> mPreferredActivities; public Role(@NonNull String name, @Nullable RoleBehavior behavior, boolean exclusive, @StringRes int labelResource, @StringRes int requestDescriptionResource, @StringRes int requestTitleResource, @StringRes int shortLabelResource, boolean showNone, boolean systemOnly, public Role(@NonNull String name, @Nullable RoleBehavior behavior, @StringRes int descriptionResource, boolean exclusive, @StringRes int labelResource, @StringRes int requestDescriptionResource, @StringRes int requestTitleResource, @StringRes int shortLabelResource, boolean showNone, boolean systemOnly, @NonNull List<RequiredComponent> requiredComponents, @NonNull List<String> permissions, @NonNull List<AppOp> appOps, @NonNull List<PreferredActivity> preferredActivities) { mName = name; mBehavior = behavior; mDescriptionResource = descriptionResource; mExclusive = exclusive; mLabelResource = labelResource; mRequestDescriptionResource = requestDescriptionResource; Loading @@ -177,6 +184,11 @@ public class Role { return mBehavior; } @StringRes public int getDescriptionResource() { return mDescriptionResource; } public boolean isExclusive() { return mExclusive; } Loading