Default apps setting for managed profile

1. Print settings already support managed profile. Follow the UI of that.
ProfileSettingsPreferenceFragment is created to act as the base class
for per-profile setting.

2. Only show browser and dialer default setting in managed profile.

BUG=26707733

Change-Id: I20d00203e14db58ec03638f692dd83a1bd50c59c
This commit is contained in:
Tony Mak
2016-01-27 14:01:16 +00:00
parent 1b4e746a7f
commit 32ccffc07c
8 changed files with 146 additions and 67 deletions

View File

@@ -17,6 +17,7 @@ package com.android.settings.applications;
import android.content.ComponentName;
import android.content.Context;
import android.os.UserManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.AttributeSet;
@@ -24,6 +25,7 @@ import android.util.AttributeSet;
import com.android.internal.telephony.SmsApplication;
import com.android.internal.telephony.SmsApplication.SmsApplicationData;
import com.android.settings.AppListPreference;
import com.android.settings.Utils;
import java.util.Collection;
import java.util.Objects;
@@ -69,7 +71,7 @@ public class DefaultSmsPreference extends AppListPreference {
public static boolean isAvailable(Context context) {
TelephonyManager tm =
(TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
return tm.isSmsCapable();
return tm.isSmsCapable() && !Utils.isManagedProfile(UserManager.get(context));
}
}