Merge "Add intent filter to launch usage access for app."

This commit is contained in:
TreeHugger Robot
2018-09-21 21:31:38 +00:00
committed by Android (Google) Code Review
5 changed files with 24 additions and 7 deletions

View File

@@ -68,6 +68,7 @@ public class Settings extends SettingsActivity {
public static class AccessibilityDaltonizerSettingsActivity extends SettingsActivity { /* empty */ }
public static class SecurityDashboardActivity extends SettingsActivity { /* empty */ }
public static class UsageAccessSettingsActivity extends SettingsActivity { /* empty */ }
public static class AppUsageAccessSettingsActivity extends SettingsActivity { /* empty */ }
public static class LocationSettingsActivity extends SettingsActivity { /* empty */ }
public static class ScanningSettingsActivity extends SettingsActivity { /* empty */ }
public static class PrivacySettingsActivity extends SettingsActivity { /* empty */ }

View File

@@ -60,8 +60,7 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment
public static final String ARG_PACKAGE_NAME = "package";
public static final String ARG_PACKAGE_UID = "uid";
protected static final String TAG = AppInfoBase.class.getSimpleName();
protected static final boolean localLOGV = false;
private static final String TAG = "AppInfoBase";
protected EnforcedAdmin mAppsControlDisallowedAdmin;
protected boolean mAppsControlDisallowedBySystem;
@@ -113,7 +112,7 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment
getActivity(), UserManager.DISALLOW_APPS_CONTROL, mUserId);
if (!refreshUi()) {
setIntentAndFinish(true, true);
setIntentAndFinish(true /* appChanged */);
}
}
@@ -159,8 +158,8 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment
return mPackageName;
}
protected void setIntentAndFinish(boolean finish, boolean appChanged) {
if (localLOGV) Log.i(TAG, "appChanged=" + appChanged);
protected void setIntentAndFinish(boolean appChanged) {
Log.i(TAG, "appChanged=" + appChanged);
Intent intent = new Intent();
intent.putExtra(ManageApplications.APP_CHG, appChanged);
SettingsActivity sa = (SettingsActivity) getActivity();
@@ -216,7 +215,7 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment
@Override
public void onPackageListChanged() {
if (!refreshUi()) {
setIntentAndFinish(true, true);
setIntentAndFinish(true /* appChanged */);
}
}

View File

@@ -30,6 +30,8 @@ import com.android.settingslib.applications.AppUtils;
public abstract class AppInfoWithHeader extends AppInfoBase {
private static final String TAG = "AppInfoWithHeader";
private boolean mCreated;
@Override

View File

@@ -510,7 +510,7 @@ public class AppStorageSettings extends AppInfoWithHeader
public void onClick(DialogInterface dialog, int which) {
mButtonsPref.setButton1Enabled(false);
//force to recompute changed value
setIntentAndFinish(false, false);
setIntentAndFinish(false /* appChanged */);
}
})
.create();