summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorRobin Lee <rgl@google.com>2020-07-02 15:32:40 +0200
committerRobin Lee <rgl@google.com>2020-07-06 23:39:41 +0200
commit0439854b50d0e8d00f11b2c814bfbf0acf70f79d (patch)
treea1ea41fab4e3927d8c78a3817e528dc35b835d36 /res
parent6cb5fcd74bcee9e377c9e5d416d8e994ceb3e2a3 (diff)
downloadPackageInstaller-0439854b50d0e8d00f11b2c814bfbf0acf70f79d.tar.gz
Fix two common NPEs, remove TV radio widget layout
TV layout: - Removed because the code specifically depends on a certain layout ID which was not in sync with the handheld layout ID. The custom layout wasn't adding any value anyway. NPE 1 (ManagePermissionsFragment): - Using the wrong context in ManagePermissionsFragment. We get the right context and explicitly null-check it, but one line in the update function was going and getting its own context from somewhere else and this could be null. NPE 2 (FooterPreference): - TV currently reuses handheld code. The reason this code runs into a NullPointerException on ATV and not mobile currently is that one uses a DeviceDefault theme and the other does not. Interestingly, the resource ID for the icon_frame ViewGroup is different depending on where the theme comes from! This is fixed in other classes in PermissionController already. See this commit in AndroidX from 2015 for an example (unfortunately original bug isn't documented): https://android.googlesource.com/platform/frameworks/support/+/3fadd62b614e4a69aefe920aac640bdb629e502e%5E%21/v7/preference/src/android/support/v7/preference/Preference.java Fix: 160262096 Test: atest AutoRevokeTest # 5 tests, 4 pass, 1 fail (ki) Test: atest CtsRoleTestCases # 55 tests, 43 pass, 12 skipped Change-Id: Ia579144f308076804642728dcc1e103f4b645e7b
Diffstat (limited to 'res')
-rw-r--r--res/layout-television/radio_button_preference_widget.xml25
1 files changed, 0 insertions, 25 deletions
diff --git a/res/layout-television/radio_button_preference_widget.xml b/res/layout-television/radio_button_preference_widget.xml
deleted file mode 100644
index 38bcc9f56..000000000
--- a/res/layout-television/radio_button_preference_widget.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- ~ Copyright (C) 2020 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.
- -->
-
-<RadioButton xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@android:id/checkbox"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:focusable="false"
- android:clickable="false" />