Merge "Add default icon for permissions" into mnc-dev

This commit is contained in:
Jason Monk
2015-05-13 21:06:28 +00:00
committed by Android (Google) Code Review
3 changed files with 29 additions and 3 deletions

View File

@@ -0,0 +1,24 @@
<!--
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="48.0"
android:viewportHeight="48.0">
<path
android:fillColor="#FF000000"
android:pathData="M26.0,14.0l-4.0,0.0l0.0,4.0l4.0,0.0l0.0,-4.0zm0.0,8.0l-4.0,0.0l0.0,12.0l4.0,0.0L26.0,22.0zm8.0,-19.98L14.0,2.0c-2.21,0.0 -4.0,1.79 -4.0,4.0l0.0,36.0c0.0,2.21 1.79,4.0 4.0,4.0l20.0,0.0c2.21,0.0 4.0,-1.79 4.0,-4.0L38.0,6.0c0.0,-2.21 -1.79,-3.98 -4.0,-3.98zM34.0,38.0L14.0,38.0L14.0,10.0l20.0,0.0l0.0,28.0z"/>
</vector>

View File

@@ -2274,4 +2274,5 @@
<java-symbol type="color" name="chooser_service_row_background_color" />
<java-symbol type="id" name="target_badge" />
<java-symbol type="bool" name="config_supportDoubleTapWake" />
<java-symbol type="drawable" name="ic_perm_device_info" />
</resources>

View File

@@ -22,7 +22,6 @@ import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.PermissionGroupInfo;
import android.content.pm.PermissionInfo;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.ShapeDrawable;
import android.os.AsyncTask;
import android.os.Build;
import android.os.UserHandle;
@@ -80,7 +79,8 @@ public class PermissionsInfo {
if (info.protectionLevel == PermissionInfo.PROTECTION_DANGEROUS) {
group = new PermissionGroup();
// TODO: Add default permission icon.
group.icon = info.icon != 0 ? info.loadIcon(mPm) : new ShapeDrawable();
group.icon = info.icon != 0 ? info.loadIcon(mPm) : mContext.getDrawable(
com.android.internal.R.drawable.ic_perm_device_info);
group.name = info.name;
group.packageName = info.packageName;
group.label = info.loadLabel(mPm).toString();
@@ -104,7 +104,8 @@ public class PermissionsInfo {
for (PermissionGroupInfo groupInfo : groups) {
PermissionGroup group = new PermissionGroup();
// TODO: Add default permission icon.
group.icon = groupInfo.icon != 0 ? groupInfo.loadIcon(mPm) : new ShapeDrawable();
group.icon = groupInfo.icon != 0 ? groupInfo.loadIcon(mPm) : mContext.getDrawable(
com.android.internal.R.drawable.ic_perm_device_info);
group.name = groupInfo.name;
group.packageName = groupInfo.packageName;
group.label = groupInfo.loadLabel(mPm).toString();