diff options
| -rw-r--r-- | res/layout/app_version.xml | 59 | ||||
| -rw-r--r-- | res/values-ast-rES/strings.xml | 10 | ||||
| -rw-r--r-- | res/values-de/aicp-strings.xml | 28 | ||||
| -rw-r--r-- | res/values-nl/aicp-strings.xml | 28 | ||||
| -rw-r--r-- | res/values/aicp_strings.xml | 28 | ||||
| -rw-r--r-- | src/com/android/packageinstaller/PackageInstallerActivity.java | 72 | ||||
| -rw-r--r-- | src/com/android/packageinstaller/permission/ui/OverlayTouchActivity.java | 11 |
7 files changed, 211 insertions, 25 deletions
diff --git a/res/layout/app_version.xml b/res/layout/app_version.xml new file mode 100644 index 000000000..68568465d --- /dev/null +++ b/res/layout/app_version.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="utf-8"?> + +<GridLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/app_version" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:layout_marginBottom="16dp" + android:columnCount="2" + android:rowCount="2" > + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_column="0" + android:layout_columnSpan="1" + android:layout_marginEnd="16dp" + android:layout_marginStart="16dp" + android:layout_row="0" + android:layout_rowSpan="1" + android:text="@string/currentVersion" + android:textAppearance="?android:attr/textAppearanceMedium" /> + + <TextView + android:id="@+id/app_current_version" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_column="1" + android:layout_columnSpan="1" + android:layout_marginEnd="16dp" + android:layout_row="0" + android:layout_rowSpan="1" + android:textAppearance="?android:attr/textAppearanceMedium" /> + + <TextView + android:textAppearance="?android:attr/textAppearanceMedium" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_column="0" + android:layout_columnSpan="1" + android:layout_marginEnd="16dp" + android:layout_marginStart="16dp" + android:layout_row="1" + android:layout_rowSpan="1" + android:text="@string/newVersion" /> + + <TextView + android:id="@+id/app_new_version" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_column="1" + android:layout_columnSpan="1" + android:layout_marginEnd="16dp" + android:layout_row="1" + android:layout_rowSpan="1" + android:textAppearance="?android:attr/textAppearanceMedium" /> + +</GridLayout> diff --git a/res/values-ast-rES/strings.xml b/res/values-ast-rES/strings.xml index 9d2f2efe8..9bf9f18d7 100644 --- a/res/values-ast-rES/strings.xml +++ b/res/values-ast-rES/strings.xml @@ -120,6 +120,8 @@ ye un xestor activu de preseos.</string> <!-- String presented to the user when uninstalling a package failed because the target package is a current device administrator for some user [CHAR LIMIT=100] --> + <string name="uninstall_failed_device_policy_manager_of_user">Nun pue instalase porque esti paquete ye + un alministrador de preseos activu pal usuariu <xliff:g id="username">%1$s</xliff:g>.</string> <!-- String presented to the user when uninstalling a package failed because a profile owner has marked the the target package as not able to be uninstalled [CHAR LIMIT=80] --> <string name="uninstall_blocked_profile_owner">Esta aplicación precísase pal @@ -162,6 +164,7 @@ <!-- Breadcrumb for page of managing application permissions [CHAR LIMIT=50] --> <string name="app_permissions_breadcrumb">Aplicaciones</string> <!-- Title for page of managing application permissions --> + <string name="app_permissions">Permisos d\'aplicaciones</string> <!-- Checkbox that allows user to not be questioned about this permission request again --> <string name="never_ask_again">Nun entrugar enxamás</string> @@ -175,6 +178,7 @@ <item quantity="other"><xliff:g id="count" example="1">%1$d</xliff:g> más</item> </plurals> <!-- Warning for turning off permissions on older apps --> + <string name="old_sdk_deny_warning">Esta aplicación diseñóse pa una versión vieya d\'Android. Denegar el permisu quiciabes faiga que nun furrule como s\'esperaba.</string> <!-- The default description of a permission, i.e. what it does. [CHAR LIMIT=40] --> <string name="default_permission_description">facer una aición desconocida</string> <!-- Summary of number of apps currently granted a single permission [CHAR LIMIT=45] --> @@ -190,25 +194,31 @@ <!-- [CHAR LIMIT=30] Title of button that leads to location settings --> <string name="location_settings">Axustes d\'allugamientu</string> <!-- [CHAR LIMIT=NONE] Warning about how this app cannot have location permission disabled --> + <string name="location_warning"><xliff:g id="app_name" example="Package Installer">%1$s</xliff:g> ye un fornidor del serviciu d\'allugamientu pa esti preséu. L\'accesu al allugamientu pue modificase dende los sos axustes.</string> <!-- [CHAR LIMIT=NONE] Warning message when turning off permission for system apps --> <string name="system_warning">Si ñegues esti permisu, quiciabes nun funcionen como s\'esperaben les carauterístiques básiques.</string> <!-- [CHAR LIMIT=NONE] Summary of a permission switch when it's enforced by policy --> + <string name="permission_summary_enforced_by_policy">Aplícase pola política</string> <!-- Text displayed until loading is done --> <string name="loading">Cargando\u2026</string> <!-- [CHAR LIMIT=45] Title of all permissions settings --> <string name="all_permissions">Tolos permisos</string> <!-- [CHAR LIMIT=45] Group of permissions granted to app automatically when installed. --> + <string name="other_permissions">Otres capacidaes de l\'aplicación</string> <!-- Title of the permission dialog for accessibility purposes- spoken to the user. [CHAR LIMIT=none] --> <string name="permission_request_title">Solicitú de permisu</string> <!-- Title for the dialog that warns the user they need to turn off screen overlays before permissions can be changed. [CHAR LIMIT=NONE] --> + <string name="screen_overlay_title">Deteutóse una superposición de pantalla</string> <!-- Message for the dialog that warns the user they need to turn off screen overlays before permissions can be changed. The "Settings > Apps" conveys to the user to go to Settings and click on apps, this may need updates in RTL languages. [CHAR LIMIT=NONE] --> + <string name="screen_overlay_message">Pa camudar l\'axuste d\'esti permisu, primero tienes d\'apagar la superposición de pantalla dende Axustes \u003e Aplicaciones</string> <!-- Button for the dialog that warns the user they need to turn off screen overlays before permissions can be changed. [CHAR LIMIT=NONE] --> <string name="screen_overlay_button">Abrir axustes</string> <!-- Title of dialog telling users that Install/Uninstall action is not supported on Android Wear. --> <string name="wear_not_allowed_dlg_title">Android Wear</string> <!-- Title of dialog telling users that Install/Uninstall action is not supported on Android Wear. --> + <string name="wear_not_allowed_dlg_text">Les aiciones de des/instalación nun tán sofitaes en Wear.</string> </resources> diff --git a/res/values-de/aicp-strings.xml b/res/values-de/aicp-strings.xml new file mode 100644 index 000000000..2d8f3f1de --- /dev/null +++ b/res/values-de/aicp-strings.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2015 AICP + + 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. +--> + +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- Tab label for version information [CHAR LIMIT=20] --> + <string name="appVersion">Versionsinformation</string> + + <!-- Body text for new tab when there are no permissions [CHAR LIMIT=NONE] --> + <string name="no_perms">Diese App benötigt keine besonderen Berechtigungen.</string> + + <string name="currentVersion">Installierte Version:</string> + <string name="newVersion">Neue Version:</string> + <string name="not_available">nicht verfügbar</string> + +</resources> diff --git a/res/values-nl/aicp-strings.xml b/res/values-nl/aicp-strings.xml new file mode 100644 index 000000000..53243cf5e --- /dev/null +++ b/res/values-nl/aicp-strings.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2015 AICP + + 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. +--> + +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- Tab label for version information [CHAR LIMIT=20] --> + <string name="appVersion">Versie informatie</string> + + <!-- Body text for new tab when there are no permissions [CHAR LIMIT=NONE] --> + <string name="no_perms">Deze app vereist geen speciale machtigingen.</string> + + <string name="currentVersion">Geïnstalleerde versie:</string> + <string name="newVersion">Nieuwe versie:</string> + <string name="not_available">niet beschikbaar</string> + +</resources> diff --git a/res/values/aicp_strings.xml b/res/values/aicp_strings.xml new file mode 100644 index 000000000..5379faab0 --- /dev/null +++ b/res/values/aicp_strings.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2015 AICP + + 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. +--> + +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- Tab label for version information [CHAR LIMIT=20] --> + <string name="appVersion">Version Info</string> + + <!-- Body text for new tab when there are no permissions [CHAR LIMIT=NONE] --> + <string name="no_perms">This app requires no permissions.</string> + + <string name="currentVersion">Current Version:</string> + <string name="newVersion">New Version:</string> + <string name="not_available">not available</string> + +</resources> diff --git a/src/com/android/packageinstaller/PackageInstallerActivity.java b/src/com/android/packageinstaller/PackageInstallerActivity.java index 868872a94..991b4ea5b 100644 --- a/src/com/android/packageinstaller/PackageInstallerActivity.java +++ b/src/com/android/packageinstaller/PackageInstallerActivity.java @@ -49,6 +49,7 @@ import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.AppSecurityPermissions; import android.widget.Button; +import android.widget.GridLayout; import android.widget.TabHost; import android.widget.TextView; @@ -135,6 +136,8 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen mScrollView = null; mOkCanInstall = false; int msg = 0; + LayoutInflater inflater = (LayoutInflater)getSystemService( + Context.LAYOUT_INFLATER_SERVICE); AppSecurityPermissions perms = new AppSecurityPermissions(this, mPkgInfo); final int N = perms.getPermissionCount(AppSecurityPermissions.WHICH_ALL); @@ -156,50 +159,71 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen } } if (!supportsRuntimePermissions && !newPermissionsFound) { - LayoutInflater inflater = (LayoutInflater)getSystemService( - Context.LAYOUT_INFLATER_SERVICE); TextView label = (TextView)inflater.inflate(R.layout.label, null); label.setText(R.string.no_new_perms); mScrollView.addView(label); } adapter.addTab(tabHost.newTabSpec(TAB_ID_NEW).setIndicator( getText(R.string.newPerms)), mScrollView); - } else { - findViewById(R.id.tabscontainer).setVisibility(View.GONE); - findViewById(R.id.divider).setVisibility(View.VISIBLE); } if (!supportsRuntimePermissions && N > 0) { permVisible = true; - LayoutInflater inflater = (LayoutInflater)getSystemService( - Context.LAYOUT_INFLATER_SERVICE); View root = inflater.inflate(R.layout.permissions_list, null); if (mScrollView == null) { mScrollView = (CaffeinatedScrollView)root.findViewById(R.id.scrollview); } ((ViewGroup)root.findViewById(R.id.permission_list)).addView( - perms.getPermissionsView(AppSecurityPermissions.WHICH_ALL)); + perms.getPermissionsView(AppSecurityPermissions.WHICH_ALL)); adapter.addTab(tabHost.newTabSpec(TAB_ID_ALL).setIndicator( getText(R.string.allPerms)), root); } mInstallFlowAnalytics.setPermissionsDisplayed(permVisible); - if (!permVisible) { - if (mAppInfo != null) { - // This is an update to an application, but there are no - // permissions at all. - msg = (mAppInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0 - ? R.string.install_confirm_question_update_system_no_perms - : R.string.install_confirm_question_update_no_perms; - } else { - // This is a new application with no permissions. - msg = R.string.install_confirm_question_no_perms; + GridLayout layoutVersion = (GridLayout)inflater.inflate(R.layout.app_version, null); + ((TextView)layoutVersion.findViewById(R.id.app_new_version)).setText(mPkgInfo.versionName); + if (mAppInfo != null) { + PackageInfo pkgCurrent = null; + try { + pkgCurrent = mPm.getPackageInfo(mAppInfo.packageName, PackageManager.GET_UNINSTALLED_PACKAGES); + if (pkgCurrent == null) { + ((TextView)layoutVersion.findViewById(R.id.app_current_version)).setText(R.string.not_available); + } + else + { + ((TextView)layoutVersion.findViewById(R.id.app_current_version)).setText(pkgCurrent.versionName); + } + } + catch (PackageManager.NameNotFoundException ex) { + ((TextView)layoutVersion.findViewById(R.id.app_current_version)).setText(R.string.not_available); } - tabHost.setVisibility(View.GONE); - mInstallFlowAnalytics.setAllPermissionsDisplayed(false); - mInstallFlowAnalytics.setNewPermissionsDisplayed(false); - findViewById(R.id.filler).setVisibility(View.VISIBLE); - findViewById(R.id.divider).setVisibility(View.GONE); - mScrollView = null; } + else { + ((TextView)layoutVersion.findViewById(R.id.app_current_version)).setText(R.string.not_available); + } + mScrollView = new CaffeinatedScrollView(this); + mScrollView.setFillViewport(true); + TextView label = (TextView)inflater.inflate(R.layout.label, null); + label.setText(R.string.no_perms); + mScrollView.addView(label); + adapter.addTab(tabHost.newTabSpec("all").setIndicator( + getText(R.string.allPerms)), mScrollView); + + mScrollView = new CaffeinatedScrollView(this); + mScrollView.setFillViewport(true); + if (mAppInfo != null) { + // This is an update to an application, but there are no + // permissions at all. + msg = (mAppInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0 + ? R.string.install_confirm_question_update_system_no_perms + : R.string.install_confirm_question_update_no_perms; + } else { + // This is a new application with no permissions. + msg = R.string.install_confirm_question_no_perms; + } + mInstallFlowAnalytics.setAllPermissionsDisplayed(false); + mInstallFlowAnalytics.setNewPermissionsDisplayed(false); + mScrollView.addView(layoutVersion); + adapter.addTab(tabHost.newTabSpec("version").setIndicator( + getText(R.string.appVersion)), mScrollView); if (msg != 0) { ((TextView)findViewById(R.id.install_confirm_question)).setText(msg); } diff --git a/src/com/android/packageinstaller/permission/ui/OverlayTouchActivity.java b/src/com/android/packageinstaller/permission/ui/OverlayTouchActivity.java index 7b1d3793a..0c6b4a87e 100644 --- a/src/com/android/packageinstaller/permission/ui/OverlayTouchActivity.java +++ b/src/com/android/packageinstaller/permission/ui/OverlayTouchActivity.java @@ -16,8 +16,11 @@ package com.android.packageinstaller.permission.ui; import android.app.Activity; +import android.content.ContentResolver; import android.content.Intent; +import android.provider.Settings; import android.view.MotionEvent; +import android.util.Log; public class OverlayTouchActivity extends Activity { @@ -29,8 +32,14 @@ public class OverlayTouchActivity extends Activity { @Override public boolean dispatchTouchEvent(MotionEvent event) { - mObscuredTouch = (event.getFlags() & (MotionEvent.FLAG_WINDOW_IS_OBSCURED + final boolean overlayCheckDisabled = Settings.Secure.getInt(getContentResolver(), + Settings.Secure.PACKAGE_INSTALL_OVERLAY_CHECK_DISABLED, 0) != 0; + if (overlayCheckDisabled) { + mObscuredTouch = false; + } else { + mObscuredTouch = (event.getFlags() & (MotionEvent.FLAG_WINDOW_IS_OBSCURED | MotionEvent.FLAG_WINDOW_IS_PARTIALLY_OBSCURED)) != 0; + } return super.dispatchTouchEvent(event); } |
