Move ManageApplications to sub package and remove dead code
Bug: 64804294
Test: rerun test
Change-Id: I23cbd8da9b65f52470030ba3b9b676ece2bada11
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index d52b0ce..3954230 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -987,6 +987,7 @@
<intent-filter android:priority="1">
<action android:name="android.settings.APPLICATION_SETTINGS" />
<action android:name="android.settings.MANAGE_APPLICATIONS_SETTINGS" />
+ <action android:name="android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
@@ -996,7 +997,7 @@
<category android:name="com.android.settings.SHORTCUT" />
</intent-filter>
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
- android:value="com.android.settings.applications.ManageApplications" />
+ android:value="com.android.settings.applications.manageapplications.ManageApplications" />
<meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
android:value="true" />
</activity>
@@ -1043,19 +1044,6 @@
android:value="com.android.settings.applications.ProcessStatsUi" />
</activity>
- <activity android:name="Settings$AllApplicationsActivity"
- android:label="@string/applications_settings"
- android:taskAffinity="">
- <intent-filter>
- <action android:name="android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
- <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
- android:value="com.android.settings.applications.ManageApplications" />
- <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
- android:value="true" />
- </activity>
-
<activity android:name="Settings$HighPowerApplicationsActivity"
android:label="@string/high_power_apps"
android:taskAffinity="">
@@ -1064,7 +1052,7 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
- android:value="com.android.settings.applications.ManageApplications" />
+ android:value="com.android.settings.applications.manageapplications.ManageApplications" />
<meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
android:value="true" />
</activity>
@@ -1096,14 +1084,7 @@
android:exported="true"
android:targetActivity="Settings$ManageApplicationsActivity">
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
- android:value="com.android.settings.applications.ManageApplications" />
- </activity-alias>
-
- <!-- Keep compatibility with old shortcuts. Pre-gingerbread. -->
- <activity-alias android:name=".ManageApplications"
- android:label="@string/manageapplications_settings_title"
- android:exported="true"
- android:targetActivity="Settings$ManageApplicationsActivity">
+ android:value="com.android.settings.applications.manageapplications.ManageApplications" />
</activity-alias>
<!-- Provide direct entry into manage apps showing running services.
@@ -1113,7 +1094,7 @@
android:exported="true"
android:targetActivity="Settings$ManageApplicationsActivity">
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
- android:value="com.android.settings.applications.ManageApplications" />
+ android:value="com.android.settings.applications.manageapplications.ManageApplications" />
</activity-alias>
<!-- Provide direct entry into manage apps showing storage usage for apps.
@@ -1123,7 +1104,7 @@
android:exported="true"
android:targetActivity="Settings$ManageApplicationsActivity">
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
- android:value="com.android.settings.applications.ManageApplications" />
+ android:value="com.android.settings.applications.manageapplications.ManageApplications" />
</activity-alias>
<!-- Still need a top-level activity for showing app details. Aliasing
@@ -1160,7 +1141,7 @@
<category android:name="android.intent.category.VOICE_LAUNCH" />
</intent-filter>
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
- android:value="com.android.settings.applications.ManageApplications" />
+ android:value="com.android.settings.applications.manageapplications.ManageApplications" />
<meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
android:value="true" />
</activity>
@@ -1181,7 +1162,7 @@
<category android:name="android.intent.category.VOICE_LAUNCH" />
</intent-filter>
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
- android:value="com.android.settings.applications.ManageApplications" />
+ android:value="com.android.settings.applications.manageapplications.ManageApplications" />
<meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
android:value="true" />
</activity>
@@ -1403,7 +1384,7 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
- android:value="com.android.settings.applications.ManageApplications" />
+ android:value="com.android.settings.applications.manageapplications.ManageApplications" />
</activity>
<activity-alias android:name="SetProfileOwner"
@@ -2953,7 +2934,7 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
- android:value="com.android.settings.applications.ManageApplications" />
+ android:value="com.android.settings.applications.manageapplications.ManageApplications" />
</activity>
<activity android:name="Settings$AppDrawOverlaySettingsActivity"
@@ -2976,7 +2957,7 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
- android:value="com.android.settings.applications.ManageApplications" />
+ android:value="com.android.settings.applications.manageapplications.ManageApplications" />
</activity>
@@ -3000,7 +2981,7 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
- android:value="com.android.settings.applications.ManageApplications" />
+ android:value="com.android.settings.applications.manageapplications.ManageApplications" />
</activity>
<activity android:name="Settings$ManageAppExternalSourcesActivity"
diff --git a/res/xml/application_settings.xml b/res/xml/application_settings.xml
deleted file mode 100644
index 9987fc2..0000000
--- a/res/xml/application_settings.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 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.
--->
-
-<!--
-
- This code is deprecated. This screen is no longer used in Settings.
- The ApplicationSettings class is kept in case an external app references it directly.
-
--->
-
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
- android:title="@string/applications_settings"
- android:summary="@string/applications_settings_summary"
- android:key="applications_settings">
-
- <Preference
- android:fragment="com.android.settings.applications.ManageApplications"
- android:title="@string/manageapplications_settings_title"
- android:summary="@string/manageapplications_settings_summary">
- </Preference>
-
- <Preference
- android:fragment="com.android.settings.applications.ManageApplications"
- android:title="@string/runningservices_settings_title"
- android:summary="@string/runningservices_settings_summary">
- <extra android:name="classname" android:value="com.android.settings.Settings$RunningServicesActivity" />
- </Preference>
-
- <Preference
- android:fragment="com.android.settings.applications.ManageApplications"
- android:title="@string/storageuse_settings_title"
- android:summary="@string/storageuse_settings_summary">
- <extra android:name="classname"
- android:value="com.android.settings.Settings$StorageUseActivity" />
- </Preference>
-
- <CheckBoxPreference
- android:key="toggle_advanced_settings"
- android:title="@string/advanced_settings"
- android:summaryOff="@string/advanced_settings_summary"
- android:summaryOn="@string/advanced_settings_summary" />
-
- <ListPreference
- android:key="app_install_location"
- android:title="@string/app_install_location_title"
- android:summary="@string/app_install_location_summary"
- android:entries="@array/app_install_location_entries"
- android:entryValues="@array/app_install_location_values"/>
-
-</PreferenceScreen>
-
diff --git a/res/xml/security_settings_misc.xml b/res/xml/security_settings_misc.xml
index 7946dd9..94a4fea 100644
--- a/res/xml/security_settings_misc.xml
+++ b/res/xml/security_settings_misc.xml
@@ -76,7 +76,7 @@
<Preference android:key="usage_access"
android:title="@string/usage_access_title"
- android:fragment="com.android.settings.applications.ManageApplications">
+ android:fragment="com.android.settings.applications.manageapplications.ManageApplications">
<extra
android:name="classname"
android:value="com.android.settings.Settings$UsageAccessSettingsActivity" />
diff --git a/res/xml/special_access.xml b/res/xml/special_access.xml
index f0db8e7..32dcf8e 100644
--- a/res/xml/special_access.xml
+++ b/res/xml/special_access.xml
@@ -22,7 +22,7 @@
<Preference
android:key="high_power_apps"
android:title="@string/high_power_apps"
- android:fragment="com.android.settings.applications.ManageApplications"
+ android:fragment="com.android.settings.applications.manageapplications.ManageApplications"
settings:keywords="@string/keywords_ignore_optimizations">
<extra
android:name="classname"
@@ -37,7 +37,7 @@
<Preference
android:key="system_alert_window"
android:title="@string/system_alert_window_settings"
- android:fragment="com.android.settings.applications.ManageApplications"
+ android:fragment="com.android.settings.applications.manageapplications.ManageApplications"
settings:keywords="@string/keywords_system_alert_window">
<extra
android:name="classname"
@@ -52,7 +52,7 @@
<Preference
android:key="write_settings_apps"
android:title="@string/write_settings"
- android:fragment="com.android.settings.applications.ManageApplications"
+ android:fragment="com.android.settings.applications.manageapplications.ManageApplications"
settings:keywords="@string/keywords_write_settings">
<extra
android:name="classname"
@@ -83,7 +83,7 @@
<Preference
android:key="manage_external_sources"
android:title="@string/install_other_apps"
- android:fragment="com.android.settings.applications.ManageApplications"
+ android:fragment="com.android.settings.applications.manageapplications.ManageApplications"
settings:keywords="@string/keywords_install_other_apps">
<extra
android:name="classname"
@@ -93,7 +93,7 @@
<Preference
android:key="usage_access"
android:title="@string/usage_access"
- android:fragment="com.android.settings.applications.ManageApplications"
+ android:fragment="com.android.settings.applications.manageapplications.ManageApplications"
settings:keywords="@string/keywords_write_settings">
<extra
android:name="classname"
diff --git a/src/com/android/settings/ApplicationSettings.java b/src/com/android/settings/ApplicationSettings.java
deleted file mode 100644
index f005124..0000000
--- a/src/com/android/settings/ApplicationSettings.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (C) 2008 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;
-
-import android.content.Intent;
-import android.os.Bundle;
-import android.provider.Settings;
-import android.support.v7.preference.CheckBoxPreference;
-import android.support.v7.preference.ListPreference;
-import android.support.v7.preference.Preference;
-import android.support.v7.preference.Preference.OnPreferenceChangeListener;
-
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
-
-public class ApplicationSettings extends SettingsPreferenceFragment {
-
- private static final String KEY_TOGGLE_ADVANCED_SETTINGS = "toggle_advanced_settings";
- private static final String KEY_APP_INSTALL_LOCATION = "app_install_location";
-
- // App installation location. Default is ask the user.
- private static final int APP_INSTALL_AUTO = 0;
- private static final int APP_INSTALL_DEVICE = 1;
- private static final int APP_INSTALL_SDCARD = 2;
-
- private static final String APP_INSTALL_DEVICE_ID = "device";
- private static final String APP_INSTALL_SDCARD_ID = "sdcard";
- private static final String APP_INSTALL_AUTO_ID = "auto";
-
- private CheckBoxPreference mToggleAdvancedSettings;
- private ListPreference mInstallLocation;
-
- @Override
- public int getMetricsCategory() {
- return MetricsEvent.APPLICATION;
- }
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
-
- addPreferencesFromResource(R.xml.application_settings);
-
- mToggleAdvancedSettings = (CheckBoxPreference)findPreference(
- KEY_TOGGLE_ADVANCED_SETTINGS);
- mToggleAdvancedSettings.setChecked(isAdvancedSettingsEnabled());
- getPreferenceScreen().removePreference(mToggleAdvancedSettings);
-
- // not ready for prime time yet
- if (false) {
- getPreferenceScreen().removePreference(mInstallLocation);
- }
-
- mInstallLocation = (ListPreference) findPreference(KEY_APP_INSTALL_LOCATION);
- // Is app default install location set?
- boolean userSetInstLocation = (Settings.Global.getInt(getContentResolver(),
- Settings.Global.SET_INSTALL_LOCATION, 0) != 0);
- if (!userSetInstLocation) {
- getPreferenceScreen().removePreference(mInstallLocation);
- } else {
- mInstallLocation.setValue(getAppInstallLocation());
- mInstallLocation.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
- public boolean onPreferenceChange(Preference preference, Object newValue) {
- String value = (String) newValue;
- handleUpdateAppInstallLocation(value);
- return false;
- }
- });
- }
- }
-
- protected void handleUpdateAppInstallLocation(final String value) {
- if(APP_INSTALL_DEVICE_ID.equals(value)) {
- Settings.Global.putInt(getContentResolver(),
- Settings.Global.DEFAULT_INSTALL_LOCATION, APP_INSTALL_DEVICE);
- } else if (APP_INSTALL_SDCARD_ID.equals(value)) {
- Settings.Global.putInt(getContentResolver(),
- Settings.Global.DEFAULT_INSTALL_LOCATION, APP_INSTALL_SDCARD);
- } else if (APP_INSTALL_AUTO_ID.equals(value)) {
- Settings.Global.putInt(getContentResolver(),
- Settings.Global.DEFAULT_INSTALL_LOCATION, APP_INSTALL_AUTO);
- } else {
- // Should not happen, default to prompt...
- Settings.Global.putInt(getContentResolver(),
- Settings.Global.DEFAULT_INSTALL_LOCATION, APP_INSTALL_AUTO);
- }
- mInstallLocation.setValue(value);
- }
-
- @Override
- public boolean onPreferenceTreeClick(Preference preference) {
- if (preference == mToggleAdvancedSettings) {
- boolean value = mToggleAdvancedSettings.isChecked();
- setAdvancedSettingsEnabled(value);
- }
-
- return super.onPreferenceTreeClick(preference);
- }
-
- private boolean isAdvancedSettingsEnabled() {
- return Settings.System.getInt(getContentResolver(),
- Settings.System.ADVANCED_SETTINGS,
- Settings.System.ADVANCED_SETTINGS_DEFAULT) > 0;
- }
-
- private void setAdvancedSettingsEnabled(boolean enabled) {
- int value = enabled ? 1 : 0;
- // Change the system setting
- Settings.Secure.putInt(getContentResolver(), Settings.System.ADVANCED_SETTINGS, value);
- // TODO: the settings thing should broadcast this for thread safety purposes.
- Intent intent = new Intent(Intent.ACTION_ADVANCED_SETTINGS_CHANGED);
- intent.putExtra("state", value);
- getActivity().sendBroadcast(intent);
- }
-
- private String getAppInstallLocation() {
- int selectedLocation = Settings.Global.getInt(getContentResolver(),
- Settings.Global.DEFAULT_INSTALL_LOCATION, APP_INSTALL_AUTO);
- if (selectedLocation == APP_INSTALL_DEVICE) {
- return APP_INSTALL_DEVICE_ID;
- } else if (selectedLocation == APP_INSTALL_SDCARD) {
- return APP_INSTALL_SDCARD_ID;
- } else if (selectedLocation == APP_INSTALL_AUTO) {
- return APP_INSTALL_AUTO_ID;
- } else {
- // Default value, should not happen.
- return APP_INSTALL_AUTO_ID;
- }
- }
-}
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index 089ffac..3a7382a 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -56,7 +56,6 @@
public static class ApplicationSettingsActivity extends SettingsActivity { /* empty */ }
public static class ManageApplicationsActivity extends SettingsActivity { /* empty */ }
public static class ManageAssistActivity extends SettingsActivity { /* empty */ }
- public static class AllApplicationsActivity extends SettingsActivity { /* empty */ }
public static class HighPowerApplicationsActivity extends SettingsActivity { /* empty */ }
public static class AppOpsSummaryActivity extends SettingsActivity {
@Override
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index c927889..973c216 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -53,6 +53,7 @@
import com.android.internal.util.ArrayUtils;
import com.android.settings.Settings.WifiSettingsActivity;
+import com.android.settings.applications.manageapplications.ManageApplications;
import com.android.settings.backup.BackupSettingsActivity;
import com.android.settings.core.gateway.SettingsGateway;
import com.android.settings.core.instrumentation.MetricsFeatureProvider;
@@ -594,11 +595,10 @@
String intentClass = intent.getComponent().getClassName();
if (intentClass.equals(getClass().getName())) return null;
- if ("com.android.settings.ManageApplications".equals(intentClass)
- || "com.android.settings.RunningServices".equals(intentClass)
+ if ("com.android.settings.RunningServices".equals(intentClass)
|| "com.android.settings.applications.StorageUse".equals(intentClass)) {
// Old names of manage apps.
- intentClass = com.android.settings.applications.ManageApplications.class.getName();
+ intentClass = ManageApplications.class.getName();
}
return intentClass;
diff --git a/src/com/android/settings/applications/AppInfoBase.java b/src/com/android/settings/applications/AppInfoBase.java
index ddf3bf5..f20944d 100644
--- a/src/com/android/settings/applications/AppInfoBase.java
+++ b/src/com/android/settings/applications/AppInfoBase.java
@@ -16,6 +16,8 @@
package com.android.settings.applications;
+import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
+
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
@@ -42,6 +44,7 @@
import com.android.settings.SettingsActivity;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.Utils;
+import com.android.settings.applications.manageapplications.ManageApplications;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.wrapper.DevicePolicyManagerWrapper;
@@ -51,8 +54,6 @@
import java.util.ArrayList;
-import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
-
public abstract class AppInfoBase extends SettingsPreferenceFragment
implements ApplicationsState.Callbacks {
diff --git a/src/com/android/settings/applications/AppOpsDetails.java b/src/com/android/settings/applications/AppOpsDetails.java
index b488af6..0e41cab 100644
--- a/src/com/android/settings/applications/AppOpsDetails.java
+++ b/src/com/android/settings/applications/AppOpsDetails.java
@@ -40,6 +40,7 @@
import android.widget.TextView;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+import com.android.settings.applications.manageapplications.ManageApplications;
import com.android.settings.core.InstrumentedPreferenceFragment;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
diff --git a/src/com/android/settings/applications/AppStateInstallAppsBridge.java b/src/com/android/settings/applications/AppStateInstallAppsBridge.java
index cc7fb62..0c3582e 100644
--- a/src/com/android/settings/applications/AppStateInstallAppsBridge.java
+++ b/src/com/android/settings/applications/AppStateInstallAppsBridge.java
@@ -135,7 +135,7 @@
}
}
- static final AppFilter FILTER_APP_SOURCES = new AppFilter() {
+ public static final AppFilter FILTER_APP_SOURCES = new AppFilter() {
@Override
public void init() {
diff --git a/src/com/android/settings/applications/ExternalSourcesDetails.java b/src/com/android/settings/applications/ExternalSourcesDetails.java
index 36ce8f8..5cd3c44 100644
--- a/src/com/android/settings/applications/ExternalSourcesDetails.java
+++ b/src/com/android/settings/applications/ExternalSourcesDetails.java
@@ -15,6 +15,9 @@
*/
package com.android.settings.applications;
+import static android.app.Activity.RESULT_CANCELED;
+import static android.app.Activity.RESULT_OK;
+
import android.app.AlertDialog;
import android.app.AppOpsManager;
import android.content.Context;
@@ -31,9 +34,6 @@
import com.android.settingslib.RestrictedSwitchPreference;
import com.android.settingslib.applications.ApplicationsState.AppEntry;
-import static android.app.Activity.RESULT_CANCELED;
-import static android.app.Activity.RESULT_OK;
-
public class ExternalSourcesDetails extends AppInfoWithHeader
implements OnPreferenceChangeListener {
@@ -76,7 +76,7 @@
return false;
}
- static CharSequence getPreferenceSummary(Context context, AppEntry entry) {
+ public static CharSequence getPreferenceSummary(Context context, AppEntry entry) {
final UserManager um = UserManager.get(context);
final int userRestrictionSource = um.getUserRestrictionSource(
UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES,
diff --git a/src/com/android/settings/applications/NotificationApps.java b/src/com/android/settings/applications/NotificationApps.java
index ee802dd..f921092 100644
--- a/src/com/android/settings/applications/NotificationApps.java
+++ b/src/com/android/settings/applications/NotificationApps.java
@@ -19,6 +19,7 @@
import android.content.pm.ApplicationInfo;
import com.android.settings.R;
+import com.android.settings.applications.manageapplications.ManageApplications;
import com.android.settings.dashboard.SummaryLoader;
import com.android.settings.notification.NotificationBackend;
import com.android.settingslib.wrapper.PackageManagerWrapper;
diff --git a/src/com/android/settings/applications/AppViewHolder.java b/src/com/android/settings/applications/manageapplications/AppViewHolder.java
similarity index 97%
rename from src/com/android/settings/applications/AppViewHolder.java
rename to src/com/android/settings/applications/manageapplications/AppViewHolder.java
index cdb8048..7b9d766 100644
--- a/src/com/android/settings/applications/AppViewHolder.java
+++ b/src/com/android/settings/applications/manageapplications/AppViewHolder.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.settings.applications;
+package com.android.settings.applications.manageapplications;
import android.util.Log;
import android.view.LayoutInflater;
diff --git a/src/com/android/settings/applications/FileViewHolderController.java b/src/com/android/settings/applications/manageapplications/FileViewHolderController.java
similarity index 89%
rename from src/com/android/settings/applications/FileViewHolderController.java
rename to src/com/android/settings/applications/manageapplications/FileViewHolderController.java
index e8af722..03e2e55 100644
--- a/src/com/android/settings/applications/FileViewHolderController.java
+++ b/src/com/android/settings/applications/manageapplications/FileViewHolderController.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2015 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.
@@ -11,13 +11,12 @@
* 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
+ * limitations under the License.
*/
-package com.android.settings.applications;
+package com.android.settings.applications.manageapplications;
import android.app.Fragment;
-import android.view.View;
/**
* FileViewHolderController handles adapting the AppViewHolder to work as a general purpose
diff --git a/src/com/android/settings/applications/ManageApplications.java b/src/com/android/settings/applications/manageapplications/ManageApplications.java
similarity index 97%
rename from src/com/android/settings/applications/ManageApplications.java
rename to src/com/android/settings/applications/manageapplications/ManageApplications.java
index aaef169..c0732f5 100644
--- a/src/com/android/settings/applications/ManageApplications.java
+++ b/src/com/android/settings/applications/manageapplications/ManageApplications.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.settings.applications;
+package com.android.settings.applications.manageapplications;
import android.annotation.IdRes;
import android.annotation.Nullable;
@@ -60,7 +60,6 @@
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.Settings;
-import com.android.settings.Settings.AllApplicationsActivity;
import com.android.settings.Settings.GamesStorageActivity;
import com.android.settings.Settings.HighPowerApplicationsActivity;
import com.android.settings.Settings.ManageExternalSourcesActivity;
@@ -72,8 +71,25 @@
import com.android.settings.Settings.WriteSettingsActivity;
import com.android.settings.SettingsActivity;
import com.android.settings.Utils;
+import com.android.settings.applications.AppInfoBase;
import com.android.settings.applications.AppStateAppOpsBridge.PermissionState;
+import com.android.settings.applications.AppStateBaseBridge;
+import com.android.settings.applications.AppStateInstallAppsBridge;
+import com.android.settings.applications.AppStateNotificationBridge;
+import com.android.settings.applications.AppStateOverlayBridge;
+import com.android.settings.applications.AppStatePowerBridge;
+import com.android.settings.applications.AppStateUsageBridge;
import com.android.settings.applications.AppStateUsageBridge.UsageState;
+import com.android.settings.applications.AppStateWriteSettingsBridge;
+import com.android.settings.applications.AppStorageSettings;
+import com.android.settings.applications.DefaultAppSettings;
+import com.android.settings.applications.DrawOverlayDetails;
+import com.android.settings.applications.ExternalSourcesDetails;
+import com.android.settings.applications.InstalledAppCounter;
+import com.android.settings.applications.InstalledAppDetails;
+import com.android.settings.applications.NotificationApps;
+import com.android.settings.applications.UsageAccessDetails;
+import com.android.settings.applications.WriteSettingsDetails;
import com.android.settings.core.InstrumentedPreferenceFragment;
import com.android.settings.dashboard.SummaryLoader;
import com.android.settings.fuelgauge.HighPowerDetail;
@@ -299,9 +315,7 @@
if (className == null) {
className = intent.getComponent().getClassName();
}
- if (className.equals(AllApplicationsActivity.class.getName())) {
- mShowSystem = true;
- } else if (className.equals(NotificationAppListActivity.class.getName())
+ if (className.equals(NotificationAppListActivity.class.getName())
|| this instanceof NotificationApps) {
mListType = LIST_TYPE_NOTIFICATION;
mNotifBackend = new NotificationBackend();
@@ -354,7 +368,6 @@
mResetAppsHelper = new ResetAppsHelper(getActivity());
}
-
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
diff --git a/src/com/android/settings/applications/MusicViewHolderController.java b/src/com/android/settings/applications/manageapplications/MusicViewHolderController.java
similarity index 94%
rename from src/com/android/settings/applications/MusicViewHolderController.java
rename to src/com/android/settings/applications/manageapplications/MusicViewHolderController.java
index af822a0..1e44047 100644
--- a/src/com/android/settings/applications/MusicViewHolderController.java
+++ b/src/com/android/settings/applications/manageapplications/MusicViewHolderController.java
@@ -11,10 +11,10 @@
* 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
+ * limitations under the License.
*/
-package com.android.settings.applications;
+package com.android.settings.applications.manageapplications;
import android.app.Fragment;
import android.content.Context;
@@ -36,7 +36,7 @@
* MusicViewHolderController controls an Audio/Music file view in the ManageApplications view.
*/
public class MusicViewHolderController implements FileViewHolderController {
- private static final String TAG = "MusicViewHolderController";
+ private static final String TAG = "MusicViewHolderCtrl";
private static final String AUTHORITY_MEDIA = "com.android.providers.media.documents";
private static final int INSET_SIZE = 24; // dp
diff --git a/src/com/android/settings/applications/PhotosViewHolderController.java b/src/com/android/settings/applications/manageapplications/PhotosViewHolderController.java
similarity index 94%
rename from src/com/android/settings/applications/PhotosViewHolderController.java
rename to src/com/android/settings/applications/manageapplications/PhotosViewHolderController.java
index a652bb1..2d77f26 100644
--- a/src/com/android/settings/applications/PhotosViewHolderController.java
+++ b/src/com/android/settings/applications/manageapplications/PhotosViewHolderController.java
@@ -11,10 +11,10 @@
* 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
+ * limitations under the License.
*/
-package com.android.settings.applications;
+package com.android.settings.applications.manageapplications;
import android.app.Fragment;
import android.content.Context;
@@ -33,7 +33,7 @@
/** PhotosViewHolderController controls an Audio/Music file view in the ManageApplications view. */
public class PhotosViewHolderController implements FileViewHolderController {
- private static final String TAG = "PhotosViewHolderController";
+ private static final String TAG = "PhotosViewHolderCtrl";
private static final String IMAGE_MIME_TYPE = "image/*";
private static final int INSET_SIZE = 24; // dp
diff --git a/src/com/android/settings/applications/ResetAppPrefPreferenceController.java b/src/com/android/settings/applications/manageapplications/ResetAppPrefPreferenceController.java
similarity index 97%
rename from src/com/android/settings/applications/ResetAppPrefPreferenceController.java
rename to src/com/android/settings/applications/manageapplications/ResetAppPrefPreferenceController.java
index 2766c59..d7f6c6e 100644
--- a/src/com/android/settings/applications/ResetAppPrefPreferenceController.java
+++ b/src/com/android/settings/applications/manageapplications/ResetAppPrefPreferenceController.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.settings.applications;
+package com.android.settings.applications.manageapplications;
import android.content.Context;
import android.os.Bundle;
diff --git a/src/com/android/settings/applications/ResetAppsHelper.java b/src/com/android/settings/applications/manageapplications/ResetAppsHelper.java
similarity index 98%
rename from src/com/android/settings/applications/ResetAppsHelper.java
rename to src/com/android/settings/applications/manageapplications/ResetAppsHelper.java
index 93d384d..686e027 100644
--- a/src/com/android/settings/applications/ResetAppsHelper.java
+++ b/src/com/android/settings/applications/manageapplications/ResetAppsHelper.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.settings.applications;
+package com.android.settings.applications.manageapplications;
import static android.net.NetworkPolicyManager.POLICY_NONE;
import static android.net.NetworkPolicyManager.POLICY_REJECT_METERED_BACKGROUND;
diff --git a/src/com/android/settings/core/gateway/SettingsGateway.java b/src/com/android/settings/core/gateway/SettingsGateway.java
index 8ee61c6..0cbca2a 100644
--- a/src/com/android/settings/core/gateway/SettingsGateway.java
+++ b/src/com/android/settings/core/gateway/SettingsGateway.java
@@ -45,7 +45,7 @@
import com.android.settings.applications.DrawOverlayDetails;
import com.android.settings.applications.ExternalSourcesDetails;
import com.android.settings.applications.InstalledAppDetails;
-import com.android.settings.applications.ManageApplications;
+import com.android.settings.applications.manageapplications.ManageApplications;
import com.android.settings.applications.ManageDomainUrls;
import com.android.settings.applications.NotificationApps;
import com.android.settings.applications.PictureInPictureDetails;
diff --git a/src/com/android/settings/development/AppPicker.java b/src/com/android/settings/development/AppPicker.java
index 480a0ec..d038b8f 100644
--- a/src/com/android/settings/development/AppPicker.java
+++ b/src/com/android/settings/development/AppPicker.java
@@ -32,7 +32,7 @@
import android.widget.ListView;
import com.android.settings.R;
-import com.android.settings.applications.AppViewHolder;
+import com.android.settings.applications.manageapplications.AppViewHolder;
import java.text.Collator;
import java.util.ArrayList;
diff --git a/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java b/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java
index 04da586..f3ef4c7 100644
--- a/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java
+++ b/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java
@@ -19,7 +19,6 @@
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.Fragment;
-import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -57,7 +56,7 @@
import com.android.settings.Settings.StorageUseActivity;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.Utils;
-import com.android.settings.applications.ManageApplications;
+import com.android.settings.applications.manageapplications.ManageApplications;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settings.deviceinfo.StorageSettings.MountTask;
import com.android.settingslib.deviceinfo.StorageMeasurement;
diff --git a/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceController.java b/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceController.java
index 7f2cc33..1149b99 100644
--- a/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceController.java
@@ -36,7 +36,7 @@
import com.android.settings.R;
import com.android.settings.Settings;
import com.android.settings.Utils;
-import com.android.settings.applications.ManageApplications;
+import com.android.settings.applications.manageapplications.ManageApplications;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settings.core.instrumentation.MetricsFeatureProvider;
import com.android.settings.deviceinfo.PrivateVolumeSettings.SystemInfoFragment;
diff --git a/src/com/android/settings/fuelgauge/BatteryOptimizationPreferenceController.java b/src/com/android/settings/fuelgauge/BatteryOptimizationPreferenceController.java
index 53a3770..10e4280 100644
--- a/src/com/android/settings/fuelgauge/BatteryOptimizationPreferenceController.java
+++ b/src/com/android/settings/fuelgauge/BatteryOptimizationPreferenceController.java
@@ -22,7 +22,7 @@
import com.android.settings.R;
import com.android.settings.Settings;
import com.android.settings.SettingsActivity;
-import com.android.settings.applications.ManageApplications;
+import com.android.settings.applications.manageapplications.ManageApplications;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.core.AbstractPreferenceController;
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummary.java b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
index 1955638..8a107a2 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
@@ -56,7 +56,7 @@
import com.android.settings.SettingsActivity;
import com.android.settings.Utils;
import com.android.settings.applications.LayoutPreference;
-import com.android.settings.applications.ManageApplications;
+import com.android.settings.applications.manageapplications.ManageApplications;
import com.android.settings.core.instrumentation.MetricsFeatureProvider;
import com.android.settings.dashboard.SummaryLoader;
import com.android.settings.display.AmbientDisplayPreferenceController;
diff --git a/src/com/android/settings/search/InstalledAppResultLoader.java b/src/com/android/settings/search/InstalledAppResultLoader.java
index 69a4693..7645c15 100644
--- a/src/com/android/settings/search/InstalledAppResultLoader.java
+++ b/src/com/android/settings/search/InstalledAppResultLoader.java
@@ -33,7 +33,7 @@
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
-import com.android.settings.applications.ManageApplications;
+import com.android.settings.applications.manageapplications.ManageApplications;
import com.android.settings.dashboard.SiteMapManager;
import com.android.settings.utils.AsyncLoader;
import com.android.settingslib.wrapper.PackageManagerWrapper;
diff --git a/src/com/android/settings/system/ResetDashboardFragment.java b/src/com/android/settings/system/ResetDashboardFragment.java
index 48295a4..b7b6b77 100644
--- a/src/com/android/settings/system/ResetDashboardFragment.java
+++ b/src/com/android/settings/system/ResetDashboardFragment.java
@@ -21,7 +21,7 @@
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
-import com.android.settings.applications.ResetAppPrefPreferenceController;
+import com.android.settings.applications.manageapplications.ResetAppPrefPreferenceController;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.network.NetworkResetPreferenceController;
import com.android.settings.search.BaseSearchIndexProvider;
diff --git a/tests/robotests/assets/grandfather_not_implementing_indexable b/tests/robotests/assets/grandfather_not_implementing_indexable
index 17c8133..1a09062 100644
--- a/tests/robotests/assets/grandfather_not_implementing_indexable
+++ b/tests/robotests/assets/grandfather_not_implementing_indexable
@@ -85,7 +85,6 @@
com.android.settings.password.ChooseLockGeneric$ChooseLockGenericFragment
com.android.settings.IccLockSettings
com.android.settings.TetherSettings
-com.android.settings.ApplicationSettings
com.android.settings.ApnEditor
com.android.settings.UserCredentialsSettings
com.android.settings.TestingSettings
diff --git a/tests/robotests/res/xml-mcc999/display_settings.xml b/tests/robotests/res/xml-mcc999/display_settings.xml
index 4e0ce6b..8c5d47a 100644
--- a/tests/robotests/res/xml-mcc999/display_settings.xml
+++ b/tests/robotests/res/xml-mcc999/display_settings.xml
@@ -50,6 +50,8 @@
android:key="pref_key_4"
android:title="pref_title_4"
android:summary="summary_4"
+ android:entries="@array/app_install_location_entries"
+ android:entryValues="@array/app_install_location_values"
settings:keywords="keywords1, keywords2, keywords3" />
<CheckBoxPreference
diff --git a/tests/robotests/src/com/android/settings/applications/ManageApplicationsTest.java b/tests/robotests/src/com/android/settings/applications/manageapplications/ManageApplicationsTest.java
similarity index 99%
rename from tests/robotests/src/com/android/settings/applications/ManageApplicationsTest.java
rename to tests/robotests/src/com/android/settings/applications/manageapplications/ManageApplicationsTest.java
index 8ed7284..5f3c992 100644
--- a/tests/robotests/src/com/android/settings/applications/ManageApplicationsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/manageapplications/ManageApplicationsTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.settings.applications;
+package com.android.settings.applications.manageapplications;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Matchers.any;
diff --git a/tests/robotests/src/com/android/settings/applications/MusicViewHolderControllerTest.java b/tests/robotests/src/com/android/settings/applications/manageapplications/MusicViewHolderControllerTest.java
similarity index 97%
rename from tests/robotests/src/com/android/settings/applications/MusicViewHolderControllerTest.java
rename to tests/robotests/src/com/android/settings/applications/manageapplications/MusicViewHolderControllerTest.java
index 3d04c73..46a059a 100644
--- a/tests/robotests/src/com/android/settings/applications/MusicViewHolderControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/manageapplications/MusicViewHolderControllerTest.java
@@ -11,13 +11,12 @@
* 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
+ * limitations under the License.
*/
-package com.android.settings.applications;
+package com.android.settings.applications.manageapplications;
import static com.google.common.truth.Truth.assertThat;
-
import static org.mockito.Matchers.nullable;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -30,8 +29,8 @@
import android.provider.DocumentsContract;
import android.view.LayoutInflater;
-import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.TestConfig;
+import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settingslib.applications.StorageStatsSource;
import com.android.settingslib.deviceinfo.StorageVolumeProvider;
diff --git a/tests/robotests/src/com/android/settings/applications/PhotosViewHolderControllerTest.java b/tests/robotests/src/com/android/settings/applications/manageapplications/PhotosViewHolderControllerTest.java
similarity index 81%
rename from tests/robotests/src/com/android/settings/applications/PhotosViewHolderControllerTest.java
rename to tests/robotests/src/com/android/settings/applications/manageapplications/PhotosViewHolderControllerTest.java
index 7bf338d..a051ac3 100644
--- a/tests/robotests/src/com/android/settings/applications/PhotosViewHolderControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/manageapplications/PhotosViewHolderControllerTest.java
@@ -1,7 +1,22 @@
-package com.android.settings.applications;
+/*
+ * Copyright (C) 2017 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.manageapplications;
import static com.google.common.truth.Truth.assertThat;
-
import static org.mockito.Matchers.nullable;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceControllerTest.java
index ddd3d47..e6c161e 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceControllerTest.java
@@ -16,8 +16,8 @@
package com.android.settings.deviceinfo.storage;
-import static com.android.settings.applications.ManageApplications.EXTRA_WORK_ID;
-import static com.android.settings.applications.ManageApplications.EXTRA_WORK_ONLY;
+import static com.android.settings.applications.manageapplications.ManageApplications.EXTRA_WORK_ID;
+import static com.android.settings.applications.manageapplications.ManageApplications.EXTRA_WORK_ONLY;
import static com.android.settings.utils.FileSizeFormatter.MEGABYTE_IN_BYTES;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.nullable;
@@ -45,7 +45,7 @@
import com.android.settings.SettingsActivity;
import com.android.settings.SubSettings;
import com.android.settings.TestConfig;
-import com.android.settings.applications.ManageApplications;
+import com.android.settings.applications.manageapplications.ManageApplications;
import com.android.settings.core.instrumentation.MetricsFeatureProvider;
import com.android.settings.deviceinfo.PrivateVolumeSettings;
import com.android.settings.deviceinfo.StorageItemPreference;
diff --git a/tests/robotests/src/com/android/settings/search/XmlParserUtilTest.java b/tests/robotests/src/com/android/settings/search/XmlParserUtilTest.java
index 5d2a977..b2ce3a7 100644
--- a/tests/robotests/src/com/android/settings/search/XmlParserUtilTest.java
+++ b/tests/robotests/src/com/android/settings/search/XmlParserUtilTest.java
@@ -17,14 +17,16 @@
package com.android.settings.search;
-import android.content.res.XmlResourceParser;
+import static com.google.common.truth.Truth.assertThat;
+
import android.content.Context;
+import android.content.res.XmlResourceParser;
import android.util.AttributeSet;
import android.util.Xml;
-import com.android.settings.testutils.SettingsRobolectricTestRunner;
-import com.android.settings.TestConfig;
import com.android.settings.R;
+import com.android.settings.TestConfig;
+import com.android.settings.testutils.SettingsRobolectricTestRunner;
import org.junit.Before;
import org.junit.Test;
@@ -33,8 +35,6 @@
import org.robolectric.shadows.ShadowApplication;
import org.xmlpull.v1.XmlPullParser;
-import static com.google.common.truth.Truth.assertThat;
-
/**
* These tests use a series of preferences that have specific attributes which are sometimes
* uncommon (such as summaryOn).
@@ -94,26 +94,21 @@
}
@Test
- public void testDataSummaryOnValid_ReturnsPreferenceSummaryOn() {
- XmlResourceParser parser = getChildByType(R.xml.application_settings, "CheckBoxPreference");
+ @Config(qualifiers = "mcc999")
+ public void testDataSummaryOnOffValid_ReturnsPreferenceSummaryOnOff() {
+ XmlResourceParser parser = getChildByType(R.xml.display_settings, "CheckBoxPreference");
final AttributeSet attrs = Xml.asAttributeSet(parser);
- String summary = XmlParserUtils.getDataSummaryOn(mContext, attrs);
- String expSummary = mContext.getString(R.string.advanced_settings_summary);
- assertThat(summary).isEqualTo(expSummary);
+
+ assertThat(XmlParserUtils.getDataSummaryOn(mContext, attrs))
+ .isEqualTo("summary_on");
+ assertThat(XmlParserUtils.getDataSummaryOff(mContext, attrs))
+ .isEqualTo("summary_off");
}
@Test
- public void testDataSummaryOffValid_ReturnsPreferenceSummaryOff() {
- XmlResourceParser parser = getChildByType(R.xml.application_settings, "CheckBoxPreference");
- final AttributeSet attrs = Xml.asAttributeSet(parser);
- String summary = XmlParserUtils.getDataSummaryOff(mContext, attrs);
- String expSummary = mContext.getString(R.string.advanced_settings_summary);
- assertThat(summary).isEqualTo(expSummary);
- }
-
- @Test
+ @Config(qualifiers = "mcc999")
public void testDataEntriesValid_ReturnsPreferenceEntries() {
- XmlResourceParser parser = getChildByType(R.xml.application_settings, "ListPreference");
+ XmlResourceParser parser = getChildByType(R.xml.display_settings, "ListPreference");
final AttributeSet attrs = Xml.asAttributeSet(parser);
String entries = XmlParserUtils.getDataEntries(mContext, attrs);
String[] expEntries = mContext.getResources()
@@ -124,7 +119,6 @@
}
// Null checks
-
@Test
public void testDataKeyInvalid_ReturnsNull() {
XmlResourceParser parser = getParentPrimedParser(R.xml.display_settings);
@@ -185,7 +179,7 @@
while ((type = parser.next()) != XmlPullParser.END_DOCUMENT
&& type != XmlPullParser.START_TAG) {
}
- while(parser.getName() != xmlType) {
+ while (parser.getName() != xmlType) {
parser.next();
}
} catch (Exception e) {
diff --git a/tests/unit/src/com/android/settings/applications/ManageApplicationsUnitTest.java b/tests/unit/src/com/android/settings/applications/manageapplications/ManageApplicationsUnitTest.java
similarity index 94%
rename from tests/unit/src/com/android/settings/applications/ManageApplicationsUnitTest.java
rename to tests/unit/src/com/android/settings/applications/manageapplications/ManageApplicationsUnitTest.java
index ce8603b..87a24d6 100644
--- a/tests/unit/src/com/android/settings/applications/ManageApplicationsUnitTest.java
+++ b/tests/unit/src/com/android/settings/applications/manageapplications/ManageApplicationsUnitTest.java
@@ -14,7 +14,10 @@
* limitations under the License.
*/
-package com.android.settings.applications;
+package com.android.settings.applications.manageapplications;
+
+import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.mock;
import android.content.pm.ApplicationInfo;
import android.support.test.filters.SmallTest;
@@ -23,15 +26,13 @@
import com.android.settingslib.applications.AppUtils;
import com.android.settingslib.applications.ApplicationsState;
import com.android.settingslib.applications.ApplicationsState.AppFilter;
-
import com.android.settingslib.applications.ApplicationsState.CompoundFilter;
import com.android.settingslib.applications.instantapps.InstantAppDataProvider;
-import java.lang.reflect.Field;
+
import org.junit.Test;
import org.junit.runner.RunWith;
-import static com.google.common.truth.Truth.assertThat;
-import static org.mockito.Mockito.mock;
+import java.lang.reflect.Field;
@SmallTest
@RunWith(AndroidJUnit4.class)
@@ -101,10 +102,10 @@
field.set(AppUtils.class, (InstantAppDataProvider) (i -> true));
AppFilter filter =
- ManageApplications.getCompositeFilter(
- ManageApplications.LIST_TYPE_STORAGE,
- ManageApplications.STORAGE_TYPE_MUSIC,
- "uuid");
+ ManageApplications.getCompositeFilter(
+ ManageApplications.LIST_TYPE_STORAGE,
+ ManageApplications.STORAGE_TYPE_MUSIC,
+ "uuid");
AppFilter composedFilter = new CompoundFilter(ApplicationsState.FILTER_INSTANT, filter);
final ApplicationInfo info = new ApplicationInfo();