Merge "Fix app crash if the selection is from reverse direction."
diff --git a/data/etc/Android.bp b/data/etc/Android.bp
index 0d12e1f..99b5a062 100644
--- a/data/etc/Android.bp
+++ b/data/etc/Android.bp
@@ -50,6 +50,14 @@
 }
 
 prebuilt_etc {
+    name: "privapp_whitelist_com.android.cellbroadcastreceiver",
+    system_ext_specific: true,
+    sub_dir: "permissions",
+    src: "com.android.cellbroadcastreceiver.xml",
+    filename_from_src: true,
+}
+
+prebuilt_etc {
     name: "privapp_whitelist_com.android.contacts",
     product_specific: true,
     sub_dir: "permissions",
diff --git a/data/etc/com.android.cellbroadcastreceiver.xml b/data/etc/com.android.cellbroadcastreceiver.xml
new file mode 100644
index 0000000..dd2df42
--- /dev/null
+++ b/data/etc/com.android.cellbroadcastreceiver.xml
@@ -0,0 +1,26 @@
+<?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
+  -->
+<permissions>
+    <privapp-permissions package="com.android.cellbroadcastreceiver">
+        <permission name="android.permission.INTERACT_ACROSS_USERS"/>
+        <permission name="android.permission.MANAGE_USERS"/>
+        <permission name="android.permission.MODIFY_PHONE_STATE"/>
+        <permission name="android.permission.READ_PRIVILEGED_PHONE_STATE"/>
+        <permission name="android.permission.RECEIVE_EMERGENCY_BROADCAST"/>
+        <permission name="android.permission.START_ACTIVITIES_FROM_BACKGROUND"/>
+    </privapp-permissions>
+</permissions>
diff --git a/rs/jni/Android.mk b/rs/jni/Android.mk
index 0854b95..def67ce 100644
--- a/rs/jni/Android.mk
+++ b/rs/jni/Android.mk
@@ -19,10 +19,10 @@
     libjnigraphics
 
 LOCAL_HEADER_LIBRARIES := \
+    jni_headers \
     libbase_headers
 
 LOCAL_C_INCLUDES += \
-    $(JNI_H_INCLUDE) \
     frameworks/rs
 
 LOCAL_CFLAGS += -Wno-unused-parameter
diff --git a/tests/DynamicCodeLoggerIntegrationTests/Android.mk b/tests/DynamicCodeLoggerIntegrationTests/Android.mk
index 62c1ba8..2d58ce8 100644
--- a/tests/DynamicCodeLoggerIntegrationTests/Android.mk
+++ b/tests/DynamicCodeLoggerIntegrationTests/Android.mk
@@ -36,8 +36,7 @@
 LOCAL_MODULE_TAGS := tests
 LOCAL_MODULE := DynamicCodeLoggerNativeTestLibrary
 LOCAL_SRC_FILES := src/cpp/com_android_dcl_Jni.cpp
-LOCAL_C_INCLUDES += \
-    $(JNI_H_INCLUDE)
+LOCAL_HEADER_LIBRARIES := jni_headers
 LOCAL_SDK_VERSION := 28
 LOCAL_NDK_STL_VARIANT := c++_static