[automerger skipped] Import translations. DO NOT MERGE ANYWHERE am: 6155f354a1 -s ours

am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/StorageManager/+/15586159

Change-Id: I9535cd12bb3c5d892ee10b391a56cd434f62156c
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..ddeff9f
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,44 @@
+// Copyright (C) 2016 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.
+
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+android_app {
+    name: "StorageManager",
+    defaults: ["SettingsLibDefaults"],
+    platform_apis: true,
+
+    optimize: {
+        proguard_flags_files: ["proguard.cfg"],
+    },
+
+    system_ext_specific: true,
+    privileged: true,
+    required: ["privapp_whitelist_com.android.storagemanager"],
+
+    static_libs: [
+        "androidx.legacy_legacy-preference-v14",
+        "androidx.appcompat_appcompat",
+        "androidx.preference_preference",
+        "androidx.recyclerview_recyclerview",
+    ],
+
+    uses_libs: ["org.apache.http.legacy"],
+
+    resource_dirs: ["res"],
+
+    srcs: ["src/**/*.java"],
+}
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index ac5525f..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright (C) 2016 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.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_PACKAGE_NAME := StorageManager
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_MODULE_TAGS := optional
-LOCAL_PROGUARD_FLAG_FILES := proguard.cfg
-
-LOCAL_SYSTEM_EXT_MODULE := true
-LOCAL_PRIVILEGED_MODULE := true
-LOCAL_REQUIRED_MODULES := privapp_whitelist_com.android.storagemanager
-
-LOCAL_STATIC_ANDROID_LIBRARIES := \
-      androidx.legacy_legacy-preference-v14 \
-      androidx.appcompat_appcompat \
-      androidx.preference_preference \
-      androidx.recyclerview_recyclerview
-
-LOCAL_USE_AAPT2 := true
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
-
-LOCAL_SRC_FILES := \
-    $(call all-java-files-under, src)
-
-include frameworks/base/packages/SettingsLib/common.mk
-
-include $(BUILD_PACKAGE)
-
-# Use the following include to make our test apk.
-ifeq (,$(ONE_SHOT_MAKEFILE))
-include $(call all-makefiles-under,$(LOCAL_PATH))
-endif
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 0460fad..1b21545 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -16,7 +16,7 @@
 -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.android.storagemanager">
+     package="com.android.storagemanager">
 
     <uses-permission android:name="android.permission.PACKAGE_USAGE_STATS"/>
     <uses-permission android:name="android.permission.GET_PACKAGE_SIZE"/>
@@ -29,58 +29,60 @@
     <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS"/>
     <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
     <uses-permission android:name="android.permission.USE_RESERVED_DISK"/>
+    <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
 
-    <uses-sdk android:minSdkVersion="24" />
+    <uses-sdk android:minSdkVersion="24"/>
 
     <application android:label="@string/app_name"
-        android:icon="@mipmap/ic_storage_manager_48px"
-        android:theme="@style/StorageManager"
-        android:allowBackup="false"
-        android:supportsRtl="true">
-        <uses-library android:name="org.apache.http.legacy" />
+         android:icon="@mipmap/ic_storage_manager_48px"
+         android:theme="@style/StorageManager"
+         android:allowBackup="false"
+         android:supportsRtl="true">
+        <uses-library android:name="org.apache.http.legacy"/>
         <!--  Initial Page -->
         <activity android:name=".deletionhelper.DeletionHelperActivity"
-                  android:label="@string/deletion_helper_title"
-                  android:launchMode="singleTask">
+             android:label="@string/deletion_helper_title"
+             android:launchMode="singleTask"
+             android:exported="true">
             <intent-filter>
-                <action android:name="android.os.storage.action.MANAGE_STORAGE" />
-                <category android:name="android.intent.category.DEFAULT" />
+                <action android:name="android.os.storage.action.MANAGE_STORAGE"/>
+                <category android:name="android.intent.category.DEFAULT"/>
             </intent-filter>
         </activity>
 
         <!-- Warning for activating the storage manager. -->
         <activity android:name=".automatic.WarningDialogActivity"
