Add intent filter to launch usage access for app.
Change-Id: Ide8aa590f9b4218d0f4affe65a7daec384480798 Fixes: 110200770 Test: adb shell am start -a android.settings.USAGE_ACCESS_SETTINGS -d package:com.android.settings
This commit is contained in:
@@ -1382,6 +1382,21 @@
|
||||
android:value="com.android.settings.applications.manageapplications.ManageApplications" />
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="Settings$AppUsageAccessSettingsActivity"
|
||||
android:label="@string/usage_access_title"
|
||||
android:taskAffinity="com.android.settings"
|
||||
android:parentActivityName="Settings">
|
||||
<intent-filter>
|
||||
<action android:name="android.settings.USAGE_ACCESS_SETTINGS"/>
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<data android:scheme="package"/>
|
||||
</intent-filter>
|
||||
<meta-data
|
||||
android:name="com.android.settings.FRAGMENT_CLASS"
|
||||
android:value="com.android.settings.applications.UsageAccessDetails"/>
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$IccLockSettingsActivity"
|
||||
android:label="@string/sim_lock_settings"
|
||||
android:process="com.android.phone">
|
||||
|
@@ -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 */ }
|
||||
|
@@ -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 */);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user