Add Screen pinning back to settings
Adds a basic screen for screen pinning (previously lock-to-app) to settings that describes the feature and allows it to be turned on and off. Bug: 16378448 Depends on Ide333463f86310eacb7a1d8b6dc7b1aea8722713 for Settings constant Change-Id: Id3ef8471794aa01de20efeb947bed95c50d6b954
This commit is contained in:
@@ -17,8 +17,6 @@
|
||||
package com.android.settings;
|
||||
|
||||
|
||||
import static android.provider.Settings.System.SCREEN_OFF_TIMEOUT;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.admin.DevicePolicyManager;
|
||||
@@ -41,6 +39,7 @@ import android.preference.PreferenceGroup;
|
||||
import android.preference.PreferenceScreen;
|
||||
import android.provider.SearchIndexableResource;
|
||||
import android.provider.Settings;
|
||||
import android.provider.Settings.SettingNotFoundException;
|
||||
import android.security.KeyStore;
|
||||
import android.service.trust.TrustAgentService;
|
||||
import android.telephony.TelephonyManager;
|
||||
@@ -55,6 +54,8 @@ import com.android.settings.search.SearchIndexableRaw;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static android.provider.Settings.System.SCREEN_OFF_TIMEOUT;
|
||||
|
||||
/**
|
||||
* Gesture lock pattern settings.
|
||||
*/
|
||||
@@ -93,6 +94,7 @@ public class SecuritySettings extends SettingsPreferenceFragment
|
||||
private static final String KEY_CREDENTIALS_MANAGER = "credentials_management";
|
||||
private static final String PACKAGE_MIME_TYPE = "application/vnd.android.package-archive";
|
||||
private static final String KEY_TRUST_AGENT = "trust_agent";
|
||||
private static final String KEY_SCREEN_PINNING = "screen_pinning_settings";
|
||||
|
||||
private DevicePolicyManager mDPM;
|
||||
|
||||
@@ -296,6 +298,15 @@ public class SecuritySettings extends SettingsPreferenceFragment
|
||||
root.findPreference(KEY_SIM_LOCK).setEnabled(false);
|
||||
}
|
||||
}
|
||||
try {
|
||||
if (Settings.System.getInt(getContentResolver(), Settings.System.LOCK_TO_APP_ENABLED)
|
||||
!= 0) {
|
||||
root.findPreference(KEY_SCREEN_PINNING).setSummary(
|
||||
getResources().getString(R.string.switch_on_text));
|
||||
}
|
||||
} catch (SettingNotFoundException e) {
|
||||
Log.w(TAG, "No Lock-to-app enabled setting", e);
|
||||
}
|
||||
|
||||
// Show password
|
||||
mShowPassword = (CheckBoxPreference) root.findPreference(KEY_SHOW_PASSWORD);
|
||||
|
Reference in New Issue
Block a user