Merge "Start activity for the correct user in Settings > Data Usage" into lmp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
1e0ea45263
@@ -402,7 +402,6 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
|
|||||||
mAppSwitches = (LinearLayout) mAppDetail.findViewById(R.id.app_switches);
|
mAppSwitches = (LinearLayout) mAppDetail.findViewById(R.id.app_switches);
|
||||||
|
|
||||||
mAppSettings = (Button) mAppDetail.findViewById(R.id.app_settings);
|
mAppSettings = (Button) mAppDetail.findViewById(R.id.app_settings);
|
||||||
mAppSettings.setOnClickListener(mAppSettingsListener);
|
|
||||||
|
|
||||||
mAppRestrict = new Switch(inflater.getContext());
|
mAppRestrict = new Switch(inflater.getContext());
|
||||||
mAppRestrict.setClickable(false);
|
mAppRestrict.setClickable(false);
|
||||||
@@ -860,11 +859,24 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mAppSettings.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (!isAdded()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: target towards entire UID instead of just first package
|
||||||
|
getActivity().startActivityAsUser(mAppSettingsIntent,
|
||||||
|
new UserHandle(UserHandle.getUserId(uid)));
|
||||||
|
}
|
||||||
|
});
|
||||||
mAppSettings.setEnabled(matchFound);
|
mAppSettings.setEnabled(matchFound);
|
||||||
mAppSettings.setVisibility(View.VISIBLE);
|
mAppSettings.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
mAppSettingsIntent = null;
|
mAppSettingsIntent = null;
|
||||||
|
mAppSettings.setOnClickListener(null);
|
||||||
mAppSettings.setVisibility(View.GONE);
|
mAppSettings.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1117,16 +1129,6 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private OnClickListener mAppSettingsListener = new OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if (!isAdded()) return;
|
|
||||||
|
|
||||||
// TODO: target torwards entire UID instead of just first package
|
|
||||||
startActivity(mAppSettingsIntent);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private OnItemClickListener mListListener = new OnItemClickListener() {
|
private OnItemClickListener mListListener = new OnItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
Reference in New Issue
Block a user