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:
committed by
Vinit Deshpande
parent
dd2106b3f2
commit
2d657e3629
@@ -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)) {
|
||||
|
Reference in New Issue
Block a user