Skip to content

Commit 610f310

Browse files
Dianne HackbornAndroid (Google) Code Review
authored andcommitted
Merge "New permissions UI." into jb-dev
2 parents 1c87360 + 0e128bb commit 610f310

File tree

8 files changed

+376
-404
lines changed

8 files changed

+376
-404
lines changed

api/current.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5783,7 +5783,7 @@ package android.content {
57835783
field public static final java.lang.String CATEGORY_UNIT_TEST = "android.intent.category.UNIT_TEST";
57845784
field public static final android.os.Parcelable.Creator CREATOR;
57855785
field public static final java.lang.String EXTRA_ALARM_COUNT = "android.intent.extra.ALARM_COUNT";
5786-
field public static final java.lang.String EXTRA_ALLOW_REPLACE = "android.intent.extra.ALLOW_REPLACE";
5786+
field public static final deprecated java.lang.String EXTRA_ALLOW_REPLACE = "android.intent.extra.ALLOW_REPLACE";
57875787
field public static final java.lang.String EXTRA_BCC = "android.intent.extra.BCC";
57885788
field public static final java.lang.String EXTRA_BUG_REPORT = "android.intent.extra.BUG_REPORT";
57895789
field public static final java.lang.String EXTRA_CC = "android.intent.extra.CC";

core/java/android/content/Intent.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,11 @@ public static Intent createChooser(Intent target, CharSequence title) {
12401240
* Used as a boolean extra field with {@link #ACTION_INSTALL_PACKAGE} to install a
12411241
* package. Tells the installer UI to skip the confirmation with the user
12421242
* if the .apk is replacing an existing one.
1243+
* @deprecated As of {@link android.os.Build.VERSION_CODES#JELLY_BEAN}, Android
1244+
* will no longer show an interstitial message about updating existing
1245+
* applications so this is no longer needed.
12431246
*/
1247+
@Deprecated
12441248
public static final String EXTRA_ALLOW_REPLACE
12451249
= "android.intent.extra.ALLOW_REPLACE";
12461250

core/java/android/widget/AppSecurityPermissions.java

Lines changed: 292 additions & 300 deletions
Large diffs are not rendered by default.

core/res/res/layout/app_permission_item.xml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,37 +19,32 @@
1919
Contains the group name and a list of permission labels under the group.
2020
-->
2121

22-
<RelativeLayout
22+
<view class="android.widget.AppSecurityPermissions$PermissionItemView"
2323
xmlns:android="http://schemas.android.com/apk/res/android"
2424
android:layout_width="match_parent"
25-
android:layout_height="wrap_content">
25+
android:layout_height="wrap_content"
26+
android:orientation="horizontal"
27+
android:background="?android:attr/selectableItemBackground">
2628

2729
<ImageView
2830
android:id="@+id/perm_icon"
29-
android:layout_width="30dip"
30-
android:layout_height="30dip"
31-
android:layout_alignParentLeft="true"
31+
android:layout_width="32dp"
32+
android:layout_height="32dp"
33+
android:layout_marginLeft="16dp"
34+
android:layout_marginRight="8dp"
3235
android:scaleType="fitCenter" />
3336

34-
35-
<TextView
36-
android:id="@+id/permission_group"
37-
android:textAppearance="?android:attr/textAppearanceMedium"
38-
android:textStyle="bold"
39-
android:paddingLeft="6dip"
40-
android:layout_toRightOf="@id/perm_icon"
37+
<ImageView
4138
android:layout_width="wrap_content"
42-
android:layout_height="wrap_content" />
39+
android:layout_height="match_parent"
40+
android:background="?android:attr/dividerVertical" />
4341

4442
<TextView
45-
android:id="@+id/permission_list"
43+
android:id="@+id/perm_name"
4644
android:textAppearance="?android:attr/textAppearanceSmall"
47-
android:layout_marginTop="-4dip"
48-
android:paddingBottom="8dip"
49-
android:paddingLeft="6dip"
50-
android:layout_below="@id/permission_group"
51-
android:layout_toRightOf="@id/perm_icon"
45+
android:layout_marginLeft="8dp"
5246
android:layout_width="wrap_content"
53-
android:layout_height="wrap_content" />
47+
android:layout_height="wrap_content"
48+
android:layout_gravity="top|left" />
5449

55-
</RelativeLayout>
50+
</view>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (C) 2008 The Android Open Source Project
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
17+
<!--
18+
Defines the layout of a single permission item.
19+
Contains the group name and a list of permission labels under the group.
20+
-->
21+
22+
<RelativeLayout
23+
xmlns:android="http://schemas.android.com/apk/res/android"
24+
android:layout_width="match_parent"
25+
android:layout_height="wrap_content">
26+
27+
<ImageView
28+
android:id="@+id/perm_icon"
29+
android:layout_width="30dip"
30+
android:layout_height="30dip"
31+
android:layout_alignParentLeft="true"
32+
android:scaleType="fitCenter" />
33+
34+
35+
<TextView
36+
android:id="@+id/permission_group"
37+
android:textAppearance="?android:attr/textAppearanceMedium"
38+
android:textStyle="bold"
39+
android:paddingLeft="6dip"
40+
android:layout_toRightOf="@id/perm_icon"
41+
android:layout_width="wrap_content"
42+
android:layout_height="wrap_content" />
43+
44+
<TextView
45+
android:id="@+id/permission_list"
46+
android:textAppearance="?android:attr/textAppearanceSmall"
47+
android:layout_marginTop="-4dip"
48+
android:paddingBottom="8dip"
49+
android:paddingLeft="6dip"
50+
android:layout_below="@id/permission_group"
51+
android:layout_toRightOf="@id/perm_icon"
52+
android:layout_width="wrap_content"
53+
android:layout_height="wrap_content" />
54+
55+
</RelativeLayout>

core/res/res/layout/app_perms_summary.xml

Lines changed: 4 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -26,88 +26,17 @@
2626
android:id="@+id/no_permissions"
2727
android:text="@string/no_permissions"
2828
android:textAppearance="?android:attr/textAppearanceMedium"
29-
android:paddingLeft="16dip"
30-
android:paddingRight="12dip"
29+
android:paddingLeft="8dp"
30+
android:paddingRight="8dp"
3131
android:visibility="gone"
3232
android:layout_width="wrap_content"
3333
android:layout_height="wrap_content" />
3434

35-
<!-- List view containing list of new permissions categorized by groups. -->
35+
<!-- Populated with all permissions. -->
3636
<LinearLayout
37-
android:id="@+id/new_perms_list"
37+
android:id="@+id/perms_list"
3838
android:orientation="vertical"
3939
android:layout_width="match_parent"
40-
android:paddingLeft="16dip"
41-
android:paddingRight="12dip"
42-
android:layout_height="wrap_content" />
43-
44-
<!-- List view containing list of dangerous permissions categorized by groups. -->
45-
<LinearLayout
46-
android:id="@+id/dangerous_perms_list"
47-
android:orientation="vertical"
48-
android:layout_width="match_parent"
49-
android:paddingLeft="16dip"
50-
android:paddingRight="12dip"
51-
android:layout_height="wrap_content" />
52-
53-
<!-- Clickable area letting user display additional permissions. -->
54-
<LinearLayout
55-
android:id="@+id/show_more"
56-
android:orientation="vertical"
57-
android:layout_width="match_parent"
58-
android:layout_height="wrap_content"
59-
android:visibility="gone"
60-
android:layout_marginTop="12dip"
61-
android:layout_marginBottom="16dip">
62-
63-
<View
64-
android:layout_width="match_parent"
65-
android:layout_height="1dip"
66-
android:background="?android:attr/listDivider" />
67-
68-
<LinearLayout
69-
android:orientation="horizontal"
70-
android:layout_width="match_parent"
71-
android:layout_height="wrap_content"
72-
android:paddingTop="16dip"
73-
android:paddingBottom="12dip"
74-
android:paddingLeft="16dip"
75-
android:duplicateParentState="true"
76-
android:background="?android:attr/selectableItemBackground">
77-
78-
<TextView
79-
android:id="@+id/show_more_text"
80-
android:textAppearance="?android:attr/textAppearanceMedium"
81-
android:duplicateParentState="true"
82-
android:layout_alignTop="@+id/show_more_icon"
83-
android:layout_gravity="center_vertical"
84-
android:paddingLeft="36dip"
85-
android:layout_weight="1"
86-
android:layout_width="wrap_content"
87-
android:layout_height="wrap_content" />
88-
89-
<ImageView
90-
android:id="@id/show_more_icon"
91-
android:layout_width="wrap_content"
92-
android:layout_height="wrap_content"
93-
android:layout_marginRight="12dip" />
94-
95-
</LinearLayout>
96-
97-
<View
98-
android:layout_width="match_parent"
99-
android:layout_height="1dip"
100-
android:background="?android:attr/listDivider" />
101-
102-
</LinearLayout>
103-
104-
<!-- List view containing list of permissions that aren't dangerous. -->
105-
<LinearLayout
106-
android:id="@+id/non_dangerous_perms_list"
107-
android:orientation="vertical"
108-
android:paddingLeft="16dip"
109-
android:paddingRight="12dip"
110-
android:layout_width="match_parent"
11140
android:layout_height="wrap_content" />
11241

11342
</LinearLayout>

core/res/res/values/public.xml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
<java-symbol type="id" name="clearDefaultHint" />
6464
<java-symbol type="id" name="contentPanel" />
6565
<java-symbol type="id" name="customPanel" />
66-
<java-symbol type="id" name="dangerous_perms_list" />
6766
<java-symbol type="id" name="datePicker" />
6867
<java-symbol type="id" name="day" />
6968
<java-symbol type="id" name="day_names" />
@@ -117,17 +116,17 @@
117116
<java-symbol type="id" name="new_app_action" />
118117
<java-symbol type="id" name="new_app_description" />
119118
<java-symbol type="id" name="new_app_icon" />
120-
<java-symbol type="id" name="new_perms_list" />
121119
<java-symbol type="id" name="no_permissions" />
122-
<java-symbol type="id" name="non_dangerous_perms_list" />
123120
<java-symbol type="id" name="numberpicker_input" />
124121
<java-symbol type="id" name="old_app_action" />
125122
<java-symbol type="id" name="old_app_description" />
126123
<java-symbol type="id" name="old_app_icon" />
127124
<java-symbol type="id" name="package_label" />
128125
<java-symbol type="id" name="packages_list" />
129126
<java-symbol type="id" name="pause" />
127+
<java-symbol type="id" name="perms_list" />
130128
<java-symbol type="id" name="perm_icon" />
129+
<java-symbol type="id" name="perm_name" />
131130
<java-symbol type="id" name="permission_group" />
132131
<java-symbol type="id" name="permission_list" />
133132
<java-symbol type="id" name="pickers" />
@@ -163,9 +162,6 @@
163162
<java-symbol type="id" name="sha256_fingerprint" />
164163
<java-symbol type="id" name="share" />
165164
<java-symbol type="id" name="shortcut" />
166-
<java-symbol type="id" name="show_more" />
167-
<java-symbol type="id" name="show_more_icon" />
168-
<java-symbol type="id" name="show_more_text" />
169165
<java-symbol type="id" name="skip_button" />
170166
<java-symbol type="id" name="slider_group" />
171167
<java-symbol type="id" name="split_action_bar" />
@@ -1044,6 +1040,7 @@
10441040
<java-symbol type="layout" name="alert_dialog_progress" />
10451041
<java-symbol type="layout" name="always_use_checkbox" />
10461042
<java-symbol type="layout" name="app_permission_item" />
1043+
<java-symbol type="layout" name="app_permission_item_old" />
10471044
<java-symbol type="layout" name="app_perms_summary" />
10481045
<java-symbol type="layout" name="calendar_view" />
10491046
<java-symbol type="layout" name="character_picker" />

core/res/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2981,7 +2981,7 @@
29812981
<!-- Do not translate. -->
29822982
<string name="permissions_format"><xliff:g id="perm_line1">%1$s</xliff:g>, <xliff:g id="perm_line2">%2$s</xliff:g></string>
29832983
<!-- Text that is placed at the front of a permission name that is being added to an app [CHAR LIMIT=NONE] -->
2984-
<string name="perms_new_perm_prefix"><font size="12" fgcolor="#ffffa3a3">NEW: </font></string>
2984+
<string name="perms_new_perm_prefix"><font size="12" fgcolor="#ff900000">NEW: </font></string>
29852985
<!-- Shown for an application when it doesn't require any permission grants. -->
29862986
<string name="no_permissions">No permissions required</string>
29872987
<!-- When installing an application, the less-dangerous permissions are hidden. If the user showed those, this is the text to hide them again. -->

0 commit comments

Comments
 (0)