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

Commit 588dab62 authored by yumeng's avatar yumeng Committed by Gerrit - the friendly Code Review server
Browse files

Settings: Occurred "com.android.settings" force close 15 times at

java.lang.IllegalArgumentException: cannot apply policy to UID
1001000 at monkey test mode.

add pretection for monkey test mode.

Change-Id: Ib6a76d44b8f46e2f4cfc1bf57ece0438c5bcdb5b
CRs-Fixed: 1051409
parent 0dec0be8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -251,6 +251,9 @@ public class AppDataUsage extends DataUsageBase implements Preference.OnPreferen

    @Override
    public boolean onPreferenceChange(Preference preference, Object newValue) {
        if (com.android.settings.Utils.isMonkeyRunning()) {
            return false;
        }
        if (preference == mRestrictBackground) {
            mDataSaverBackend.setIsBlacklisted(mAppItem.key, mPackageName, !(Boolean) newValue);
            return true;