Snap for 5073180 from 9c072cd621 to qt-release
Change-Id: Ic59f42cd944477afb101137891f1b12820ad68df
This commit is contained in:
@@ -1560,7 +1560,7 @@
|
||||
android:enabled="false"
|
||||
android:exported="true"
|
||||
android:taskAffinity="com.android.wizard"
|
||||
android:theme="@style/SuwThemeGlif.Light"
|
||||
android:theme="@style/SuwThemeGlif.DayNight"
|
||||
android:label="@string/lock_screen_notifications_interstitial_title"
|
||||
android:icon="@drawable/ic_suggested_notifications">
|
||||
<intent-filter>
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -35,7 +36,7 @@
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginStart="14dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:tint="?android:attr/colorAccent" />
|
||||
android:tint="?android:attr/colorAccent"/>
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/title"
|
||||
@@ -43,7 +44,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="14dp"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorPrimary" />
|
||||
android:textColor="?android:attr/textColorPrimary"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -56,7 +57,7 @@
|
||||
android:paddingBottom="8dp"
|
||||
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
|
||||
android:alpha=".7"
|
||||
android:textColor="?android:attr/textColorPrimary" />
|
||||
android:textColor="?android:attr/textColorPrimary"/>
|
||||
|
||||
<androidx.appcompat.widget.ButtonBarLayout
|
||||
android:id="@+id/buttonBar"
|
||||
@@ -76,20 +77,15 @@
|
||||
android:alpha=".8"
|
||||
android:textAlignment="viewStart"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
style="?android:attr/buttonBarButtonStyle" />
|
||||
style="?android:attr/buttonBarButtonStyle"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/second_action"
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:alpha=".8"
|
||||
android:textAlignment="viewStart"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
style="?android:attr/buttonBarButtonStyle" />
|
||||
android:layout_weight="1"/>
|
||||
|
||||
</androidx.appcompat.widget.ButtonBarLayout>
|
||||
|
||||
<include layout="@layout/horizontal_divider" />
|
||||
<include layout="@layout/horizontal_divider"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:theme="@style/SuwThemeGlifV3.Light"
|
||||
android:theme="@style/SuwThemeGlifV3.DayNight"
|
||||
android:icon="@drawable/ic_delete_accent"
|
||||
app:suwHeaderText="@string/master_clear_title">
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:theme="@style/SuwThemeGlifV3.Light"
|
||||
android:theme="@style/SuwThemeGlifV3.DayNight"
|
||||
android:id="@+id/setup_wizard_layout"
|
||||
android:icon="@drawable/ic_delete_accent"
|
||||
app:suwHeaderText="@string/master_clear_confirm_title">
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<!-- SUW related themes -->
|
||||
<resources>
|
||||
<style name="GlifTheme" parent="SuwThemeGlif">
|
||||
<style name="GlifTheme" parent="SuwThemeGlif.DayNight">
|
||||
<!-- For all AndroidX Alert Dialogs -->
|
||||
<item name="alertDialogTheme">@style/ThemeOverlay.AlertDialog</item>
|
||||
<item name="android:windowBackground">?android:attr/colorBackground</item>
|
||||
@@ -55,7 +55,7 @@
|
||||
<item name="*android:colorError">@color/glif_error_color</item>
|
||||
</style>
|
||||
|
||||
<style name="GlifV2Theme" parent="SuwThemeGlifV2">
|
||||
<style name="GlifV2Theme" parent="SuwThemeGlifV2.DayNight">
|
||||
<!-- For all AndroidX Alert Dialogs -->
|
||||
<item name="alertDialogTheme">@style/GlifV2ThemeAlertDialog</item>
|
||||
<item name="android:windowBackground">?android:attr/colorBackground</item>
|
||||
@@ -93,7 +93,7 @@
|
||||
<item name="*android:colorError">@color/glif_error_color</item>
|
||||
</style>
|
||||
|
||||
<style name="GlifV3Theme" parent="SuwThemeGlifV3">
|
||||
<style name="GlifV3Theme" parent="SuwThemeGlifV3.DayNight">
|
||||
<!-- For all AndroidX Alert Dialogs -->
|
||||
<item name="alertDialogTheme">@style/GlifV2ThemeAlertDialog</item>
|
||||
<item name="android:windowBackground">?android:attr/colorBackground</item>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.settings.enterprise;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.UserIdInt;
|
||||
import android.app.Activity;
|
||||
import android.app.admin.DevicePolicyManager;
|
||||
@@ -61,14 +62,18 @@ public class ActionDisabledByAdminDialogHelper {
|
||||
mActivity = activity;
|
||||
}
|
||||
|
||||
private @UserIdInt int getEnforcementAdminUserId() {
|
||||
if (mEnforcedAdmin.user == null) {
|
||||
private @UserIdInt int getEnforcementAdminUserId(@NonNull EnforcedAdmin admin) {
|
||||
if (admin.user == null) {
|
||||
return UserHandle.USER_NULL;
|
||||
} else {
|
||||
return mEnforcedAdmin.user.getIdentifier();
|
||||
return admin.user.getIdentifier();
|
||||
}
|
||||
}
|
||||
|
||||
private @UserIdInt int getEnforcementAdminUserId() {
|
||||
return getEnforcementAdminUserId(mEnforcedAdmin);
|
||||
}
|
||||
|
||||
public AlertDialog.Builder prepareDialogBuilder(String restriction,
|
||||
EnforcedAdmin enforcedAdmin) {
|
||||
mEnforcedAdmin = enforcedAdmin;
|
||||
@@ -170,18 +175,11 @@ public class ActionDisabledByAdminDialogHelper {
|
||||
return;
|
||||
}
|
||||
|
||||
final int userId;
|
||||
if (enforcedAdmin.user == null) {
|
||||
userId = UserHandle.USER_NULL;
|
||||
} else {
|
||||
userId = enforcedAdmin.user.getIdentifier();
|
||||
}
|
||||
|
||||
final DevicePolicyManager dpm = (DevicePolicyManager) activity.getSystemService(
|
||||
Context.DEVICE_POLICY_SERVICE);
|
||||
if (!RestrictedLockUtilsInternal.isAdminInCurrentUserOrProfile(activity,
|
||||
enforcedAdmin.component) || !RestrictedLockUtils.isCurrentUserOrProfile(
|
||||
activity, userId)) {
|
||||
activity, getEnforcementAdminUserId(enforcedAdmin))) {
|
||||
enforcedAdmin.component = null;
|
||||
} else {
|
||||
if (enforcedAdmin.user == null) {
|
||||
@@ -189,7 +187,8 @@ public class ActionDisabledByAdminDialogHelper {
|
||||
}
|
||||
CharSequence supportMessage = null;
|
||||
if (UserHandle.isSameApp(Process.myUid(), Process.SYSTEM_UID)) {
|
||||
supportMessage = dpm.getShortSupportMessageForUser(enforcedAdmin.component, userId);
|
||||
supportMessage = dpm.getShortSupportMessageForUser(enforcedAdmin.component,
|
||||
getEnforcementAdminUserId(enforcedAdmin));
|
||||
}
|
||||
if (supportMessage != null) {
|
||||
final TextView textView = root.findViewById(R.id.admin_support_msg);
|
||||
|
||||
@@ -88,6 +88,16 @@ public class ShadowUserManager extends org.robolectric.shadows.ShadowUserManager
|
||||
return ids;
|
||||
}
|
||||
|
||||
@Implementation
|
||||
public List<UserHandle> getUserProfiles(){
|
||||
int[] userIds = getProfileIds(UserHandle.myUserId(), true /* enabledOnly */);
|
||||
List<UserHandle> result = new ArrayList<>(userIds.length);
|
||||
for (int userId : userIds) {
|
||||
result.add(UserHandle.of(userId));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Implementation
|
||||
public int getCredentialOwnerProfile(@UserIdInt int userHandle) {
|
||||
return userHandle;
|
||||
|
||||
Reference in New Issue
Block a user