Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a70c5a8 authored by Anil Admal's avatar Anil Admal Committed by android-build-merger
Browse files

Merge "Emergency location notification text must be in the correct language" into qt-dev

am: 1c60a7c7

Change-Id: I368b0e0d9d4000c3ffb37db148dd934f35d7cda8
parents 38466fd8 1c60a7c7
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -78,7 +78,6 @@ class GnssVisibilityControl {
    private final Handler mHandler;
    private final Context mContext;
    private final GpsNetInitiatedHandler mNiHandler;
    private final Notification mEmergencyLocationUserNotification;

    private boolean mIsGpsEnabled;

@@ -107,7 +106,6 @@ class GnssVisibilityControl {
        mNiHandler = niHandler;
        mAppOps = mContext.getSystemService(AppOpsManager.class);
        mPackageManager = mContext.getPackageManager();
        mEmergencyLocationUserNotification = createEmergencyLocationUserNotification(mContext);

        // Complete initialization as the first event to run in mHandler thread. After that,
        // all object state read/update events run in the mHandler thread.
@@ -632,13 +630,15 @@ class GnssVisibilityControl {
        }

        notificationManager.notifyAsUser(/* tag= */ null, /* notificationId= */ 0,
                mEmergencyLocationUserNotification, UserHandle.ALL);
                createEmergencyLocationUserNotification(mContext), UserHandle.ALL);
    }

    private static Notification createEmergencyLocationUserNotification(Context context) {
        String firstLineText = context.getString(R.string.gpsNotifTitle);
        String secondLineText =  context.getString(R.string.global_action_emergency);
        String accessibilityServicesText = firstLineText + " (" + secondLineText + ")";
        // NOTE: Do not reuse the returned notification object as it will not reflect
        //       changes to notification text when the system language is changed.
        final String firstLineText = context.getString(R.string.gpsNotifTitle);
        final String secondLineText =  context.getString(R.string.global_action_emergency);
        final String accessibilityServicesText = firstLineText + " (" + secondLineText + ")";
        return new Notification.Builder(context, SystemNotificationChannels.NETWORK_ALERTS)
                .setSmallIcon(com.android.internal.R.drawable.stat_sys_gps_on)
                .setWhen(0)