[automerger skipped] Import translations. DO NOT MERGE ANYWHERE am: 1d3da1daf1 -s ours am: 1818949364 -s ours
am skip reason: subject contains skip directive
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Stk/+/24916835
Change-Id: Ifbee63b016c4c6cc80606e768204ae9f3d01b741
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 348e798..d8aff68 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -130,6 +130,12 @@
</intent-filter>
</receiver>
+ <receiver android:name="com.android.stk.UserPresentReceiver"
+ android:exported="true">
+ <intent-filter>
+ <action android:name="android.intent.action.USER_PRESENT" />
+ </intent-filter>
+ </receiver>
<service android:name="StkAppService" />
</application>
diff --git a/res/values-eu/strings.xml b/res/values-eu/strings.xml
index e791e6d..da8762c 100644
--- a/res/values-eu/strings.xml
+++ b/res/values-eu/strings.xml
@@ -41,6 +41,6 @@
<string name="default_close_channel_msg" msgid="6320648502339362951">"Kanala itxita dago"</string>
<string name="stk_dialog_accept" msgid="2899431442032305374">"BAI"</string>
<string name="stk_dialog_reject" msgid="1455086565615694879">"EZ"</string>
- <string name="no_sim_card_inserted" msgid="3177955793136053581">"Sartu SIM txartela SIM tresnak abiarazteko."</string>
+ <string name="no_sim_card_inserted" msgid="3177955793136053581">"Sartu SIMa SIM tresnak exekutatzeko."</string>
<string name="stk_channel_name" msgid="3945765236566954372">"Zerbitzu mugikorraren mezuak"</string>
</resources>
diff --git a/res/values-in/strings.xml b/res/values-in/strings.xml
index a3c33bc..3738f0b 100644
--- a/res/values-in/strings.xml
+++ b/res/values-in/strings.xml
@@ -32,7 +32,7 @@
<string name="default_setup_call_msg" msgid="5819132588246209714">"Panggilan yang sedang disiapkan"</string>
<string name="stk_app_state" msgid="6274976677198791616">"Status aplikasi"</string>
<string name="enable_app" msgid="1980493713217690903">"Diaktifkan"</string>
- <string name="disable_app" msgid="2298201833946002357">"Dinonaktifkan"</string>
+ <string name="disable_app" msgid="2298201833946002357">"Nonaktif"</string>
<string name="stk_dialog_title" msgid="1047336800509270520">"SIM ToolKit"</string>
<string name="default_tone_dialog_msg" msgid="8354658178971283852">"Memutar Nada"</string>
<string name="default_open_channel_msg" msgid="2043011408855389673">"Buka Saluran?"</string>
diff --git a/res/values-ne/strings.xml b/res/values-ne/strings.xml
index 4b0be8d..d4a47da 100644
--- a/res/values-ne/strings.xml
+++ b/res/values-ne/strings.xml
@@ -42,5 +42,5 @@
<string name="stk_dialog_accept" msgid="2899431442032305374">"हो"</string>
<string name="stk_dialog_reject" msgid="1455086565615694879">"होइन"</string>
<string name="no_sim_card_inserted" msgid="3177955793136053581">"SIM टुलकिट लञ्च गर्न कृपया SIM घुसाउनुहोस्।"</string>
- <string name="stk_channel_name" msgid="3945765236566954372">"मोबाइल सेवाका सन्देशहरू"</string>
+ <string name="stk_channel_name" msgid="3945765236566954372">"मोबाइल सेवाका म्यासेजहरू"</string>
</resources>
diff --git a/res/values-or/strings.xml b/res/values-or/strings.xml
index 9a5e748..a43640b 100644
--- a/res/values-or/strings.xml
+++ b/res/values-or/strings.xml
@@ -22,7 +22,7 @@
<string name="menu_back" msgid="7136697148453089659">"ପଛକୁ"</string>
<string name="service_name" msgid="6767598098497885828">"ସେବାର ନାମ"</string>
<string name="stk_no_service" msgid="1905632157498220090">"କୌଣସି ସେବା ଉପଲବ୍ଧ ନାହିଁ"</string>
- <string name="button_ok" msgid="7914432227722142434">"ଠିକ୍ ଅଛି"</string>
+ <string name="button_ok" msgid="7914432227722142434">"ଠିକ ଅଛି"</string>
<string name="button_cancel" msgid="137404731092374681">"ବାତିଲ କରନ୍ତୁ"</string>
<string name="button_yes" msgid="755426085739326674">"ହଁ"</string>
<string name="button_no" msgid="564962410861983724">"ନା"</string>
diff --git a/res/values-uz/strings.xml b/res/values-uz/strings.xml
index 17fd2c9..bbabc14 100644
--- a/res/values-uz/strings.xml
+++ b/res/values-uz/strings.xml
@@ -32,7 +32,7 @@
<string name="default_setup_call_msg" msgid="5819132588246209714">"Qo‘ng‘iroq sozlanmoqda"</string>
<string name="stk_app_state" msgid="6274976677198791616">"Ilova holati"</string>
<string name="enable_app" msgid="1980493713217690903">"Yoniq"</string>
- <string name="disable_app" msgid="2298201833946002357">"Yoqilmagan"</string>
+ <string name="disable_app" msgid="2298201833946002357">"Oʻchiq"</string>
<string name="stk_dialog_title" msgid="1047336800509270520">"SIM menyusi"</string>
<string name="default_tone_dialog_msg" msgid="8354658178971283852">"Signal ijrosi"</string>
<string name="default_open_channel_msg" msgid="2043011408855389673">"Kanal ochilsinmi?"</string>
diff --git a/src/com/android/stk/StkAppService.java b/src/com/android/stk/StkAppService.java
index 52b06fb..4d26fa6 100644
--- a/src/com/android/stk/StkAppService.java
+++ b/src/com/android/stk/StkAppService.java
@@ -74,7 +74,6 @@
import com.android.internal.telephony.GsmAlphabet;
import com.android.internal.telephony.ITelephony;
import com.android.internal.telephony.PhoneConfigurationManager;
-import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.TelephonyIntents;
import com.android.internal.telephony.cat.AppInterface;
import com.android.internal.telephony.cat.CatCmdMessage;
@@ -300,6 +299,7 @@
private static final String SYSTEM_DIALOG_REASON_HOME_KEY = "homekey";
private static final String SYSTEM_DIALOG_REASON_RECENTAPPS_KEY = "recentapps";
private BroadcastReceiver mHomeKeyEventReceiver = null;
+ private static final int NOTIFICATION_PENDING_INTENT_REQUEST_CODE = 0;
@Override
public void onCreate() {
@@ -1690,47 +1690,26 @@
builder.setOnlyAlertOnce(true);
builder.setColor(getResources().getColor(
com.android.internal.R.color.system_notification_accent_color));
-
- registerUserPresentReceiver();
+ Intent userPresentIntent = new Intent(mContext, UserPresentReceiver.class);
+ userPresentIntent.setAction(Intent.ACTION_USER_PRESENT);
+ PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext,
+ NOTIFICATION_PENDING_INTENT_REQUEST_CODE, userPresentIntent,
+ PendingIntent.FLAG_IMMUTABLE);
+ builder.setContentIntent(pendingIntent);
mNotificationManager.notify(getNotificationId(NOTIFICATION_ON_KEYGUARD, slotId),
builder.build());
mStkContext[slotId].mNotificationOnKeyguard = true;
}
+ public void cancelNotificationOnKeyguard() {
+ for (int slot = 0; slot < mSimCount; slot++) {
+ cancelNotificationOnKeyguard(slot);
+ }
+ }
+
private void cancelNotificationOnKeyguard(int slotId) {
mNotificationManager.cancel(getNotificationId(NOTIFICATION_ON_KEYGUARD, slotId));
mStkContext[slotId].mNotificationOnKeyguard = false;
- unregisterUserPresentReceiver(slotId);
- }
-
- private synchronized void registerUserPresentReceiver() {
- if (mUserPresentReceiver == null) {
- mUserPresentReceiver = new BroadcastReceiver() {
- @Override public void onReceive(Context context, Intent intent) {
- if (Intent.ACTION_USER_PRESENT.equals(intent.getAction())) {
- for (int slot = 0; slot < mSimCount; slot++) {
- cancelNotificationOnKeyguard(slot);
- }
- }
- }
- };
- registerReceiver(mUserPresentReceiver, new IntentFilter(Intent.ACTION_USER_PRESENT));
- }
- }
-
- private synchronized void unregisterUserPresentReceiver(int slotId) {
- if (mUserPresentReceiver != null) {
- for (int slot = 0; slot < mSimCount; slot++) {
- if (slot != slotId) {
- if (mStkContext[slot].mNotificationOnKeyguard) {
- // The broadcast receiver is still necessary for other SIM card.
- return;
- }
- }
- }
- unregisterReceiver(mUserPresentReceiver);
- mUserPresentReceiver = null;
- }
}
private int getNotificationId(int notificationType, int slotId) {
diff --git a/src/com/android/stk/UserPresentReceiver.java b/src/com/android/stk/UserPresentReceiver.java
new file mode 100644
index 0000000..25c945c
--- /dev/null
+++ b/src/com/android/stk/UserPresentReceiver.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2023 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 com.android.stk;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import com.android.internal.telephony.cat.CatLog;
+
+public class UserPresentReceiver extends BroadcastReceiver {
+
+ private static final String LOG_TAG = UserPresentReceiver.class.getSimpleName();
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (Intent.ACTION_USER_PRESENT.equals(intent.getAction())) {
+ CatLog.d(LOG_TAG, "Broadcast received and clearing the notification");
+ StkAppService.getInstance().cancelNotificationOnKeyguard();
+ }
+ }
+}