-                  android:excludeFromRecents="true"
-                  android:label=""
-                  android:noHistory="true"
-                  android:taskAffinity=".WarningDialogActivity"
-                  android:theme="@style/TransparentDialog">
+             android:excludeFromRecents="true"
+             android:label=""
+             android:noHistory="true"
+             android:taskAffinity=".WarningDialogActivity"
+             android:theme="@style/TransparentDialog">
         </activity>
 
         <!-- Automatic storage management tasks. -->
-        <service
-            android:name=".automatic.AutomaticStorageManagementJobService"
-            android:label="@string/automatic_storage_manager_service_label"
-            android:permission="android.permission.BIND_JOB_SERVICE"
-            android:enabled="@bool/enable_automatic_storage_management"
-            android:exported="false"/>
+        <service android:name=".automatic.AutomaticStorageManagementJobService"
+             android:label="@string/automatic_storage_manager_service_label"
+             android:permission="android.permission.BIND_JOB_SERVICE"
+             android:enabled="@bool/enable_automatic_storage_management"
+             android:exported="false"/>
 
         <receiver android:name=".automatic.AutomaticStorageBroadcastReceiver"
-                  android:enabled="@bool/enable_automatic_storage_management">
+             android:enabled="@bool/enable_automatic_storage_management"
+             android:exported="true">
             <intent-filter>
-                <action android:name="android.intent.action.BOOT_COMPLETED" />
+                <action android:name="android.intent.action.BOOT_COMPLETED"/>
             </intent-filter>
         </receiver>
 
         <receiver android:name=".automatic.NotificationController"
-            android:exported="false">
+             android:exported="false">
             <intent-filter>
-                <action android:name="com.android.storagemanager.automatic.DISMISS" />
-                <action android:name="com.android.storagemanager.automatic.ACTIVATE" />
-                <action android:name="com.android.storagemanager.automatic.NO_THANKS" />
-                <action android:name="com.android.storagemanager.automatic.SHOW_NOTIFICATION" />
-                <action android:name="com.android.storagemanager.automatic.DEBUG_SHOW_NOTIFICATION" />
-                <action android:name="com.android.storagemanager.automatic.SHOW_SETTINGS" />
+                <action android:name="com.android.storagemanager.automatic.DISMISS"/>
+                <action android:name="com.android.storagemanager.automatic.ACTIVATE"/>
+                <action android:name="com.android.storagemanager.automatic.NO_THANKS"/>
+                <action android:name="com.android.storagemanager.automatic.SHOW_NOTIFICATION"/>
+                <action android:name="com.android.storagemanager.automatic.DEBUG_SHOW_NOTIFICATION"/>
+                <action android:name="com.android.storagemanager.automatic.SHOW_SETTINGS"/>
             </intent-filter>
         </receiver>
 
diff --git a/res/values-ta/strings.xml b/res/values-ta/strings.xml
index 2394e73..3ba43a0 100644
--- a/res/values-ta/strings.xml
+++ b/res/values-ta/strings.xml
@@ -62,6 +62,6 @@
     <string name="automatic_storage_manager_activation_warning" msgid="7657017408180001078">"உங்கள் சேமிப்பகம் இப்போது சேமிப்பக நிர்வாகியால் நிர்வகிக்கப்படுகிறது"</string>
     <string name="empty_state_title" msgid="4033285438176545309">"அகற்ற எதுவுமில்லை"</string>
     <string name="empty_state_review_items_link" msgid="8411186441239304545">"சமீபத்தியவற்றைப் பார்க்கவும்"</string>
-    <string name="empty_state_summary" msgid="8439893007424243790">"பழைய ஃபைல்கள்  எதுவுமில்லை. இடத்தை உருவாக்க, சமீபத்திய படங்கள், வீடியோக்கள், ஆப்ஸ் ஆகியவற்றை அகற்றவும்."</string>
+    <string name="empty_state_summary" msgid="8439893007424243790">"பழைய கோப்புகள் எதுவுமில்லை. இடத்தை உருவாக்க, சமீபத்திய படங்கள், வீடியோக்கள், ஆப்ஸ் ஆகியவற்றை அகற்றவும்."</string>
     <string name="app_requesting_space" msgid="857425181289960167">"<xliff:g id="APP">%1$s</xliff:g>க்கு <xliff:g id="CLEARABLE_BYTES">%2$s</xliff:g> சேமிப்பிடம் தேவை"</string>
 </resources>
