Permalink
Browse files

Add mechanism of auto-start management.

Change-Id: I5057064176518569abcc2f18e89f8e7508b391e0
  • Loading branch information...
HackerMi committed Dec 26, 2012
1 parent fd1771b commit 81abe6ceaddc25c61fb2518f94158712e83c9293
@@ -38,6 +38,8 @@
.field public static final FLAG_DEBUGGABLE:I = 0x2
+.field public static final FLAG_DISABLE_AUTOSTART:I = 0x40000000
+
.field public static final FLAG_EXTERNAL_STORAGE:I = 0x40000
.field public static final FLAG_FACTORY_TEST:I = 0x10
@@ -24,6 +24,8 @@
.field public static final COMPONENT_ENABLED_STATE_DISABLED_USER:I = 0x3
+.field public static final COMPONENT_ENABLED_STATE_DISABLE_AUTOSTART:I = 0x40000000
+
.field public static final COMPONENT_ENABLED_STATE_ENABLED:I = 0x1
.field public static final DELETE_FAILED_DEVICE_POLICY_MANAGER:I = -0x2
@@ -102,7 +102,7 @@
.parameter "pkgFlags"
.prologue
- const v0, -0x5ffbffff
+ const v0, -0x1ffbffff
and-int/2addr v0, p1
@@ -15605,6 +15605,34 @@
iput v4, v3, Landroid/content/pm/ApplicationInfo;->flags:I
+ move-object/from16 v0, p1
+
+ iget-object v3, v0, Landroid/content/pm/PackageParser$Package;->applicationInfo:Landroid/content/pm/ApplicationInfo;
+
+ iget v4, v3, Landroid/content/pm/ApplicationInfo;->flags:I
+
+ move-object/from16 v0, v41
+
+ iget v10, v0, Lcom/android/server/pm/PackageSetting;->pkgFlags:I
+
+ const/high16 v11, 0x4000
+
+ and-int/2addr v10, v11
+
+ or-int/2addr v4, v10
+
+ iput v4, v3, Landroid/content/pm/ApplicationInfo;->flags:I
+
+ move-object/from16 v0, p1
+
+ iget-object v3, v0, Landroid/content/pm/PackageParser$Package;->applicationInfo:Landroid/content/pm/ApplicationInfo;
+
+ move-object/from16 v0, p0
+
+ iget-object v4, v0, Lcom/android/server/pm/PackageManagerService;->mSettings:Lcom/android/server/pm/Settings;
+
+ invoke-static {v3, v4}, Lcom/android/server/pm/ExtraPackageManagerServices;->blockAutoStartedApp(Landroid/content/pm/ApplicationInfo;Lcom/android/server/pm/Settings;)V
+
move-object/from16 v0, v41
iget-object v3, v0, Lcom/android/server/pm/PackageSettingBase;->origPackage:Lcom/android/server/pm/PackageSettingBase;
@@ -20315,7 +20343,7 @@
.end method
.method private setAccessControl(Ljava/lang/String;II)Z
- .locals 7
+ .locals 9
.parameter "packageName"
.parameter "newState"
.parameter "flags"
@@ -20324,7 +20352,11 @@
.end annotation
.prologue
- const v6, 0x7fffffff
+ const v8, 0x7fffffff
+
+ const v7, -0x40000001
+
+ const/high16 v6, 0x4000
const/high16 v5, -0x8000
@@ -20334,6 +20366,8 @@
if-eq p2, v5, :cond_0
+ if-eq p2, v6, :cond_0
+
const/4 v2, 0x0
:try_start_0
@@ -20363,11 +20397,13 @@
check-cast v1, Lcom/android/server/pm/PackageSetting;
.local v1, pkgSetting:Lcom/android/server/pm/PackageSetting;
- if-eqz v0, :cond_1
+ if-eqz v0, :cond_2
- if-eqz v1, :cond_1
+ if-eqz v1, :cond_2
- if-ne p3, v5, :cond_2
+ if-ne p2, v5, :cond_4
+
+ if-ne p3, v5, :cond_3
iget v2, v1, Lcom/android/server/pm/PackageSetting;->pkgFlags:I
@@ -20383,12 +20419,13 @@
iput v4, v2, Landroid/content/pm/ApplicationInfo;->flags:I
+ :cond_1
:goto_1
iget-object v2, p0, Lcom/android/server/pm/PackageManagerService;->mSettings:Lcom/android/server/pm/Settings;
invoke-virtual {v2}, Lcom/android/server/pm/Settings;->writeLPr()V
- :cond_1
+ :cond_2
const/4 v2, 0x1
monitor-exit v3
@@ -20408,19 +20445,57 @@
.restart local v0 #pkg:Landroid/content/pm/PackageParser$Package;
.restart local v1 #pkgSetting:Lcom/android/server/pm/PackageSetting;
- :cond_2
+ :cond_3
:try_start_1
iget v2, v1, Lcom/android/server/pm/PackageSetting;->pkgFlags:I
- and-int/2addr v2, v6
+ and-int/2addr v2, v8
+
+ iput v2, v1, Lcom/android/server/pm/PackageSetting;->pkgFlags:I
+
+ iget-object v2, v0, Landroid/content/pm/PackageParser$Package;->applicationInfo:Landroid/content/pm/ApplicationInfo;
+
+ iget v4, v2, Landroid/content/pm/ApplicationInfo;->flags:I
+
+ and-int/2addr v4, v8
+
+ iput v4, v2, Landroid/content/pm/ApplicationInfo;->flags:I
+
+ goto :goto_1
+
+ :cond_4
+ if-ne p2, v6, :cond_1
+
+ if-ne p3, v6, :cond_5
+
+ iget v2, v1, Lcom/android/server/pm/PackageSetting;->pkgFlags:I
+
+ or-int/2addr v2, v6
+
+ iput v2, v1, Lcom/android/server/pm/PackageSetting;->pkgFlags:I
+
+ iget-object v2, v0, Landroid/content/pm/PackageParser$Package;->applicationInfo:Landroid/content/pm/ApplicationInfo;
+
+ iget v4, v2, Landroid/content/pm/ApplicationInfo;->flags:I
+
+ or-int/2addr v4, v6
+
+ iput v4, v2, Landroid/content/pm/ApplicationInfo;->flags:I
+
+ goto :goto_1
+
+ :cond_5
+ iget v2, v1, Lcom/android/server/pm/PackageSetting;->pkgFlags:I
+
+ and-int/2addr v2, v7
iput v2, v1, Lcom/android/server/pm/PackageSetting;->pkgFlags:I
iget-object v2, v0, Landroid/content/pm/PackageParser$Package;->applicationInfo:Landroid/content/pm/ApplicationInfo;
iget v4, v2, Landroid/content/pm/ApplicationInfo;->flags:I
- and-int/2addr v4, v6
+ and-int/2addr v4, v7
iput v4, v2, Landroid/content/pm/ApplicationInfo;->flags:I
:try_end_1

0 comments on commit 81abe6c

Please sign in to comment.