File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 31
31
</intent-filter >
32
32
</activity >
33
33
</application >
34
+ <uses-permission android : name =" android.permission.BACKUP" />
34
35
</manifest >
35
36
Original file line number Diff line number Diff line change 17
17
package com .android .sdksetup ;
18
18
19
19
import android .app .Activity ;
20
+ import android .app .backup .IBackupManager ;
20
21
import android .content .ComponentName ;
22
+ import android .content .Context ;
21
23
import android .content .pm .PackageManager ;
22
24
import android .location .LocationManager ;
23
25
import android .os .Bundle ;
26
+ import android .os .RemoteException ;
27
+ import android .os .ServiceManager ;
24
28
import android .provider .Settings ;
25
29
26
30
/**
@@ -43,6 +47,16 @@ protected void onCreate(Bundle icicle) {
43
47
// enable install from non market
44
48
Settings .Secure .putInt (getContentResolver (), Settings .Secure .INSTALL_NON_MARKET_APPS , 1 );
45
49
50
+ // provision the backup manager.
51
+ IBackupManager bm = IBackupManager .Stub .asInterface (
52
+ ServiceManager .getService (Context .BACKUP_SERVICE ));
53
+ if (bm != null ) {
54
+ try {
55
+ bm .setBackupProvisioned (true );
56
+ } catch (RemoteException e ) {
57
+ }
58
+ }
59
+
46
60
// remove this activity from the package manager.
47
61
PackageManager pm = getPackageManager ();
48
62
ComponentName name = new ComponentName (this , DefaultActivity .class );
You can’t perform that action at this time.
0 commit comments