diff --git a/res/values-te/strings.xml b/res/values-te/strings.xml
index 9cb3f36..e5710c3 100644
--- a/res/values-te/strings.xml
+++ b/res/values-te/strings.xml
@@ -48,7 +48,7 @@
     <string name="deletion_helper_automatic_title" msgid="4610119358490679299">"ఆటోమేటిక్"</string>
     <string name="deletion_helper_manual_title" msgid="3905192395039688529">"మాన్యువల్"</string>
     <string name="deletion_helper_preference_title" msgid="803484286872745892">"ఇప్పుడు స్థలాన్ని ఖాళీ చేయి"</string>
-    <string name="automatic_storage_manager_service_label" msgid="648592272375278978">"ఆటోమేటిక్‌ నిల్వ నిర్వహణ సేవ"</string>
+    <string name="automatic_storage_manager_service_label" msgid="648592272375278978">"స్వయంచాలక నిల్వ నిర్వహణ సేవ"</string>
     <string name="automatic_storage_manager_notification_title" product="default" msgid="8480483265300964701">"మీ ఫోన్‌లో తక్కువ నిల్వ స్థలం ఉంది"</string>
     <string name="automatic_storage_manager_notification_title" product="tablet" msgid="3150907918531844467">"మీ టాబ్లెట్‌లో ఖాళీ స్థలం తక్కువగా ఉంది"</string>
     <string name="automatic_storage_manager_notification_summary" msgid="2267399886362245822">"మీ ఫోన్ నిల్వ మళ్లీ నిండిపోతున్నప్పుడు పాత ఫోటోలు మరియు వీడియోలను ఆటోమేటిక్‌గా తీసివేయడం ద్వారా స్థలాన్ని ఖాళీ చేయడానికి నిల్వ నిర్వాహికిని అనుమతించండి."</string>
diff --git a/robotests/Android.bp b/robotests/Android.bp
new file mode 100644
index 0000000..c6ea51f
--- /dev/null
+++ b/robotests/Android.bp
@@ -0,0 +1,28 @@
+//############################################################
+// StorageManager Robolectric test target.                   #
+//############################################################
+
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+android_robolectric_test {
+    name: "StorageManagerRoboTests",
+
+    srcs: ["src/**/*.java"],
+
+    java_resource_dirs: ["config"],
+
+    libs: [
+        "robolectric_android-all-stub",
+        "Robolectric_all-target",
+        "mockito-robolectric-prebuilt",
+        "truth-prebuilt",
+    ],
+
+    instrumentation_for: "StorageManager",
+
+    test_options: {
+        timeout: 36000,
+    },
+}
diff --git a/robotests/Android.mk b/robotests/Android.mk
deleted file mode 100644
index dbc010d..0000000
--- a/robotests/Android.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#############################################################
-# StorageManager Robolectric test target.                   #
-#############################################################
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := StorageManagerRoboTests
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_JAVA_RESOURCE_DIRS := config
-
-LOCAL_JAVA_LIBRARIES := \
-    robolectric_android-all-stub \
-    Robolectric_all-target \
-    mockito-robolectric-prebuilt \
-    truth-prebuilt
-
-LOCAL_INSTRUMENTATION_FOR := StorageManager
-
-LOCAL_MODULE_TAGS := optional
-
-# Generate test_config.properties
-include external/robolectric-shadows/gen_test_config.mk
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
-
-#############################################################
-# StorageManager runner target to run the previous target.  #
-#############################################################
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := RunStorageManagerRoboTests
-
-LOCAL_JAVA_LIBRARIES := \
-    StorageManagerRoboTests \
-    robolectric_android-all-stub \
-    Robolectric_all-target \
-    mockito-robolectric-prebuilt \
-    truth-prebuilt
-
-LOCAL_TEST_PACKAGE := StorageManager
-
-LOCAL_ROBOTEST_TIMEOUT := 36000
-
-include external/robolectric-shadows/run_robotests.mk
diff --git a/src/com/android/storagemanager/automatic/NotificationController.java b/src/com/android/storagemanager/automatic/NotificationController.java
index e596a75..2cb7c8c 100644
--- a/src/com/android/storagemanager/automatic/NotificationController.java
+++ b/src/com/android/storagemanager/automatic/NotificationController.java
@@ -177,7 +177,7 @@
         Notification.Action.Builder cancelAction = new Notification.Action.Builder(null,
                 res.getString(R.string.automatic_storage_manager_cancel_button),
                 PendingIntent.getBroadcast(context, 0, noThanksIntent,
-                        PendingIntent.FLAG_UPDATE_CURRENT));
+                        PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE));
 
 
         Intent activateIntent = getBaseIntent(context, INTENT_ACTION_ACTIVATE_ASM);
