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

Commit 700473b6 authored by Raj Yengisetty's avatar Raj Yengisetty Committed by Rajesh Yengisetty
Browse files

Fix: Even when the list is entirely unchecked there may still be components

which are still protected and need to cleared when Reset is triggered.


https://jira.cyanogenmod.org/browse/BACON-679
https://jira.cyanogenmod.org/browse/CYAN-4835

Change-Id: Ifee3e8b87be39769aedfed0f9a5bda366c67ee45
parent 3749853e
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
@@ -3,16 +3,16 @@ package com.android.settings.applications;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
@@ -173,6 +173,23 @@ public class ProtectedAppsActivity extends Activity {
            mListView.setItemChecked(i, false);
        }

        // Check to see if any components that have been protected that aren't present in
        // the ListView. This can happen if there are components which have been protected
        // but do not respond to the queryIntentActivities for Launcher Category
        ContentResolver resolver = getContentResolver();
        String hiddenComponents = Settings.Secure.getString(resolver,
                Settings.Secure.PROTECTED_COMPONENTS);

        if (hiddenComponents != null && !hiddenComponents.equals("")) {
            for (String flattened : hiddenComponents.split("\\|")) {
                ComponentName cmp = ComponentName.unflattenFromString(flattened);

                if (!componentsList.contains(cmp)) {
                    componentsList.add(cmp);
                }
            }
        }

        AppProtectList list = new AppProtectList(componentsList,
                PackageManager.COMPONENT_VISIBLE_STATUS);
        StoreComponentProtectedStatus task = new StoreComponentProtectedStatus(this);