Separate wifi AP added by applications.

-Add permission to allow settings to modify all wifi APs
-Add option to show AP owners.

Change-Id: I12943563ef714c4287e13488578f020d136d006d
This commit is contained in:
Sky Faber
2014-09-22 16:43:04 -07:00
committed by Vinit Deshpande
parent dd2106b3f2
commit 2d657e3629
4 changed files with 47 additions and 0 deletions

View File

@@ -19,6 +19,8 @@ package com.android.settings.wifi;
import com.android.settings.R;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
import android.net.NetworkInfo.DetailedState;
@@ -286,6 +288,26 @@ class AccessPoint extends Preference {
}
}
public void showAppIcon() {
PackageManager pm = getContext().getPackageManager();
String systemName = pm.getNameForUid(android.os.Process.SYSTEM_UID);
Drawable drawable = pm.getDefaultActivityIcon();
if (mConfig == null) {
drawable.setAlpha(0);
} else if (mConfig.creatorName.equals(systemName)) {
drawable = getContext().getApplicationInfo().loadIcon(pm);
} else {
try {
drawable = pm.getApplicationIcon(mConfig.creatorName);
} catch (NameNotFoundException nnfe) {
// use default app icon
}
}
setIcon(drawable);
}
@Override
public int compareTo(Preference preference) {
if (!(preference instanceof AccessPoint)) {