Loading res/layout/apn_disallowed_preference_screen.xml +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ android:cacheColorHint="@android:color/white" android:fadingEdgeLength="16dip" /> <TextView android:id="@+android:id/empty" <TextView android:id="@android:id/empty" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" Loading res/layout/credentials_disallowed_preference_screen.xml 0 → 100644 +39 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /* * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/listContainer" android:layout_width="match_parent" android:layout_height="match_parent"> <ListView android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="match_parent" android:drawSelectorOnTop="false" android:scrollbarStyle="insideOverlay" android:background="@android:color/white" android:cacheColorHint="@android:color/white" android:fadingEdgeLength="16dip" /> <TextView android:id="@android:id/empty" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:text="@string/credentials_settings_not_available" android:textAppearance="?android:attr/textAppearanceMedium" /> </FrameLayout> No newline at end of file res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -4019,6 +4019,8 @@ <string name="credential_storage_type_hardware">Hardware-backed</string> <!-- Summary text for preference showing what type of credential storage this device has when it is stored in software only (as opposed to "hardware-backed") [CHAR LIMIT=NONE] --> <string name="credential_storage_type_software">Software only</string> <!-- Error message for users that aren't allowed to see or modify credentials [CHAR LIMIT=none] --> <string name="credentials_settings_not_available">Credentials are not available for this user</string> <!-- Message to draw an unlock pattern when installing credentials --> <string name="credentials_install_gesture_prompt">Draw your unlock pattern</string> Loading src/com/android/settings/CredentialStorage.java +16 −10 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.settings; import android.app.Activity; import android.app.AlertDialog; import android.app.admin.DevicePolicyManager; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.res.Resources; Loading @@ -26,6 +27,7 @@ import android.os.AsyncTask; import android.os.Bundle; import android.os.RemoteException; import android.os.Process; import android.os.UserManager; import android.security.Credentials; import android.security.KeyChain.KeyChainConnection; import android.security.KeyChain; Loading @@ -38,8 +40,8 @@ import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import com.android.internal.widget.LockPatternUtils; import com.android.internal.widget.LockPatternUtils; import com.android.org.bouncycastle.asn1.ASN1InputStream; import com.android.org.bouncycastle.asn1.pkcs.PrivateKeyInfo; Loading Loading @@ -119,7 +121,8 @@ public final class CredentialStorage extends Activity { Intent intent = getIntent(); String action = intent.getAction(); UserManager userManager = (UserManager) getSystemService(Context.USER_SERVICE); if (!userManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_CREDENTIALS)) { if (ACTION_RESET.equals(action)) { new ResetDialog(); } else { Loading @@ -130,6 +133,9 @@ public final class CredentialStorage extends Activity { // ACTION_UNLOCK also handled here in addition to ACTION_INSTALL handleUnlockOrInstall(); } } else { finish(); } } /** Loading src/com/android/settings/SecuritySettings.java +8 −15 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ import java.util.List; /** * Gesture lock pattern settings. */ public class SecuritySettings extends RestrictedSettingsFragment public class SecuritySettings extends SettingsPreferenceFragment implements OnPreferenceChangeListener, DialogInterface.OnClickListener, Indexable { static final String TAG = "SecuritySettings"; private static final Intent TRUST_AGENT_INTENT = Loading Loading @@ -115,10 +115,6 @@ public class SecuritySettings extends RestrictedSettingsFragment private boolean mIsPrimary; public SecuritySettings() { super(null /* Don't ask for restrictions pin on creation. */); } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Loading Loading @@ -274,6 +270,7 @@ public class SecuritySettings extends RestrictedSettingsFragment } else { removePreference(KEY_CREDENTIALS_MANAGER); removePreference(KEY_CREDENTIALS_INSTALL); } // Application install Loading @@ -282,9 +279,12 @@ public class SecuritySettings extends RestrictedSettingsFragment mToggleAppInstallation = (CheckBoxPreference) findPreference( KEY_TOGGLE_INSTALL_APPLICATIONS); mToggleAppInstallation.setChecked(isNonMarketAppsAllowed()); // Side loading of apps. mToggleAppInstallation.setEnabled(mIsPrimary); if (um.hasUserRestriction(UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES) || um.hasUserRestriction(UserManager.DISALLOW_INSTALL_APPS)) { mToggleAppInstallation.setEnabled(false); } // Package verification, only visible to primary user and if enabled mToggleVerifyApps = (CheckBoxPreference) findPreference(KEY_TOGGLE_VERIFY_APPLICATIONS); Loading @@ -302,12 +302,8 @@ public class SecuritySettings extends RestrictedSettingsFragment mToggleVerifyApps.setEnabled(false); } } if (shouldBePinProtected(RESTRICTIONS_PIN_SET)) { protectByRestrictions(mToggleAppInstallation); protectByRestrictions(mToggleVerifyApps); protectByRestrictions(mResetCredentials); protectByRestrictions(root.findPreference(KEY_CREDENTIALS_INSTALL)); if (um.hasUserRestriction(UserManager.ENSURE_VERIFY_APPS)) { mToggleVerifyApps.setEnabled(false); } // Trust Agent preferences Loading Loading @@ -504,9 +500,6 @@ public class SecuritySettings extends RestrictedSettingsFragment @Override public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { if (ensurePinRestrictedPreference(preference)) { return true; } final String key = preference.getKey(); final LockPatternUtils lockPatternUtils = mChooseLockSettingsHelper.utils(); Loading Loading
res/layout/apn_disallowed_preference_screen.xml +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ android:cacheColorHint="@android:color/white" android:fadingEdgeLength="16dip" /> <TextView android:id="@+android:id/empty" <TextView android:id="@android:id/empty" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" Loading
res/layout/credentials_disallowed_preference_screen.xml 0 → 100644 +39 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /* * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/listContainer" android:layout_width="match_parent" android:layout_height="match_parent"> <ListView android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="match_parent" android:drawSelectorOnTop="false" android:scrollbarStyle="insideOverlay" android:background="@android:color/white" android:cacheColorHint="@android:color/white" android:fadingEdgeLength="16dip" /> <TextView android:id="@android:id/empty" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:text="@string/credentials_settings_not_available" android:textAppearance="?android:attr/textAppearanceMedium" /> </FrameLayout> No newline at end of file
res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -4019,6 +4019,8 @@ <string name="credential_storage_type_hardware">Hardware-backed</string> <!-- Summary text for preference showing what type of credential storage this device has when it is stored in software only (as opposed to "hardware-backed") [CHAR LIMIT=NONE] --> <string name="credential_storage_type_software">Software only</string> <!-- Error message for users that aren't allowed to see or modify credentials [CHAR LIMIT=none] --> <string name="credentials_settings_not_available">Credentials are not available for this user</string> <!-- Message to draw an unlock pattern when installing credentials --> <string name="credentials_install_gesture_prompt">Draw your unlock pattern</string> Loading
src/com/android/settings/CredentialStorage.java +16 −10 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.settings; import android.app.Activity; import android.app.AlertDialog; import android.app.admin.DevicePolicyManager; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.res.Resources; Loading @@ -26,6 +27,7 @@ import android.os.AsyncTask; import android.os.Bundle; import android.os.RemoteException; import android.os.Process; import android.os.UserManager; import android.security.Credentials; import android.security.KeyChain.KeyChainConnection; import android.security.KeyChain; Loading @@ -38,8 +40,8 @@ import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import com.android.internal.widget.LockPatternUtils; import com.android.internal.widget.LockPatternUtils; import com.android.org.bouncycastle.asn1.ASN1InputStream; import com.android.org.bouncycastle.asn1.pkcs.PrivateKeyInfo; Loading Loading @@ -119,7 +121,8 @@ public final class CredentialStorage extends Activity { Intent intent = getIntent(); String action = intent.getAction(); UserManager userManager = (UserManager) getSystemService(Context.USER_SERVICE); if (!userManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_CREDENTIALS)) { if (ACTION_RESET.equals(action)) { new ResetDialog(); } else { Loading @@ -130,6 +133,9 @@ public final class CredentialStorage extends Activity { // ACTION_UNLOCK also handled here in addition to ACTION_INSTALL handleUnlockOrInstall(); } } else { finish(); } } /** Loading
src/com/android/settings/SecuritySettings.java +8 −15 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ import java.util.List; /** * Gesture lock pattern settings. */ public class SecuritySettings extends RestrictedSettingsFragment public class SecuritySettings extends SettingsPreferenceFragment implements OnPreferenceChangeListener, DialogInterface.OnClickListener, Indexable { static final String TAG = "SecuritySettings"; private static final Intent TRUST_AGENT_INTENT = Loading Loading @@ -115,10 +115,6 @@ public class SecuritySettings extends RestrictedSettingsFragment private boolean mIsPrimary; public SecuritySettings() { super(null /* Don't ask for restrictions pin on creation. */); } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Loading Loading @@ -274,6 +270,7 @@ public class SecuritySettings extends RestrictedSettingsFragment } else { removePreference(KEY_CREDENTIALS_MANAGER); removePreference(KEY_CREDENTIALS_INSTALL); } // Application install Loading @@ -282,9 +279,12 @@ public class SecuritySettings extends RestrictedSettingsFragment mToggleAppInstallation = (CheckBoxPreference) findPreference( KEY_TOGGLE_INSTALL_APPLICATIONS); mToggleAppInstallation.setChecked(isNonMarketAppsAllowed()); // Side loading of apps. mToggleAppInstallation.setEnabled(mIsPrimary); if (um.hasUserRestriction(UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES) || um.hasUserRestriction(UserManager.DISALLOW_INSTALL_APPS)) { mToggleAppInstallation.setEnabled(false); } // Package verification, only visible to primary user and if enabled mToggleVerifyApps = (CheckBoxPreference) findPreference(KEY_TOGGLE_VERIFY_APPLICATIONS); Loading @@ -302,12 +302,8 @@ public class SecuritySettings extends RestrictedSettingsFragment mToggleVerifyApps.setEnabled(false); } } if (shouldBePinProtected(RESTRICTIONS_PIN_SET)) { protectByRestrictions(mToggleAppInstallation); protectByRestrictions(mToggleVerifyApps); protectByRestrictions(mResetCredentials); protectByRestrictions(root.findPreference(KEY_CREDENTIALS_INSTALL)); if (um.hasUserRestriction(UserManager.ENSURE_VERIFY_APPS)) { mToggleVerifyApps.setEnabled(false); } // Trust Agent preferences Loading Loading @@ -504,9 +500,6 @@ public class SecuritySettings extends RestrictedSettingsFragment @Override public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { if (ensurePinRestrictedPreference(preference)) { return true; } final String key = preference.getKey(); final LockPatternUtils lockPatternUtils = mChooseLockSettingsHelper.utils(); Loading