File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
core/java/android/app/backup Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -145,8 +145,10 @@ public int requestRestore(RestoreObserver observer) {
145145 try {
146146 IRestoreSession binder = sService .beginRestoreSession (mContext .getPackageName (),
147147 null );
148- session = new RestoreSession (mContext , binder );
149- result = session .restorePackage (mContext .getPackageName (), observer );
148+ if (binder != null ) {
149+ session = new RestoreSession (mContext , binder );
150+ result = session .restorePackage (mContext .getPackageName (), observer );
151+ }
150152 } catch (RemoteException e ) {
151153 Log .w (TAG , "restoreSelf() unable to contact service" );
152154 } finally {
@@ -170,7 +172,9 @@ public RestoreSession beginRestoreSession() {
170172 try {
171173 // All packages, current transport
172174 IRestoreSession binder = sService .beginRestoreSession (null , null );
173- session = new RestoreSession (mContext , binder );
175+ if (binder != null ) {
176+ session = new RestoreSession (mContext , binder );
177+ }
174178 } catch (RemoteException e ) {
175179 Log .w (TAG , "beginRestoreSession() couldn't connect" );
176180 }
You can’t perform that action at this time.
0 commit comments