Commit e4b535bf by 郑鹏

更改权限判断位置

parent 52e58a56
...@@ -103,7 +103,7 @@ ext { ...@@ -103,7 +103,7 @@ ext {
GITHUB_REPO_PATH = "../../androidlibrary" GITHUB_REPO_PATH = "../../androidlibrary"
PUBLISH_GROUP_ID = 'cn.dankal.android' PUBLISH_GROUP_ID = 'cn.dankal.android'
PUBLISH_ARTIFACT_ID = 'launcher' PUBLISH_ARTIFACT_ID = 'launcher'
PUBLISH_VERSION = '1.4.4.5' PUBLISH_VERSION = '1.4.4.6'
} }
uploadArchives { uploadArchives {
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
android:taskAffinity="" android:taskAffinity=""
android:windowSoftInputMode="adjustPan"> android:windowSoftInputMode="adjustPan">
<intent-filter> <intent-filter>
<!-- <category android:name="android.intent.category.HOME" />--> <category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY" /> <category android:name="android.intent.category.MONKEY" />
<category android:name="android.intent.category.LAUNCHER_APP" /> <category android:name="android.intent.category.LAUNCHER_APP" />
......
...@@ -51,12 +51,14 @@ import android.content.Intent; ...@@ -51,12 +51,14 @@ import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.content.IntentSender; import android.content.IntentSender;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.LauncherActivityInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.graphics.Point; import android.graphics.Point;
import android.graphics.drawable.Drawable;
import android.net.Uri; import android.net.Uri;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Build; import android.os.Build;
...@@ -111,14 +113,18 @@ import com.android.launcher3.allapps.AllAppsTransitionController; ...@@ -111,14 +113,18 @@ import com.android.launcher3.allapps.AllAppsTransitionController;
import com.android.launcher3.allapps.DiscoveryBounce; import com.android.launcher3.allapps.DiscoveryBounce;
import com.android.launcher3.badge.BadgeInfo; import com.android.launcher3.badge.BadgeInfo;
import com.android.launcher3.compat.AppWidgetManagerCompat; import com.android.launcher3.compat.AppWidgetManagerCompat;
import com.android.launcher3.compat.LauncherAppsCompat;
import com.android.launcher3.compat.LauncherAppsCompatVO; import com.android.launcher3.compat.LauncherAppsCompatVO;
import com.android.launcher3.compat.ShortcutConfigActivityInfo;
import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.dialog.TipsDialog; import com.android.launcher3.dialog.TipsDialog;
import com.android.launcher3.dragndrop.DragController; import com.android.launcher3.dragndrop.DragController;
import com.android.launcher3.dragndrop.DragLayer; import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.dragndrop.DragView; import com.android.launcher3.dragndrop.DragView;
import com.android.launcher3.dragndrop.FolderAdaptiveIcon;
import com.android.launcher3.folder.FolderIcon; import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.folder.FolderIconPreviewVerifier; import com.android.launcher3.folder.FolderIconPreviewVerifier;
import com.android.launcher3.graphics.LauncherIcons;
import com.android.launcher3.keyboard.CustomActionsPopup; import com.android.launcher3.keyboard.CustomActionsPopup;
import com.android.launcher3.keyboard.ViewGroupFocusHelper; import com.android.launcher3.keyboard.ViewGroupFocusHelper;
import com.android.launcher3.logging.FileLog; import com.android.launcher3.logging.FileLog;
...@@ -133,6 +139,8 @@ import com.android.launcher3.notification.NotificationListener; ...@@ -133,6 +139,8 @@ import com.android.launcher3.notification.NotificationListener;
import com.android.launcher3.popup.PopupContainerWithArrow; import com.android.launcher3.popup.PopupContainerWithArrow;
import com.android.launcher3.popup.PopupDataProvider; import com.android.launcher3.popup.PopupDataProvider;
import com.android.launcher3.shortcuts.DeepShortcutManager; import com.android.launcher3.shortcuts.DeepShortcutManager;
import com.android.launcher3.shortcuts.ShortcutInfoCompat;
import com.android.launcher3.shortcuts.ShortcutKey;
import com.android.launcher3.states.InternalStateHandler; import com.android.launcher3.states.InternalStateHandler;
import com.android.launcher3.states.RotationHelper; import com.android.launcher3.states.RotationHelper;
import com.android.launcher3.touch.ItemClickHandler; import com.android.launcher3.touch.ItemClickHandler;
...@@ -178,6 +186,7 @@ import com.android.launcher3.widget.custom.CustomWidgetParser; ...@@ -178,6 +186,7 @@ import com.android.launcher3.widget.custom.CustomWidgetParser;
import java.io.FileDescriptor; import java.io.FileDescriptor;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
...@@ -2806,8 +2815,17 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, ...@@ -2806,8 +2815,17 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
iconRes.packageName = shortcutInfo.intent.getComponent().getPackageName(); iconRes.packageName = shortcutInfo.intent.getComponent().getPackageName();
shortcutInfo.iconResource = iconRes; shortcutInfo.iconResource = iconRes;
shortcutInfo.intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconRes);*/ shortcutInfo.intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconRes);*/
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_logo);
/* LauncherAppState appState = LauncherAppState.getInstance(Launcher.this);
Object[] outObj = new Object[1];
final Drawable dr = getFullDrawable(bitmap, shortcutInfo, appState, outObj);
ShortcutInfoCompat si = (ShortcutInfoCompat) outObj[0];
shortcutInfo.contentDescription = shortcutInfo.title; shortcutInfo.contentDescription = shortcutInfo.title;
shortcutInfo.iconBitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.logo); LauncherIcons li = LauncherIcons.obtain(appState.getContext());
Bitmap badge = li.getShortcutInfoBadge(si, appState.getIconCache()).iconBitmap;
li.recycle();*/
shortcutInfo.iconBitmap = bitmap;
} }
shortcutInfo.onAddToDatabase(writer); shortcutInfo.onAddToDatabase(writer);
...@@ -3110,4 +3128,48 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, ...@@ -3110,4 +3128,48 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
void onLauncherResume(); void onLauncherResume();
} }
/**
* Returns the full drawable for {@param info}.
*
* @param outObj this is set to the internal data associated with {@param info},
* eg {@link LauncherActivityInfo} or {@link ShortcutInfoCompat}.
*/
private Drawable getFullDrawable(Bitmap bitmap, ItemInfo info, LauncherAppState appState, Object[] outObj) {
if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION) {
LauncherActivityInfo activityInfo = LauncherAppsCompat.getInstance(this)
.resolveActivity(info.getIntent(), info.user);
outObj[0] = activityInfo;
return (activityInfo != null) ? appState.getIconCache()
.getFullResIcon(activityInfo, false) : null;
} else if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT) {
if (info instanceof PendingAddShortcutInfo) {
ShortcutConfigActivityInfo activityInfo =
((PendingAddShortcutInfo) info).activityInfo;
outObj[0] = activityInfo;
return activityInfo.getFullResIcon(appState.getIconCache());
}
ShortcutKey key = ShortcutKey.fromItemInfo(info);
DeepShortcutManager sm = DeepShortcutManager.getInstance(this);
List<ShortcutInfoCompat> si = sm.queryForFullDetails(
key.componentName.getPackageName(), Arrays.asList(key.getId()), key.user);
if (si.isEmpty()) {
return null;
} else {
outObj[0] = si.get(0);
return sm.getShortcutIconDrawable(si.get(0),
appState.getInvariantDeviceProfile().fillResIconDpi);
}
} else if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_FOLDER) {
FolderAdaptiveIcon icon = FolderAdaptiveIcon.createFolderAdaptiveIcon(
this, info.id, new Point(bitmap.getWidth(), bitmap.getHeight()));
if (icon == null) {
return null;
}
outObj[0] = icon;
return icon;
} else {
return null;
}
}
} }
...@@ -470,7 +470,7 @@ public class ListenerAppService extends Service { ...@@ -470,7 +470,7 @@ public class ListenerAppService extends Service {
PendingIntent pendingIntent = PendingIntent.getActivity(this, 200, home, 0); PendingIntent pendingIntent = PendingIntent.getActivity(this, 200, home, 0);
Notification.Builder builder = new Notification.Builder(this) Notification.Builder builder = new Notification.Builder(this)
.setSmallIcon(R.mipmap.logo) .setSmallIcon(R.mipmap.ic_logo)
.setContentTitle("“倍知守护孩子端”正在运行") .setContentTitle("“倍知守护孩子端”正在运行")
.setContentText("倍知守护孩子端管控中") .setContentText("倍知守护孩子端管控中")
.setContentIntent(pendingIntent); .setContentIntent(pendingIntent);
......
...@@ -926,7 +926,7 @@ public class LauncherManager { ...@@ -926,7 +926,7 @@ public class LauncherManager {
intent.setComponent(cn); intent.setComponent(cn);
Uri uri = Uri.parse("cn.dankal.bzshchild.ui.SplashActivity"); Uri uri = Uri.parse("cn.dankal.bzshchild.ui.SplashActivity");
/*ComponentName cn = new ComponentName("com.dankal.dankal_launcher", "com.dankal.dankal_launcher.PackageManageActivity"); /* ComponentName cn = new ComponentName("com.dankal.dankal_launcher", "com.dankal.dankal_launcher.PackageManageActivity");
intent.setComponent(cn); intent.setComponent(cn);
Uri uri = Uri.parse("com.dankal.dankal_launcher.PackageManageActivity");*/ Uri uri = Uri.parse("com.dankal.dankal_launcher.PackageManageActivity");*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment