Commits

Robert Craig committed bda968e

Drop MMAC enforcing ability.

Recent changes to install-time MAC
code means we're always in enforcing mode
without the ability toggle.

  • Participants
  • Parent commits 0df0561

Comments (0)

Files changed (3)

File res/values/strings.xml

     <string name="mmac_admin_cb_title">MMAC admin</string>
     <string name="mmac_admin_cb_summary">Allow SEAdmin to become a MMAC Admin. This is required for the app to set MMAC settings.</string>
 
-    <string name="mmac_enforcing_cb_title">Enforce MMAC policy</string>
-    <string name="mmac_enforcing_cb_summaryChecked">MMAC in enforcing mode</string>
-    <string name="mmac_enforcing_cb_summaryUnchecked">MMAC in permissive mode</string>
-    <string name="mmac_enforcing_cb_summaryDisabled">Unable to query mode of MMAC</string>
-
     <string name="mmac_reload_title">Reload MMAC policy</string>
 
     <string name="mmac_restore_title">Restore default MMAC policy</string>

File res/xml/mmac_fragment.xml

     <PreferenceCategory
         android:title="@string/seandroid_cat">
 
-        <CheckBoxPreference
-            android:key="key_mmac_enforcing"
-            android:title="@string/mmac_enforcing_cb_title" />
-
         <Preference
             android:title="@string/mmac_reload_title"
             android:key="key_mmac_reload" />

File src/com/android/seandroid_admin/MMACFragment.java

         implements OnPreferenceChangeListener {
     public static final String TAG = "MMACfragment";
 
-    private static final String KEY_MMAC_ENFORCING = "key_mmac_enforcing";
     private static final String KEY_MMAC_RELOAD = "key_mmac_reload";
     private static final String KEY_MMAC_RESTORE = "key_mmac_restore";
 
-    private static final String MMAC_ENFORCE_PROPERTY = "persist.mmac.enforce";
     private static final String MMAC_POLICY_FILE = "mac_permissions.xml";
 
     private CheckBoxPreference mMMACenforceCheckbox;
 
     private File mMMACpolicyFile = null;
 
-    private String mMMACenforceCheckboxSummaryChecked;
-    private String mMMACenforceCheckboxSummaryUnchecked;
-    private String mMMACenforceCheckboxSummaryDisabled;
-
     private TextView mEmptyView;
 
     @Override
                 mMMACpolicyFile = new File(extFileDir, MMAC_POLICY_FILE);
             }
 
-            mMMACenforceCheckbox =
-                    (CheckBoxPreference) getPreferenceScreen().findPreference(KEY_MMAC_ENFORCING);
-            mMMACenforceCheckbox.setOnPreferenceChangeListener(this);
-            mMMACenforceCheckboxSummaryChecked =
-                    getString(R.string.mmac_enforcing_cb_summaryChecked);
-            mMMACenforceCheckboxSummaryUnchecked =
-                    getString(R.string.mmac_enforcing_cb_summaryUnchecked);
-            mMMACenforceCheckboxSummaryDisabled =
-                    getString(R.string.mmac_enforcing_cb_summaryDisabled);
-
             mMMACreload =
                     getPreferenceScreen().findPreference(KEY_MMAC_RELOAD);
             mMMACreload.setOnPreferenceClickListener(new OnPreferenceClickListener() {
         super.onResume();
         updateViews();
     }
-    
+
     @Override
     public boolean onPreferenceChange(Preference preference, Object newValue) {
         if (super.onPreferenceChange(preference, newValue)) {
             return true;
         }
-        
-        if (preference == mMMACenforceCheckbox) {
-            boolean value = (Boolean) newValue;
-            boolean ret = mAdmin.mDPM.setMMACenforcing(mAdmin.mDeviceAdmin, value);
-            mAdmin.updateMMACstate();
-            updateViews();
-            return ret;
-        }
-        
+
         return false;
     }
-    
+
     private void updateViews() {
         if (TRACE_UPDATE) { Log.v(TAG, "UPDATE updateViews()"); }
-        
-        if (mAdmin.isMMACadmin) {
-            mMMACenforceCheckbox.setEnabled(true);
-            boolean systemState = SystemProperties.getBoolean(MMAC_ENFORCE_PROPERTY, false);
-            mMMACenforceCheckbox.setChecked(systemState);
-            if (systemState) {
-                mMMACenforceCheckbox.setSummary(mMMACenforceCheckboxSummaryChecked);
-            } else {
-                mMMACenforceCheckbox.setSummary(mMMACenforceCheckboxSummaryUnchecked);
-            }
 
+        if (mAdmin.isMMACadmin) {
             mMMACreload.setEnabled(true);
             if (mMMACpolicyFile != null) {
                 mMMACreload.setSummary(mMMACpolicyFile.getPath());