Merge "Fixed AccessPreference listener." into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
40c228d989
@@ -227,19 +227,20 @@ public class UnrestrictedDataAccess extends SettingsPreferenceFragment
|
|||||||
if (mEntry.icon != null) {
|
if (mEntry.icon != null) {
|
||||||
setIcon(mEntry.icon);
|
setIcon(mEntry.icon);
|
||||||
}
|
}
|
||||||
setOnPreferenceClickListener( new OnPreferenceClickListener() {
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceClick(Preference pref) {
|
protected void onClick() {
|
||||||
if (mState.isDataSaverBlacklisted) {
|
if (mState.isDataSaverBlacklisted) {
|
||||||
InstalledAppDetails.startAppInfoFragment(AppDataUsage.class,
|
// app is blacklisted, launch App Data Usage screen
|
||||||
context.getString(R.string.app_data_usage),
|
InstalledAppDetails.startAppInfoFragment(AppDataUsage.class,
|
||||||
UnrestrictedDataAccess.this,
|
getContext().getString(R.string.app_data_usage),
|
||||||
mEntry);
|
UnrestrictedDataAccess.this,
|
||||||
return false;
|
mEntry);
|
||||||
}
|
} else {
|
||||||
return true;
|
// app is not blacklisted, let superclass handle toggle switch
|
||||||
}});
|
super.onClick();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sets UI state based on whitelist/blacklist status.
|
// Sets UI state based on whitelist/blacklist status.
|
||||||
|
Reference in New Issue
Block a user