Loading res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -12849,4 +12849,7 @@ <string name="enable_2g_title">Allow 2G</string> <!-- Title for toggle if user wants to enable 2G [CHAR LIMIT=NONE] --> <string name="enable_2g_summary">Use 2G cellular connections. For emergency calls, 2G is always turned on.</string> <!-- Label for extra app info settings for a specific app [CHAR LIMIT=40] --> <string name="extra_app_info_label" translatable="false"></string> </resources> res/xml/app_info_settings_v2.xml +5 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,11 @@ android:summary="@string/summary_placeholder" settings:controller="com.android.settings.applications.appinfo.AppDataUsagePreferenceController" /> <Preference android:key="extra_app_info_settings" android:title="@string/extra_app_info_label" settings:controller="com.android.settings.applications.appinfo.ExtraAppInfoPreferenceController" /> <Preference android:key="time_spent_in_app" android:title="@string/time_spent_in_app_pref_title" Loading src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java +3 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,9 @@ public class AppInfoDashboardFragment extends DashboardFragment use(AppStoragePreferenceController.class).setParentFragment(this); use(AppVersionPreferenceController.class).setParentFragment(this); use(InstantAppDomainsPreferenceController.class).setParentFragment(this); if (FeatureFlagUtils.isEnabled(context, FeatureFlags.SILKY_HOME)) { use(ExtraAppInfoPreferenceController.class).setPackageName(packageName); } final WriteSystemSettingsPreferenceController writeSystemSettings = use(WriteSystemSettingsPreferenceController.class); Loading src/com/android/settings/applications/appinfo/ExtraAppInfoFeatureProvider.java 0 → 100644 +37 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.settings.applications.appinfo; import android.content.Context; /** * Provider for Extra App Info related feature */ public interface ExtraAppInfoFeatureProvider { /** Returns true if the feature is supported. */ boolean isSupported(Context context); /** * Launch ExtraAppInfoSettings */ void launchExtraAppInfoSettings(Context context); /** * Sets the package name */ void setPackageName(String packageName); } src/com/android/settings/applications/appinfo/ExtraAppInfoFeatureProviderImpl.java 0 → 100644 +40 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.settings.applications.appinfo; import android.content.Context; /** * Provider for Extra App Info related feature */ public class ExtraAppInfoFeatureProviderImpl implements ExtraAppInfoFeatureProvider { @Override public boolean isSupported(Context context) { return false; } @Override public void launchExtraAppInfoSettings(Context context) { return; } @Override public void setPackageName(String packageName) { return; } } Loading
res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -12849,4 +12849,7 @@ <string name="enable_2g_title">Allow 2G</string> <!-- Title for toggle if user wants to enable 2G [CHAR LIMIT=NONE] --> <string name="enable_2g_summary">Use 2G cellular connections. For emergency calls, 2G is always turned on.</string> <!-- Label for extra app info settings for a specific app [CHAR LIMIT=40] --> <string name="extra_app_info_label" translatable="false"></string> </resources>
res/xml/app_info_settings_v2.xml +5 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,11 @@ android:summary="@string/summary_placeholder" settings:controller="com.android.settings.applications.appinfo.AppDataUsagePreferenceController" /> <Preference android:key="extra_app_info_settings" android:title="@string/extra_app_info_label" settings:controller="com.android.settings.applications.appinfo.ExtraAppInfoPreferenceController" /> <Preference android:key="time_spent_in_app" android:title="@string/time_spent_in_app_pref_title" Loading
src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java +3 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,9 @@ public class AppInfoDashboardFragment extends DashboardFragment use(AppStoragePreferenceController.class).setParentFragment(this); use(AppVersionPreferenceController.class).setParentFragment(this); use(InstantAppDomainsPreferenceController.class).setParentFragment(this); if (FeatureFlagUtils.isEnabled(context, FeatureFlags.SILKY_HOME)) { use(ExtraAppInfoPreferenceController.class).setPackageName(packageName); } final WriteSystemSettingsPreferenceController writeSystemSettings = use(WriteSystemSettingsPreferenceController.class); Loading
src/com/android/settings/applications/appinfo/ExtraAppInfoFeatureProvider.java 0 → 100644 +37 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.settings.applications.appinfo; import android.content.Context; /** * Provider for Extra App Info related feature */ public interface ExtraAppInfoFeatureProvider { /** Returns true if the feature is supported. */ boolean isSupported(Context context); /** * Launch ExtraAppInfoSettings */ void launchExtraAppInfoSettings(Context context); /** * Sets the package name */ void setPackageName(String packageName); }
src/com/android/settings/applications/appinfo/ExtraAppInfoFeatureProviderImpl.java 0 → 100644 +40 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.settings.applications.appinfo; import android.content.Context; /** * Provider for Extra App Info related feature */ public class ExtraAppInfoFeatureProviderImpl implements ExtraAppInfoFeatureProvider { @Override public boolean isSupported(Context context) { return false; } @Override public void launchExtraAppInfoSettings(Context context) { return; } @Override public void setPackageName(String packageName) { return; } }