Loading res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -715,6 +715,9 @@ <!-- Summary of a default app when there is no app set [CHAR LIMIT=60] --> <string name="default_app_none">None</string> <!-- Label for a system default app [CHAR LIMIT=60] --> <string name="default_app_system_default">(System default)</string> <!-- Label when there are no apps available for a default app [CHAR LIMIT=30] --> <string name="default_app_no_apps">No apps</string> Loading src/com/android/packageinstaller/role/model/DialerRoleBehavior.java +20 −0 Original line number Diff line number Diff line Loading @@ -17,11 +17,18 @@ package com.android.packageinstaller.role.model; import android.content.Context; import android.content.pm.ApplicationInfo; import android.os.UserHandle; import android.telecom.TelecomManager; import android.telephony.TelephonyManager; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.preference.Preference; import com.android.permissioncontroller.R; import java.util.Objects; /** * Class for behavior of the dialer role. Loading @@ -39,6 +46,19 @@ public class DialerRoleBehavior implements RoleBehavior { return telephonyManager.isVoiceCapable(); } @Override public void prepareApplicationPreferenceAsUser(@NonNull Role role, @NonNull Preference preference, @NonNull ApplicationInfo applicationInfo, @NonNull UserHandle user, @NonNull Context context) { TelecomManager telecomManager = context.getSystemService(TelecomManager.class); String systemPackageName = telecomManager.getSystemDialerPackage(); if (Objects.equals(applicationInfo.packageName, systemPackageName)) { preference.setSummary(R.string.default_app_system_default); } else { preference.setSummary(null); } } @Nullable @Override public CharSequence getConfirmationMessage(@NonNull Role role, @NonNull String packageName, Loading Loading
res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -715,6 +715,9 @@ <!-- Summary of a default app when there is no app set [CHAR LIMIT=60] --> <string name="default_app_none">None</string> <!-- Label for a system default app [CHAR LIMIT=60] --> <string name="default_app_system_default">(System default)</string> <!-- Label when there are no apps available for a default app [CHAR LIMIT=30] --> <string name="default_app_no_apps">No apps</string> Loading
src/com/android/packageinstaller/role/model/DialerRoleBehavior.java +20 −0 Original line number Diff line number Diff line Loading @@ -17,11 +17,18 @@ package com.android.packageinstaller.role.model; import android.content.Context; import android.content.pm.ApplicationInfo; import android.os.UserHandle; import android.telecom.TelecomManager; import android.telephony.TelephonyManager; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.preference.Preference; import com.android.permissioncontroller.R; import java.util.Objects; /** * Class for behavior of the dialer role. Loading @@ -39,6 +46,19 @@ public class DialerRoleBehavior implements RoleBehavior { return telephonyManager.isVoiceCapable(); } @Override public void prepareApplicationPreferenceAsUser(@NonNull Role role, @NonNull Preference preference, @NonNull ApplicationInfo applicationInfo, @NonNull UserHandle user, @NonNull Context context) { TelecomManager telecomManager = context.getSystemService(TelecomManager.class); String systemPackageName = telecomManager.getSystemDialerPackage(); if (Objects.equals(applicationInfo.packageName, systemPackageName)) { preference.setSummary(R.string.default_app_system_default); } else { preference.setSummary(null); } } @Nullable @Override public CharSequence getConfirmationMessage(@NonNull Role role, @NonNull String packageName, Loading