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

Commit 2ff49276 authored by Presubmit Automerger Backend's avatar Presubmit Automerger Backend
Browse files

[automerge] Allow registered call notifications to always appear 2p: 20a47d5e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17642059

Change-Id: I6b848bfa2d9974886abd741dce4e6d373ad1639d
parents bf482b76 20a47d5e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ interface INotificationManager
    @UnsupportedAppUsage
    void cancelNotificationWithTag(String pkg, String opPkg, String tag, int id, int userId);

    boolean isInCall(String pkg, int uid);
    void setShowBadge(String pkg, int uid, boolean showBadge);
    boolean canShowBadge(String pkg, int uid);
    boolean hasSentValidMsg(String pkg, int uid);
+1 −0
Original line number Diff line number Diff line
@@ -224,6 +224,7 @@
    <uses-permission android:name="android.permission.MANAGE_NOTIFICATIONS" />
    <uses-permission android:name="android.permission.GET_RUNTIME_PERMISSIONS" />
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
    <uses-permission android:name="android.permission.MANAGE_ROLE_HOLDERS" />

    <!-- It's like, reality, but, you know, virtual -->
    <uses-permission android:name="android.permission.ACCESS_VR_MANAGER" />
+9 −0
Original line number Diff line number Diff line
@@ -135,6 +135,15 @@ asked for it -->
            android:layout_height="wrap_content"
            style="@*android:style/TextAppearance.DeviceDefault.Notification" />

        <!-- Non configurable app/channel text. appears instead of @+id/interruptiveness_settings-->
        <TextView
            android:id="@+id/non_configurable_call_text"
            android:text="@string/notification_unblockable_call_desc"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            style="@*android:style/TextAppearance.DeviceDefault.Notification" />

        <!-- Non configurable multichannel text. appears instead of @+id/interruptiveness_settings-->
        <TextView
            android:id="@+id/non_configurable_multichannel_text"
+3 −0
Original line number Diff line number Diff line
@@ -1373,6 +1373,9 @@
    <!-- Notification: Control panel: Label that displays when the app's notifications cannot be blocked. -->
    <string name="notification_unblockable_desc">These notifications can\'t be modified.</string>

    <!-- Notification: Control panel: Label that displays when a notification cannot be blocked because it's attached to a phone/voip call. -->
    <string name="notification_unblockable_call_desc">Call notifications can\'t be modified.</string>

    <!-- Notification: Control panel: label that displays when viewing settings for a group of notifications posted to multiple channels. -->
    <string name="notification_multichannel_desc">This group of notifications cannot be configured here</string>

+13 −2
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.annotation.Nullable;
import android.app.INotificationManager;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.role.RoleManager;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
@@ -380,12 +381,22 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
                Settings.Secure.NOTIFICATION_PERMISSION_ENABLED, 0, USER_SYSTEM) == 1) {
            INotificationManager iNm = INotificationManager.Stub.asInterface(
                    ServiceManager.getService(Context.NOTIFICATION_SERVICE));

            boolean isSystem = false;
            try {
                return iNm.isPermissionFixed(sbn.getPackageName(), sbn.getUserId());
                isSystem = iNm.isPermissionFixed(sbn.getPackageName(), sbn.getUserId());
            } catch (RemoteException e) {
                Log.e(TAG, "cannot reach NMS");
            }
            return false;
            RoleManager rm = context.getSystemService(RoleManager.class);
            List<String> fixedRoleHolders = new ArrayList<>();
            fixedRoleHolders.addAll(rm.getRoleHolders(RoleManager.ROLE_DIALER));
            fixedRoleHolders.addAll(rm.getRoleHolders(RoleManager.ROLE_EMERGENCY));
            if (fixedRoleHolders.contains(sbn.getPackageName())) {
                isSystem = true;
            }

            return isSystem;
        } else {
            PackageManager packageManager = CentralSurfaces.getPackageManagerForUser(
                    context, sbn.getUser().getIdentifier());
Loading