Loading protos/launcher_atom.proto +3 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,9 @@ message ItemInfo { // Stores the origin of the Item repeated Attribute item_attributes = 12; // Stores whether the navigation bar is in kids mode. optional bool is_kids_mode = 13; } message LauncherAttributes{ Loading quickstep/src/com/android/quickstep/logging/StatsLogCompatManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -191,7 +191,7 @@ public class StatsLogCompatManager extends StatsLogManager { info.getWidget().getSpanX(), // span_x = 17 [default = 1]; info.getWidget().getSpanY(), // span_y = 18 [default = 1]; getAttributes(info) /* attributes = 19 [(log_mode) = MODE_BYTES] */, false /* is_kids_mode = 20 */ info.getIsKidsMode() /* is_kids_mode = 20 */ ); } Loading src/com/android/launcher3/model/data/ItemInfo.java +9 −0 Original line number Diff line number Diff line Loading @@ -39,8 +39,10 @@ import static com.android.launcher3.shortcuts.ShortcutKey.EXTRA_SHORTCUT_ID; import android.content.ComponentName; import android.content.ContentValues; import android.content.Intent; import android.net.Uri; import android.os.Process; import android.os.UserHandle; import android.provider.Settings; import androidx.annotation.NonNull; import androidx.annotation.Nullable; Loading @@ -61,6 +63,7 @@ import com.android.launcher3.logger.LauncherAtom.WallpapersContainer; import com.android.launcher3.logger.LauncherAtomExtensions.ExtendedContainers; import com.android.launcher3.model.ModelWriter; import com.android.launcher3.util.ContentWriter; import com.android.launcher3.util.SettingsCache; import java.util.Optional; Loading @@ -74,6 +77,9 @@ public class ItemInfo { // An id that doesn't match any item, including predicted apps with have an id=NO_ID public static final int NO_MATCHING_ID = Integer.MIN_VALUE; /** Hidden field Settings.Secure.NAV_BAR_KIDS_MODE */ private static final Uri NAV_BAR_KIDS_MODE = Settings.Secure.getUriFor("nav_bar_kids_mode"); /** * The id in the settings database for this item */ Loading Loading @@ -390,6 +396,9 @@ public class ItemInfo { protected LauncherAtom.ItemInfo.Builder getDefaultItemInfoBuilder() { LauncherAtom.ItemInfo.Builder itemBuilder = LauncherAtom.ItemInfo.newBuilder(); itemBuilder.setIsWork(!Process.myUserHandle().equals(user)); SettingsCache settingsCache = SettingsCache.INSTANCE.getNoCreate(); boolean isKidsMode = settingsCache != null && settingsCache.getValue(NAV_BAR_KIDS_MODE, 0); itemBuilder.setIsKidsMode(isKidsMode); itemBuilder.setRank(rank); return itemBuilder; } Loading Loading
protos/launcher_atom.proto +3 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,9 @@ message ItemInfo { // Stores the origin of the Item repeated Attribute item_attributes = 12; // Stores whether the navigation bar is in kids mode. optional bool is_kids_mode = 13; } message LauncherAttributes{ Loading
quickstep/src/com/android/quickstep/logging/StatsLogCompatManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -191,7 +191,7 @@ public class StatsLogCompatManager extends StatsLogManager { info.getWidget().getSpanX(), // span_x = 17 [default = 1]; info.getWidget().getSpanY(), // span_y = 18 [default = 1]; getAttributes(info) /* attributes = 19 [(log_mode) = MODE_BYTES] */, false /* is_kids_mode = 20 */ info.getIsKidsMode() /* is_kids_mode = 20 */ ); } Loading
src/com/android/launcher3/model/data/ItemInfo.java +9 −0 Original line number Diff line number Diff line Loading @@ -39,8 +39,10 @@ import static com.android.launcher3.shortcuts.ShortcutKey.EXTRA_SHORTCUT_ID; import android.content.ComponentName; import android.content.ContentValues; import android.content.Intent; import android.net.Uri; import android.os.Process; import android.os.UserHandle; import android.provider.Settings; import androidx.annotation.NonNull; import androidx.annotation.Nullable; Loading @@ -61,6 +63,7 @@ import com.android.launcher3.logger.LauncherAtom.WallpapersContainer; import com.android.launcher3.logger.LauncherAtomExtensions.ExtendedContainers; import com.android.launcher3.model.ModelWriter; import com.android.launcher3.util.ContentWriter; import com.android.launcher3.util.SettingsCache; import java.util.Optional; Loading @@ -74,6 +77,9 @@ public class ItemInfo { // An id that doesn't match any item, including predicted apps with have an id=NO_ID public static final int NO_MATCHING_ID = Integer.MIN_VALUE; /** Hidden field Settings.Secure.NAV_BAR_KIDS_MODE */ private static final Uri NAV_BAR_KIDS_MODE = Settings.Secure.getUriFor("nav_bar_kids_mode"); /** * The id in the settings database for this item */ Loading Loading @@ -390,6 +396,9 @@ public class ItemInfo { protected LauncherAtom.ItemInfo.Builder getDefaultItemInfoBuilder() { LauncherAtom.ItemInfo.Builder itemBuilder = LauncherAtom.ItemInfo.newBuilder(); itemBuilder.setIsWork(!Process.myUserHandle().equals(user)); SettingsCache settingsCache = SettingsCache.INSTANCE.getNoCreate(); boolean isKidsMode = settingsCache != null && settingsCache.getValue(NAV_BAR_KIDS_MODE, 0); itemBuilder.setIsKidsMode(isKidsMode); itemBuilder.setRank(rank); return itemBuilder; } Loading