@@ -185,18 +185,18 @@
         Notification.Action.Builder activateAutomaticAction = new Notification.Action.Builder(null,
                 res.getString(R.string.automatic_storage_manager_activate_button),
                 PendingIntent.getBroadcast(context, 0, activateIntent,
-                        PendingIntent.FLAG_UPDATE_CURRENT));
+                        PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE));
 
         Intent dismissIntent = getBaseIntent(context, INTENT_ACTION_DISMISS);
         dismissIntent.putExtra(INTENT_EXTRA_ID, NOTIFICATION_ID);
         PendingIntent deleteIntent = PendingIntent.getBroadcast(context, 0,
                 dismissIntent,
-                PendingIntent.FLAG_ONE_SHOT);
+                PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE);
 
         Intent contentIntent = getBaseIntent(context, INTENT_ACTION_TAP);
         contentIntent.putExtra(INTENT_EXTRA_ID, NOTIFICATION_ID);
         PendingIntent tapIntent = PendingIntent.getBroadcast(context, 0,  contentIntent,
-                PendingIntent.FLAG_ONE_SHOT);
+                PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE);
 
         Notification.Builder builder;
         // We really should only have the path with the notification channel set. The other path is
diff --git a/tests/Android.mk b/tests/Android.mk
deleted file mode 100644
index fd297e3..0000000
--- a/tests/Android.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-# Include all makefiles in subdirectories
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/app/Android.bp b/tests/app/Android.bp
new file mode 100644
index 0000000..334124f
--- /dev/null
+++ b/tests/app/Android.bp
@@ -0,0 +1,25 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+android_test {
+    name: "StorageManagerAppTests",
+
+    libs: ["android.test.runner"],
+
+    static_libs: [
+        "androidx.test.rules",
+        "mockito-target",
+        "androidx.test.espresso.core",
+        "androidx.test.espresso.contrib-nodeps",
+        "androidx.test.espresso.intents-nodeps",
+        "truth-prebuilt",
+    ],
+
+    // Include all test java files.
+    srcs: ["src/**/*.java"],
+
+    platform_apis: true,
+
+    instrumentation_for: "StorageManager",
+}
diff --git a/tests/app/Android.mk b/tests/app/Android.mk
deleted file mode 100644
index 8b0133c..0000000
--- a/tests/app/Android.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-# We only want this apk build for tests.
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_JAVA_LIBRARIES := android.test.runner
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    mockito-target \
-    androidx.test.espresso.core \
-   androidx.test.espresso.contrib-nodeps \
-   androidx.test.espresso.intents-nodeps \
-    truth-prebuilt
-
-# Include all test java files.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := StorageManagerAppTests
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_INSTRUMENTATION_FOR := StorageManager
-
-include $(BUILD_PACKAGE)
diff --git a/tests/unit/Android.bp b/tests/unit/Android.bp
new file mode 100644
index 0000000..d32057c
--- /dev/null
+++ b/tests/unit/Android.bp
@@ -0,0 +1,25 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+android_test {
+    name: "StorageManagerUnitTests",
+
+    libs: [
+        "android.test.runner",
+        "android.test.base",
+        "android.test.mock",
+    ],
+
+    static_libs: [
+        "androidx.test.rules",
+        "mockito-target",
+    ],
+
+    // Include all test java files.
+    srcs: ["src/**/*.java"],
+
+    platform_apis: true,
+
+    instrumentation_for: "StorageManager",
+}
diff --git a/tests/unit/Android.mk b/tests/unit/Android.mk
deleted file mode 100644
index 45892a4..0000000
--- a/tests/unit/Android.mk
+++ /dev/null
@@ -1,21 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-# We only want this apk build for tests.
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base android.test.mock
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    androidx.test.rules \
-    mockito-target
-
-# Include all test java files.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := StorageManagerUnitTests
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-LOCAL_INSTRUMENTATION_FOR := StorageManager
-
-include $(BUILD_PACKAGE)