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

Commit 85e07ab8 authored by Xin Li's avatar Xin Li Committed by Gerrit Code Review
Browse files

Merge "DO NOT MERGE - Merge RP1A.201005.006"

parents 4d96662b e325f5b1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -559,6 +559,7 @@ void GraphicsStatsService::finishDumpInMemory(Dump* dump, AStatsEventList* data,
        AStatsEvent_writeBool(event, !lastFullDay);
        AStatsEvent_build(event);
    }
    delete dump;
}


+4 −2
Original line number Diff line number Diff line
@@ -205,7 +205,8 @@ public class ScreenshotNotificationsController {
        mPublicNotificationBuilder
                .setContentTitle(mResources.getString(R.string.screenshot_saved_title))
                .setContentText(mResources.getString(R.string.screenshot_saved_text))
                .setContentIntent(PendingIntent.getActivity(mContext, 0, launchIntent, 0))
                .setContentIntent(PendingIntent
                        .getActivity(mContext, 0, launchIntent, PendingIntent.FLAG_IMMUTABLE))
                .setWhen(now)
                .setAutoCancel(true)
                .setColor(mContext.getColor(
@@ -213,7 +214,8 @@ public class ScreenshotNotificationsController {
        mNotificationBuilder
                .setContentTitle(mResources.getString(R.string.screenshot_saved_title))
                .setContentText(mResources.getString(R.string.screenshot_saved_text))
                .setContentIntent(PendingIntent.getActivity(mContext, 0, launchIntent, 0))
                .setContentIntent(PendingIntent
                        .getActivity(mContext, 0, launchIntent, PendingIntent.FLAG_IMMUTABLE))
                .setWhen(now)
                .setAutoCancel(true)
                .setColor(mContext.getColor(
+6 −2
Original line number Diff line number Diff line
@@ -104,9 +104,13 @@ public class LeakReporter {
                    .setContentText(String.format(
                            "SystemUI has detected %d leaked objects. Tap to send", garbageCount))
                    .setSmallIcon(com.android.internal.R.drawable.stat_sys_adb)
                    .setContentIntent(PendingIntent.getActivityAsUser(mContext, 0,
                    .setContentIntent(PendingIntent.getActivityAsUser(
                            mContext,
                            0,
                            getIntent(hprofFile, dumpFile),
                            PendingIntent.FLAG_UPDATE_CURRENT, null, UserHandle.CURRENT));
                            PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE,
                            null,
                            UserHandle.CURRENT));
            notiMan.notify(TAG, 0, builder.build());
        } catch (IOException e) {
            Log.e(TAG, "Couldn't dump heap for leak", e);
+4 −0
Original line number Diff line number Diff line
@@ -3318,6 +3318,10 @@ public class ActivityManagerService extends IActivityManager.Stub
    @Override
    public boolean setProcessMemoryTrimLevel(String process, int userId, int level)
            throws RemoteException {
        if (!isCallerShell()) {
            EventLog.writeEvent(0x534e4554, 160390416, Binder.getCallingUid(), "");
            throw new SecurityException("Only shell can call it");
        }
        synchronized (this) {
            final ProcessRecord app = findProcessLocked(process, userId, "setProcessMemoryTrimLevel");
            if (app == null) {
+27 −0
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -173,6 +174,8 @@ public class PreferencesHelper implements RankingConfig {

    private boolean mAllowInvalidShortcuts = false;

    private Map<String, List<String>> mOemLockedApps = new HashMap();

    public PreferencesHelper(Context context, PackageManager pm, RankingHandler rankingHandler,
            ZenModeHelper zenHelper, NotificationChannelLogger notificationChannelLogger,
            AppOpsManager appOpsManager,
@@ -314,6 +317,12 @@ public class PreferencesHelper implements RankingConfig {
                                        }
                                        channel.setImportanceLockedByCriticalDeviceFunction(
                                                r.defaultAppLockedImportance);
                                        channel.setImportanceLockedByOEM(r.oemLockedImportance);
                                        if (!channel.isImportanceLockedByOEM()) {
                                            if (r.oemLockedChannels.contains(channel.getId())) {
                                                channel.setImportanceLockedByOEM(true);
                                            }
                                        }
                                        boolean isInvalidShortcutChannel =
                                                channel.getConversationId() != null &&
                                                        channel.getConversationId().contains(
@@ -396,6 +405,14 @@ public class PreferencesHelper implements RankingConfig {
            r.visibility = visibility;
            r.showBadge = showBadge;
            r.bubblePreference = bubblePreference;
            if (mOemLockedApps.containsKey(r.pkg)) {
                List<String> channels = mOemLockedApps.get(r.pkg);
                if (channels == null || channels.isEmpty()) {
                    r.oemLockedImportance = true;
                } else {
                    r.oemLockedChannels = channels;
                }
            }

            try {
                createDefaultChannelIfNeededLocked(r);
@@ -1149,8 +1166,10 @@ public class PreferencesHelper implements RankingConfig {
                    String channelId = appSplit.length == 2 ? appSplit[1] : null;

                    synchronized (mPackagePreferences) {
                        boolean foundApp = false;
                        for (PackagePreferences r : mPackagePreferences.values()) {
                            if (r.pkg.equals(appName)) {
                                foundApp = true;
                                if (channelId == null) {
                                    // lock all channels for the app
                                    r.oemLockedImportance = true;
@@ -1168,6 +1187,14 @@ public class PreferencesHelper implements RankingConfig {
                                }
                            }
                        }
                        if (!foundApp) {
                            List<String> channels =
                                    mOemLockedApps.getOrDefault(appName, new ArrayList<>());
                            if (channelId != null) {
                                channels.add(channelId);
                            }
                            mOemLockedApps.put(appName, channels);
                        }
                    }
                }
            }
Loading