Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix a bug that photo can be browsed under privacy mode

Change-Id: Idc7a55fdc7754af2d6c8cd5fa4d49c85ebf2972a
  • Loading branch information...
commit 0be05a6c55a624906fcbd5ed352d49425de48ef8 1 parent fe9d766
@yu88my yu88my authored
View
79 MediaProvider/smali/com/android/providers/media/MediaProvider.smali
@@ -15038,19 +15038,26 @@
if-eqz v1, :cond_9
- .line 2056
const/4 v1, 0x1
invoke-virtual {v2, v1}, Landroid/database/sqlite/SQLiteQueryBuilder;->setDistinct(Z)V
- .line 2059
:cond_9
const/4 v6, 0x0
- .line 2061
+ invoke-direct {p0, v11}, Lcom/android/providers/media/MediaProvider;->isPrivacyMode(I)Z
+
+ move-result v1
+
+ if-eqz v1, :cond_MIUI_ADD_1
+
+ const/4 v1, 0x0
+
+ goto/16 :goto_0
+
+ :cond_MIUI_ADD_1
sparse-switch v11, :sswitch_data_0
- .line 2386
new-instance v1, Ljava/lang/IllegalStateException;
new-instance v2, Ljava/lang/StringBuilder;
@@ -18018,3 +18025,67 @@
0xc9 -> :sswitch_1
.end sparse-switch
.end method
+
+.method private isPrivacyMode(I)Z
+ .locals 3
+ .parameter "table"
+ .annotation build Landroid/annotation/MiuiHook;
+ value = .enum Landroid/annotation/MiuiHook$MiuiHookType;->NEW_METHOD:Landroid/annotation/MiuiHook$MiuiHookType;
+ .end annotation
+
+ .prologue
+ const/4 v1, 0x1
+
+ if-eq p1, v1, :cond_0
+
+ const/4 v2, 0x2
+
+ if-eq p1, v2, :cond_0
+
+ const/4 v2, 0x4
+
+ if-eq p1, v2, :cond_0
+
+ const/4 v2, 0x3
+
+ if-eq p1, v2, :cond_0
+
+ const/16 v2, 0xc8
+
+ if-eq p1, v2, :cond_0
+
+ const/16 v2, 0xc9
+
+ if-eq p1, v2, :cond_0
+
+ const/16 v2, 0xca
+
+ if-eq p1, v2, :cond_0
+
+ const/16 v2, 0xcb
+
+ if-ne p1, v2, :cond_1
+
+ :cond_0
+ invoke-virtual {p0}, Lcom/android/providers/media/MediaProvider;->getContext()Landroid/content/Context;
+
+ move-result-object v2
+
+ invoke-static {v2}, Lmiui/provider/ExtraSettings$Secure;->checkPrivacyAndReturnCursor(Landroid/content/Context;)Landroid/database/Cursor;
+
+ move-result-object v0
+
+ .local v0, emptyCursor:Landroid/database/Cursor;
+ if-eqz v0, :cond_1
+
+ invoke-interface {v0}, Landroid/database/Cursor;->close()V
+
+ .end local v0 #emptyCursor:Landroid/database/Cursor;
+ :goto_0
+ return v1
+
+ :cond_1
+ const/4 v1, 0x0
+
+ goto :goto_0
+.end method
Please sign in to comment.
Something went wrong with that request. Please try again.