Add intent for entering communal settings

This allows other apps to link to communal settings.

Fixes: 276742740
Test: adb shell am start -a android.settings.COMMUNAL_SETTINGS
Test: switched to secondary user, attempted to launch using command
above. Verified it didn't work

Change-Id: I5e845ecba58d8443d41aeea95bc6068a0041cac8
This commit is contained in:
Lucas Silva
2023-04-12 15:22:39 -04:00
parent a7152b9573
commit 3b1c739ce2
4 changed files with 40 additions and 3 deletions

View File

@@ -32,8 +32,14 @@ public class CommunalPreferenceController extends BasePreferenceController {
@Override
public int getAvailabilityStatus() {
return (mContext.getResources().getBoolean(R.bool.config_show_communal_settings)
&& Utils.canCurrentUserDream(mContext))
? AVAILABLE : UNSUPPORTED_ON_DEVICE;
return isAvailable(mContext) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
}
/**
* Returns whether communal preferences are available.
*/
public static boolean isAvailable(Context context) {
return context.getResources().getBoolean(R.bool.config_show_communal_settings)
&& Utils.canCurrentUserDream(context);
}
}